:root {
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --bg-subtle: #f8f9fb;
  --bg-hover: #f1f3f6;
  --bg-header: rgba(255, 255, 255, 0.95);

  --border-light: #e4e7ec;
  --border-strong: #cbd5e1;
  --border-ink: #111827;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --accent-primary: #111827;
  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;
  --accent-blue-border: #bfdbfe;

  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;

  --shadow-card: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
}

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

html, body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header — Clean White */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--text-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.brand-title h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.brand-badge-wasm {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border-color: var(--accent-blue-border);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.security-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.security-pill.ok {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
  background: #ffffff;
}

.lang-btn.active {
  background: var(--text-primary);
  color: #ffffff;
}

/* Main Navigation Tabs */
.nav-tabs-bar {
  margin: 20px 0 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.tab-btn {
  flex: 1;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--text-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.07);
  color: inherit;
  font-weight: 600;
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Tab Panels & Grid */
.tab-panel {
  display: none;
  padding-bottom: 48px;
}

.tab-panel.active {
  display: block;
}

.workstation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 920px) {
  .workstation-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.card-full {
  grid-column: 1 / -1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Step Sections inside Cards */
.step-block {
  margin-bottom: 16px;
}

.step-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #ffffff;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-right: 6px;
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.15s ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

.dropzone-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.dropzone-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-textarea {
  min-height: 84px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Collapsible Advanced Drawer */
.advanced-details {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.advanced-details summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.advanced-details summary::-webkit-details-marker {
  display: none;
}

.advanced-details summary::after {
  content: "展开 ▾";
  font-size: 11px;
  color: var(--text-muted);
}

.advanced-details[open] summary::after {
  content: "收起 ▴";
}

.advanced-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Capacity Bar */
.capacity-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 14px;
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.capacity-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-blue);
  transition: width 0.2s ease;
}

.capacity-fill.warn {
  background: var(--color-danger);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text-primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #27272a;
}

.btn-emerald {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-primary);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Preview & Canvas Stage */
.canvas-stage {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.canvas-stage canvas {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: #ffffff;
}

.waveform-canvas {
  width: 100%;
  height: 96px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: block;
}

/* Telemetry Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-value.emerald {
  color: var(--color-success);
}

/* Result Box */
.result-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: #065f46;
  font-size: 13px;
}

.result-box.error {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

.result-output-pre {
  margin-top: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
}

/* Segmented Control */
.segmented-control {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--accent-blue);
  width: 14px;
  height: 14px;
}

/* Video Box List */
.box-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.atom-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.atom-card.stego-atom {
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

.atom-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
}

.atom-card.stego-atom .atom-type {
  color: var(--color-success);
}

/* Audit Grid */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.audit-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.audit-item.pass {
  border-left: 3px solid var(--color-success);
}

.audit-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hash-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 6px;
  word-break: break-all;
  margin-top: 6px;
  border: 1px solid var(--border-light);
}

.is-hidden {
  display: none !important;
}

.audio-player {
  width: 100%;
  height: 34px;
  margin-top: 6px;
}
