/* ==========================================================================
   visual-tools.css — XNTOU Top 10 图形化效率工作台
   Apple/editorial 深墨绿 × 暖金主题 · 响应式双栏工作台 · WCAG AA 对比度
   ========================================================================== */

:root {
  --vt-ink: #0b1220;
  --vt-deep: #0f2d2a;
  --vt-emerald: #0f766e;
  --vt-emerald-soft: #d9f2ea;
  --vt-gold: #f59e0b;
  --vt-gold-soft: #fff4d6;
  --vt-text: #16231f;
  --vt-muted: #475569;
  --vt-line: rgba(15, 23, 42, 0.12);
  --vt-surface: #ffffff;
  --vt-stage: #0b111d;
  --vt-stage-text: #f1f5f9;
}

/* ------------------------------ 页面骨架 ------------------------------ */
.vt-page {
  margin: 0 auto;
  padding: 0 16px 32px;
  max-width: 1440px;
  color: var(--vt-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.vt-page * { box-sizing: border-box; }

.vt-hero {
  position: relative;
  margin: 0 0 22px;
  padding: 32px 30px 28px;
  overflow: hidden;
  color: #f8fafc;
  background: linear-gradient(135deg, #0b1220 0%, #102c2b 58%, #145449 100%);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(11, 18, 32, 0.18);
}

.vt-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(245, 158, 11, 0.18), transparent 42%);
  pointer-events: none;
}

.vt-hero > * { position: relative; z-index: 1; }

.vt-hero-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fcd34d;
  text-transform: uppercase;
}

.vt-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.vt-hero-lede {
  max-width: 860px;
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
}

.vt-hero a { color: #fde68a; }

/* --------------------------- 工具切换导航轨 --------------------------- */
.vt-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid var(--vt-line);
  border-radius: 14px;
  background: var(--vt-surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.vt-rail-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--vt-line);
  border-radius: 999px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.vt-rail-item:hover {
  border-color: var(--vt-emerald);
  color: #065f46;
  background: var(--vt-emerald-soft);
}

.vt-rail-item.is-active {
  border-color: #065f46;
  background: linear-gradient(135deg, #0f766e, #065f46);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.32);
}

.vt-rail-item.is-active small { color: #d1fae5; }

.vt-rail-item small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

/* --------------------------- 双栏工作台布局 --------------------------- */
.vt-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  gap: 18px;
  align-items: start;
}

.vt-controls,
.vt-stage {
  min-width: 0;
  border-radius: 18px;
}

.vt-controls {
  padding: 18px;
  background: var(--vt-surface);
  border: 1px solid var(--vt-line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.vt-stage {
  padding: 18px;
  background: #f6f8fa;
  border: 1px solid var(--vt-line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.vt-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.vt-stage-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--vt-ink);
}

.vt-stage-head p {
  margin: 0;
  font-size: 12px;
  color: var(--vt-muted);
}

/* ----------------------------- 预设按钮组 ----------------------------- */
.vt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.vt-preset {
  flex: 1 1 auto;
  min-width: 96px;
  padding: 9px 12px;
  border: 1px solid var(--vt-line);
  border-radius: 11px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.vt-preset:hover {
  border-color: var(--vt-emerald);
  background: var(--vt-emerald-soft);
  color: #065f46;
  transform: translateY(-1px);
}

.vt-preset.is-active {
  border-color: #b45309;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1c1917;
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.26);
}

.vt-preset.is-active:hover { transform: none; }

/* ------------------------------- 输入字段 ------------------------------ */
.vt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.vt-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.vt-field-label small {
  font-size: 11px;
  font-weight: 600;
  color: var(--vt-muted);
}

.vt-field input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--vt-emerald);
  cursor: pointer;
}

.vt-field input[type="number"],
.vt-field input[type="text"],
.vt-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  background: #ffffff;
  color: var(--vt-text);
  font: inherit;
  font-size: 13px;
}

.vt-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--vt-emerald);
  cursor: pointer;
}

.vt-field-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--vt-muted);
  line-height: 1.5;
}

/* ------------------------------- KPI 卡片 ------------------------------ */
.vt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.vt-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--vt-line);
  border-radius: 13px;
  background: #ffffff;
}

.vt-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.vt-kpi-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--vt-ink);
  overflow-wrap: anywhere;
}

.vt-kpi-value.is-good { color: #047857; }
.vt-kpi-value.is-warn { color: #b45309; }
.vt-kpi-value.is-risk { color: #b91c1c; }

.vt-kpi-sub {
  font-size: 11px;
  color: var(--vt-muted);
}

/* ------------------------------ 深色图表区 ----------------------------- */
.vt-chart-box {
  position: relative;
  min-height: 360px;
  padding: 18px;
  overflow: hidden;
  background: var(--vt-stage);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  color: var(--vt-stage-text);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
}

.vt-chart-box:hover { border-color: rgba(245, 158, 11, 0.35); }

.vt-chart-box > h3,
.vt-chart-box > .vt-chart-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.vt-chart-box p,
.vt-chart-box small,
.vt-chart-box span { color: #cbd5e1; }

.vt-chart-box svg,
.vt-chart-box canvas {
  display: block;
  max-width: 100%;
}

.vt-chart-box [role="img"]:focus-visible { outline-offset: 3px; }

/* ------------------------------ 操作与按钮 ----------------------------- */
.vt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.vt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.vt-btn:hover {
  border-color: var(--vt-emerald);
  background: var(--vt-emerald-soft);
  color: #065f46;
  transform: translateY(-1px);
}

.vt-btn.is-primary {
  border-color: #065f46;
  background: linear-gradient(135deg, #0f766e, #065f46);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.28);
}

.vt-btn.is-primary:hover { filter: brightness(1.08); color: #ffffff; }

.vt-btn.is-gold {
  border-color: #b45309;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1c1917;
}

.vt-btn.is-gold:hover { filter: brightness(1.05); color: #1c1917; }

.vt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* -------------------------- 深链与合规信息 ----------------------------- */
.vt-deeplinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--vt-line);
}

.vt-deeplinks a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.vt-deeplinks a:hover {
  background: #065f46;
  color: #ffffff;
}

.vt-compliance {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--vt-line);
  border-left: 4px solid var(--vt-emerald);
  border-radius: 14px;
  background: var(--vt-surface);
  color: var(--vt-text);
  font-size: 12.5px;
  line-height: 1.65;
}

.vt-compliance h2,
.vt-compliance h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--vt-ink);
}

.vt-compliance dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 18px;
  margin: 0 0 8px;
}

.vt-compliance dt {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
}

.vt-compliance dd {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--vt-ink);
}

.vt-compliance p { margin: 0; color: var(--vt-muted); }

/* ------------------------- 键盘可见焦点（统一） ------------------------ */
.vt-page :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.vt-page [role="img"]:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 960px) {
  .vt-workbench { grid-template-columns: 1fr; }
  .vt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vt-controls { order: 1; }
  .vt-stage { order: 2; }
}

@media (max-width: 600px) {
  .vt-page { padding: 0 10px 24px; }
  .vt-hero { padding: 24px 18px; border-radius: 16px; }
  .vt-rail { flex-wrap: nowrap; overflow-x: auto; }
  .vt-rail-item { flex-shrink: 0; }
  .vt-controls,
  .vt-stage { padding: 14px; border-radius: 14px; }
  .vt-chart-box { min-height: 360px; padding: 12px; }
  .vt-presets { gap: 6px; }
  .vt-preset { min-width: calc(50% - 3px); }
  .vt-compliance dl { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .vt-page *,
  .vt-page *::before,
  .vt-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
