/* 月亮花选择 Web 版 — 样式 */

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --border: #334155;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --purple: #a855f7;
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Header */
.app-header {
  text-align: center;
  padding: 20px 20px 12px;
  background: linear-gradient(135deg, var(--bg-card), #1a1a2e);
  border-bottom: 1px solid var(--border);
}
.app-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}
.version {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 8px;
}
.subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Tab Nav */
.tab-nav {
  display: flex;
  gap: 2px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg-input); color: var(--text); }
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Tab Panels */
.tab-panel { display: none; padding: 16px; }
.tab-panel.active { display: block; }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar label {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-accent { background: var(--purple); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #9333ea; }
.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) { background: var(--bg-input); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }

/* Inputs */
.input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-sm { width: 80px; }

/* Status */
.status-text {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-left: auto;
}

/* Progress */
.progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* Split Pane */
.split-pane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: calc(100vh - 260px);
  min-height: 400px;
}
.split-pane h3 {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* Log Panel */
.log-panel {
  background: #0a0f1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-y: auto;
  height: 100%;
  white-space: pre-wrap;
  word-break: break-all;
}
.log-panel.full-log { height: calc(100vh - 200px); }
.log-placeholder { color: var(--text-dim); font-style: italic; }
.log-line { padding: 1px 0; }
.log-line.info { color: var(--text-dim); }
.log-line.success { color: var(--green); }
.log-line.warning { color: var(--yellow); }
.log-line.error { color: var(--red); }

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table th {
  background: var(--bg-input);
  color: var(--text-dim);
  padding: 8px 6px;
  text-align: center;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 6px;
  text-align: center;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  color: var(--text);
}
.data-table tbody tr:hover { background: rgba(59, 130, 246, 0.08); }
.data-table .text-left { text-align: left; }
.data-table .positive { color: var(--green); }
.data-table .negative { color: var(--red); }
.table-wrap {
  overflow-y: auto;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pane-right .table-wrap,
.pane-left .table-wrap {
  max-height: calc(100% - 30px);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 700px;
}
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: #fff;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group label {
  display: block;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 4px;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-sm { width: 360px; }
.modal h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #fff;
}
.modal .form-grid { margin-bottom: 8px; }

/* Action buttons in table */
.action-btn {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  margin: 0 2px;
  transition: all 0.15s;
}
.action-btn:hover { background: var(--bg-input); color: var(--text); }
.action-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* Alert badges */
.alert-danger { color: var(--red); font-weight: 600; }
.alert-warning { color: var(--yellow); }
.alert-info { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .split-pane { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 8px 12px; font-size: 0.8rem; }
}
