/* ============================================================
   工资个税计算器 · 科技感设计系统
   深蓝夜空 + 青色霓虹 + 玻璃拟态
   ============================================================ */

:root {
  --bg: #0b0f1a;
  --bg-panel: rgba(17, 24, 39, 0.72);
  --bg-panel-solid: #111827;
  --line: rgba(34, 211, 238, 0.14);
  --line-soft: rgba(148, 163, 184, 0.12);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.12);
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --green: #34d399;
  --red: #f87171;
  --num: "Rajdhani", "Noto Sans SC", sans-serif;
  --sans: "Noto Sans SC", -apple-system, sans-serif;
}

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

[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

/* ---------- 背景：网格 + 辉光 ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 55% 40% at 18% -5%, rgba(34, 211, 238, 0.13), transparent 65%),
    radial-gradient(ellipse 45% 35% at 85% 10%, rgba(139, 92, 246, 0.11), transparent 65%),
    radial-gradient(ellipse 40% 30% at 60% 100%, rgba(34, 211, 238, 0.06), transparent 70%);
}
::selection { background: rgba(34, 211, 238, 0.3); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 22px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--num); font-size: 26px; font-weight: 700; color: var(--cyan);
  background: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(139,92,246,0.16));
  border: 1px solid var(--line);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.22);
}
.brand h1 { font-size: 20px; font-weight: 900; letter-spacing: 1px; }
.brand p { font-size: 12.5px; color: var(--text-dim); }
.brand p span { color: var(--cyan); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 8px 20px; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.22s ease;
}
.tab:hover { color: var(--cyan); border-color: var(--line); }
.tab.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.15);
}

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  padding: 24px clamp(18px, 4vw, 48px) 40px;
  max-width: 1460px; margin: 0 auto;
  align-items: start;
}

/* ---------- 地图横幅 ---------- */
.map-banner {
  max-width: 1460px;
  margin: 22px auto 0;
  padding: 0 clamp(18px, 4vw, 48px);
}
.map-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.map-current { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.map-current-label {
  font-size: 12px; color: var(--text-faint); letter-spacing: 2px;
}
.map-current b {
  font-family: var(--num); font-size: 28px; font-weight: 700; color: var(--cyan);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.45);
}
.map-current-sub { font-size: 12.5px; color: var(--text-dim); }
.map-hint { font-size: 12px; color: var(--text-faint); }
.map-hint b { color: var(--cyan); font-weight: 500; }
.china-map {
  width: 100%; height: 460px;
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.04);
  overflow: hidden;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 22px;
  backdrop-filter: blur(12px);
  margin-bottom: 22px;
}
.panel-title {
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.panel-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}
.panel-title .dim { font-size: 12px; color: var(--text-faint); font-weight: 400; }

/* ---------- 输入面板 ---------- */
.input-panel { position: sticky; top: 100px; }
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-dim); margin-bottom: 7px; letter-spacing: 0.5px;
}
.accent { color: var(--cyan); font-family: var(--num); font-size: 15px; }
.input {
  width: 100%; padding: 11px 14px;
  background: rgba(2, 6, 17, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--text); font-family: var(--sans); font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
}
.input:focus { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }
.input.num { font-family: var(--num); font-weight: 600; font-size: 17px; letter-spacing: 0.5px; }
select.input { appearance: none; cursor: pointer; }
select.input option { background: var(--bg-panel-solid); }

.range {
  width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(90deg, var(--cyan) var(--fill, 100%), rgba(148,163,184,0.2) var(--fill, 100%));
  border-radius: 3px; outline: none; cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
  border: 3px solid #0b0f1a;
}

.advanced {
  border: 1px dashed var(--line-soft); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
.advanced summary {
  cursor: pointer; font-size: 13px; color: var(--text-dim);
  user-select: none; margin-bottom: 4px;
}
.advanced[open] summary { margin-bottom: 14px; color: var(--cyan); }
.advanced .field { margin-bottom: 12px; }

.sub-title { font-size: 13px; color: var(--text-dim); margin: 4px 0 12px; letter-spacing: 1px; }

.special-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.special-row {
  display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: center;
}
.special-name { font-size: 13.5px; }
.special-name .per { color: var(--text-faint); font-size: 12px; display: block; }
.special-row .input { padding: 8px 12px; font-size: 15px; }

.hint { font-size: 12px; color: var(--text-faint); line-height: 1.7; }
.city-note {
  font-size: 12px; color: var(--amber); line-height: 1.8;
  border-top: 1px dashed var(--line-soft); padding-top: 14px;
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.kpi {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.kpi:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, 0.35); }
.kpi::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--kc, var(--cyan)), transparent);
  opacity: 0.7;
}
.kpi-label { font-size: 12.5px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 6px; }
.kpi-value {
  font-family: var(--num); font-size: 30px; font-weight: 700; line-height: 1.2;
  color: var(--kc, var(--cyan));
  text-shadow: 0 0 22px color-mix(in srgb, var(--kc, var(--cyan)) 40%, transparent);
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---------- 图表 ---------- */
.chart-panel { overflow: hidden; }
.chart { width: 100%; height: 380px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px;
  color: var(--text-dim); font-weight: 500; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--num); font-weight: 500; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: rgba(34, 211, 238, 0.05); }
.table td:first-child { font-family: var(--sans); color: var(--text-dim); }
.table .neg { color: var(--green); }
.table .tax { color: var(--amber); }

/* ---------- 标签页 ---------- */
.tab-page { display: none; }
.tab-page.active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 年终奖对比 ---------- */
.bonus-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .bonus-compare { grid-template-columns: 1fr; } }
.bonus-card {
  background: var(--bg-panel); border: 1px solid var(--line-soft);
  border-radius: 16px; padding: 24px; position: relative;
}
.bonus-card.best { border-color: rgba(52, 211, 153, 0.45); box-shadow: 0 0 30px rgba(52, 211, 153, 0.08); }
.badge {
  position: absolute; top: -11px; right: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 12px; border-radius: 999px;
  background: var(--green); color: #06251b;
}
.bonus-card h3 { font-size: 16px; margin-bottom: 4px; }
.bonus-card .method { font-size: 12.5px; color: var(--text-faint); margin-bottom: 18px; }
.bonus-line {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
  font-size: 14px;
}
.bonus-line b { font-family: var(--num); font-size: 17px; }
.bonus-line .tax-v { color: var(--amber); }
.bonus-line .net-v { color: var(--cyan); }
.bonus-total { margin-top: 16px; text-align: right; font-size: 13px; color: var(--text-dim); }
.bonus-total b { font-family: var(--num); font-size: 22px; color: var(--green); }

/* ---------- 反推 ---------- */
.reverse-row { display: flex; gap: 12px; margin: 16px 0 20px; }
.reverse-row .input { max-width: 300px; }
.btn {
  font-family: var(--sans); font-size: 14.5px; font-weight: 700;
  padding: 0 26px; border: none; border-radius: 10px; cursor: pointer;
  color: #062a33;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.35);
  transition: all 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(34, 211, 238, 0.45); }
.btn:active { transform: none; }
.reverse-card {
  background: var(--cyan-dim); border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 14px; padding: 22px;
}
.reverse-card .big {
  font-family: var(--num); font-size: 42px; font-weight: 700; color: var(--cyan);
  text-shadow: 0 0 26px rgba(34, 211, 238, 0.4);
}
.reverse-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-top: 16px;
}
.reverse-grid .cell { font-size: 13px; color: var(--text-dim); }
.reverse-grid .cell b { display: block; font-family: var(--num); font-size: 19px; color: var(--text); margin-top: 2px; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 26px 20px 34px;
  color: var(--text-faint); font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}
.footer .map-credit { margin-top: 6px; font-size: 11.5px; opacity: 0.7; }

@media (max-width: 640px) {
  .kpi-value { font-size: 24px; }
  .chart { height: 300px; }
  .china-map { height: 320px; }
  .map-current b { font-size: 22px; }
  .reverse-row { flex-direction: column; }
  .reverse-row .input { max-width: none; }
  .btn { padding: 12px; }
}
