/* ============ 基础工具 ============ */
.hidden { display: none !important; }
.muted { color: var(--ink-500); }
.tiny { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.divider { height: 1px; background: var(--ink-100); margin: var(--sp-4) 0; }

/* ============ 按钮 ============ */
.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink-700);
  --btn-bd: var(--ink-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.btn:hover { background: var(--ink-50); color: var(--ink-900); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { --btn-bg: var(--accent-600); --btn-fg: #fff; --btn-bd: var(--accent-600); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-700); color: #fff; border-color: var(--accent-700); }

.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--ink-600); }
.btn-ghost:hover { background: var(--ink-100); }

.btn-danger { --btn-bg: var(--danger-600); --btn-fg: #fff; --btn-bd: var(--danger-600); }
.btn-danger:hover { background: #991b1b; color: #fff; border-color: #991b1b; }

.btn-outline-danger { --btn-fg: var(--danger-600); --btn-bd: #fecaca; }
.btn-outline-danger:hover { background: var(--danger-100); color: var(--danger-600); }

.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: none; color: var(--accent-600); padding: 0; min-height: 0; font-weight: 550; }
.btn-link:hover { text-decoration: underline; background: none; }

/* ============ 卡片 ============ */
.card {
  background: var(--paper);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-100);
}
.card-head h2 { font-size: 15.5px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--ink-100); background: var(--ink-50); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ============ 徽标 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.7;
  background: var(--ink-100);
  color: var(--ink-600);
  white-space: nowrap;
}
.badge-ok { background: var(--ok-100); color: var(--ok-600); }
.badge-warn { background: var(--warn-100); color: var(--warn-600); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-info { background: var(--info-100); color: var(--info-600); }
.badge-accent { background: var(--accent-100); color: var(--accent-700); }
.badge-l1 { background: var(--l1-bg); color: var(--l1); }
.badge-l2 { background: var(--l2-bg); color: var(--l2); }
.badge-l3 { background: var(--l3-bg); color: var(--l3); }

/* ============ 表单 ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }
.field .hint { font-size: 12px; color: var(--ink-500); }
.field .err { font-size: 12px; color: var(--danger-600); }

.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-500); box-shadow: var(--ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.65; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%), linear-gradient(135deg, var(--ink-500) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input[type="range"] { padding: 0; border: 0; min-height: 28px; background: transparent; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-600); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent-600); width: 15px; height: 15px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-4); }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ============ 提示 ============ */
.alert {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--ink-200);
  border-left: 3px solid var(--ink-400);
  border-radius: var(--r-sm);
  background: var(--ink-50);
  color: var(--ink-700);
  font-size: 13px;
}
.alert strong { font-weight: 650; }
.alert .alert-body { min-width: 0; }
.alert-ok { background: #f0fdf4; border-color: #bbf7d0; border-left-color: var(--ok-600); color: #14532d; }
.alert-warn { background: #fffbeb; border-color: #fde68a; border-left-color: var(--warn-600); color: #78350f; }
.alert-danger { background: #fef2f2; border-color: #fecaca; border-left-color: var(--danger-600); color: #7f1d1d; }
.alert-info { background: var(--accent-50); border-color: #a5f3fc; border-left-color: var(--accent-600); color: #164e63; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-100);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--ink-100); color: var(--ink-700); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--ink-50); }
.table .num { font-variant-numeric: tabular-nums; }

/* ============ 空状态 / 加载 ============ */
.empty { padding: 40px 20px; text-align: center; color: var(--ink-500); }
.empty h3 { color: var(--ink-600); margin-bottom: 6px; font-size: 14px; }
.empty p { font-size: 13px; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--ink-200);
  border-top-color: var(--accent-600);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 认证页 ============ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--paper);
}
.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #e6f6fa;
  background:
    radial-gradient(900px 500px at -10% 10%, rgba(8, 145, 178, .5), transparent 60%),
    radial-gradient(700px 500px at 110% 90%, rgba(14, 116, 144, .45), transparent 55%),
    linear-gradient(150deg, #0b2733 0%, #103b4a 45%, #0d5c6e 100%);
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .35;
  animation: drift 26s linear infinite;
  pointer-events: none;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: 260px 260px; } }
.auth-aside > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.auth-brand .mark { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-size: 14px; }
.auth-aside h1 { color: #fff; font-size: 34px; line-height: 1.25; letter-spacing: -.02em; max-width: 420px; }
.auth-aside .lede { margin-top: 16px; max-width: 400px; color: rgba(230, 246, 250, .78); font-size: 14px; line-height: 1.8; }
.auth-points { display: grid; gap: 12px; margin-top: 32px; }
.auth-point { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(230, 246, 250, .8); }
.auth-point i { width: 6px; height: 6px; border-radius: 50%; background: #67e8f9; box-shadow: 0 0 0 4px rgba(103, 232, 249, .16); }
.auth-foot { font-size: 12px; color: rgba(230, 246, 250, .5); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 396px; }
.auth-card .eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-600); }
.auth-card h2 { font-size: 24px; margin: 8px 0 6px; }
.auth-card .sub { color: var(--ink-500); font-size: 13.5px; margin-bottom: 26px; }
.auth-card .after { margin-top: 22px; text-align: center; font-size: 13px; color: var(--ink-500); }
.auth-card form .btn { margin-top: 4px; }

/* ============ 应用外壳 ============ */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0d1b24;
  color: #b8c7d4;
  padding: 18px 12px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.brand .mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #0891b2, #155e75);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(8, 145, 178, .35);
}
.brand .name { color: #fff; font-weight: 650; font-size: 14.5px; letter-spacing: .01em; line-height: 1.3; }
.brand .sub { display: block; font-size: 10.5px; color: #6f8496; font-weight: 500; letter-spacing: .06em; }

.nav-group { margin-bottom: 18px; }
.nav-title { padding: 0 10px 8px; font-size: 10.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: #5c7183; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #b8c7d4;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(8, 145, 178, .18); color: #7dd3e8; box-shadow: inset 2px 0 0 #22d3ee; }
.nav a svg { width: 16px; height: 16px; flex: none; opacity: .9; }
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-500); }
.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11.5px; color: #5c7183; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ink-100);
}
.topbar .crumb { font-size: 12.5px; color: var(--ink-500); }
.topbar .crumb strong { color: var(--ink-800); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--ink-100);
  background: var(--paper);
  font-size: 12.5px;
  color: var(--ink-700);
}
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-100);
  color: var(--accent-700);
  font-size: 11.5px;
  font-weight: 700;
}
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-400); margin-bottom: 4px; }
.page-head p { color: var(--ink-500); font-size: 13px; margin-top: 6px; max-width: 640px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-title h2 { font-size: 15px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--ink-500); }
.kv dd { margin: 0; color: var(--ink-800); word-break: break-word; }

.flash-wrap { margin-bottom: 18px; }

/* ============ 今日观测 ============ */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.weather-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 26px;
  color: #e8f7fb;
  background: linear-gradient(135deg, #0e7490 0%, #155e75 55%, #164e63 100%);
  box-shadow: var(--shadow-md);
}
.weather-hero::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  right: -60px; top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .22), transparent 65%);
  pointer-events: none;
}
.weather-hero .wh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; position: relative; z-index: 1; }
.weather-hero .date { font-size: 12px; letter-spacing: .06em; color: rgba(232, 247, 251, .65); text-transform: uppercase; }
.weather-hero .condition { font-size: 28px; font-weight: 650; letter-spacing: -.02em; color: #fff; margin-top: 6px; }
.weather-hero .reading { font-size: 13px; color: rgba(232, 247, 251, .72); margin-top: 6px; max-width: 340px; }
.weather-hero .temp { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -.04em; color: #fff; }
.weather-hero .temp span { font-size: 15px; font-weight: 500; color: rgba(232, 247, 251, .65); margin-left: 4px; letter-spacing: 0; }
.weather-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; position: relative; z-index: 1; }
.weather-metric { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 10px 12px; }
.weather-metric .k { font-size: 11px; color: rgba(232, 247, 251, .65); }
.weather-metric .v { font-size: 16px; font-weight: 650; color: #fff; margin-top: 2px; font-variant-numeric: tabular-nums; }

.scale-block { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--ink-100); }
.scale-block:last-of-type { border-bottom: 0; }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; }
.scale-head .name { font-size: 13px; font-weight: 600; color: var(--ink-700); }
.scale-head .val { font-size: 12px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.scale-input { width: 100%; accent-color: var(--accent-600); }
.scale-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-400); }

/* ============ KPI 磁贴 ============ */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-xs); }
.tile .k { font-size: 11.5px; color: var(--ink-500); font-weight: 550; }
.tile .v { font-size: 24px; font-weight: 700; color: var(--ink-900); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile .v small { font-size: 12px; font-weight: 500; color: var(--ink-400); margin-left: 3px; }
.tile .foot { font-size: 11.5px; color: var(--ink-400); margin-top: 4px; }

/* ============ 迷你柱状图 ============ */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 132px; padding-top: 8px; }
.bars .bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 34px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #22d3ee, #0e7490); min-height: 4px; transition: height var(--dur-slow) var(--ease); }
.bars .bar.muted-bar { background: var(--ink-200); }
.bars .bar-label { font-size: 9.5px; color: var(--ink-400); white-space: nowrap; }

/* ============ 光谱 ============ */
.spectrum-list { display: flex; flex-direction: column; gap: 18px; }
.spectrum-row .sp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.spectrum-row .sp-name { font-size: 13.5px; font-weight: 600; color: var(--ink-800); }
.spectrum-row .sp-score { font-size: 12.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.track { position: relative; height: 8px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #67e8f9, #0891b2); transition: width var(--dur-slow) var(--ease); }
.track .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ink-300); }
.sp-foot { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; color: var(--ink-400); }

/* ============ 实验 ============ */
.exp-list { display: grid; gap: 14px; }
.exp-card { border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 16px 18px; background: var(--paper); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.exp-card:hover { border-color: var(--ink-200); box-shadow: var(--shadow-sm); }
.exp-card .exp-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.exp-card h3 { font-size: 14.5px; }
.exp-card .hypo { font-size: 12.5px; color: var(--ink-500); margin-top: 4px; }
.exp-card .desc { font-size: 12.5px; color: var(--ink-600); margin-top: 8px; }
.exp-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--ink-400); flex-wrap: wrap; }
.steps { margin: 10px 0 0; padding-left: 18px; color: var(--ink-600); font-size: 12.5px; }
.steps li { margin-bottom: 3px; }
.day-dots { display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.day-dot { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; background: var(--ink-100); color: var(--ink-400); font-variant-numeric: tabular-nums; }
.day-dot.done { background: var(--accent-100); color: var(--accent-700); font-weight: 650; }
.day-dot.today { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--accent-500); }

/* ============ 复盘 ============ */
.reflection-list { display: flex; flex-direction: column; gap: 12px; }
.reflection-item { border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 14px 16px; background: var(--paper); }
.reflection-item .q { font-size: 13px; font-weight: 600; color: var(--ink-800); }
.reflection-item .a { font-size: 13px; color: var(--ink-600); margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.reflection-item .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--ink-400); }

.ai-questions { display: flex; flex-direction: column; gap: 8px; }
.ai-question { text-align: left; padding: 10px 12px; border: 1px solid var(--ink-200); border-radius: var(--r-md); background: var(--ink-50); color: var(--ink-700); font-size: 13px; line-height: 1.65; cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.ai-question:hover { border-color: var(--accent-500); background: #fff; }

/* ============ 设置 ============ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ink-100); margin-bottom: 20px; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 550; color: var(--ink-500); border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab:hover { color: var(--ink-800); }
.tab.active { color: var(--accent-700); border-bottom-color: var(--accent-600); }

/* ============ 安全页 ============ */
.safety-hero { border-left: 4px solid var(--l3); background: linear-gradient(180deg, #fef2f2, #fff); border-radius: var(--r-md); padding: 22px 24px; }
.safety-hero h1 { font-size: 24px; margin-bottom: 8px; }
.safety-hero p { color: var(--ink-600); font-size: 14px; max-width: 680px; }
.hotlines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.hotline { background: var(--paper); border: 1px solid var(--ink-100); border-radius: var(--r-md); padding: 16px; }
.hotline .n { font-size: 12px; color: var(--ink-500); }
.hotline .p { font-size: 22px; font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -.01em; }
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ============ 弹层 ============ */
.modal-mask { position: fixed; inset: 0; z-index: 90; background: rgba(16, 21, 28, .45); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.show { display: flex; animation: fadeIn var(--dur) var(--ease); }
.modal { width: 100%; max-width: 480px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop var(--dur) var(--ease); max-height: 88vh; overflow: auto; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--ink-100); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--ink-100); display: flex; justify-content: flex-end; gap: 8px; background: var(--ink-50); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 360px; background: var(--ink-900); color: #fff; border-radius: var(--r-sm); padding: 11px 14px; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop var(--dur) var(--ease); }
.toast.err { background: #7f1d1d; }
.toast.ok { background: #14532d; }

/* ============ 响应式 ============ */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 1080px) {
  .today-grid, .safety-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hotlines { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .brand { padding: 0 10px 0 0; }
  .brand .sub { display: none; }
  .nav-group { margin: 0; display: flex; }
  .nav-title, .sidebar-foot { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .weather-metrics { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
}

/* ============ 缓动与入场动效 ============ */
html { scroll-behavior: smooth; }

@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes slideDown { from { opacity: 0; transform: translate3d(0, -10px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes fadeInSoft { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOutSoft { from { opacity: 1; } to { opacity: 0; } }
@keyframes floatY { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -10px, 0); } }
@keyframes sheen { 0%, 62% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dotIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes modalIn { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.96); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
@keyframes modalOut { from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } to { opacity: 0; transform: translate3d(0, 10px, 0) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translate3d(28px, 0, 0) scale(.96); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
@keyframes markGlow { 0%, 100% { box-shadow: 0 4px 14px rgba(8, 145, 178, .32); } 50% { box-shadow: 0 6px 24px rgba(8, 145, 178, .55); } }

/* 入场：由 motion.js 添加 .reveal，进入视口后淡入上浮；动画结束后移除类，不影响 hover */
.reveal { opacity: 0; transform: translate3d(0, 18px, 0); }
.reveal.is-visible { animation: riseIn var(--dur-reveal) var(--ease-out) both; animation-delay: var(--reveal-delay, 0ms); }
.sidebar .reveal { transform: none; }
.sidebar .reveal.is-visible { animation-name: fadeInSoft; }

/* 外壳 */
.topbar { animation: slideDown .52s var(--ease-out); }
.brand .mark { animation: markGlow 6s var(--ease-in-out) infinite; }
.user-chip { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.user-chip:hover { border-color: var(--ink-200); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.nav a {
  position: relative;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.nav a:hover { transform: translateX(2px); }
.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: #22d3ee;
  opacity: 0;
  transform: translateY(-50%);
  transition: height var(--dur) var(--ease-spring), opacity var(--dur) var(--ease);
}
.nav a.active { box-shadow: none; }
.nav a.active::before { height: 18px; opacity: 1; }

/* 按钮：轻微抬升 + 柔和投影 */
.btn {
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.985); box-shadow: var(--shadow-xs); }
.btn-link { box-shadow: none; }
.btn-link:hover:not(:disabled) { transform: none; box-shadow: none; }

/* 卡片与磁贴 */
.card { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card:hover { border-color: var(--ink-200); box-shadow: 0 4px 18px rgba(16, 21, 28, .07); }
.tile, .stat, .hotline, .exp-card, .reflection-item {
  transition:
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.tile:hover, .stat:hover, .hotline:hover, .exp-card:hover, .reflection-item:hover {
  transform: translateY(-2px);
  border-color: var(--ink-200);
  box-shadow: var(--shadow-md);
}

/* 表单与表格 */
.input, .select, .textarea {
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.table td { transition: background var(--dur-fast) var(--ease); }
.tab { transition: color var(--dur-fast) var(--ease), border-color var(--dur) var(--ease), background var(--dur-fast) var(--ease); }
.pagination a { transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.pagination a:hover { transform: translateY(-1px); }
.switch .slider::after { transition: transform var(--dur) var(--ease-spring); }
.switch input:checked + .slider::after { transform: translateX(18px) scale(1.04); }

/* 提示与空状态 */
.alert { animation: riseIn .4s var(--ease-out); }
.empty { animation: fadeInSoft .4s var(--ease-out); }

/* 今日观测 */
.weather-hero::after { animation: floatY 10s var(--ease-in-out) infinite; will-change: transform; }
.weather-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .12) 46%, transparent 60%);
  transform: translateX(-130%);
  animation: sheen 11s var(--ease-in-out) infinite;
  pointer-events: none;
}
.weather-metric { transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.weather-metric:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .24); transform: translateY(-1px); }

.bars .bar {
  transform-origin: bottom center;
  animation: growY .58s var(--ease-out) both;
  animation-delay: calc(var(--bar-i, 0) * 32ms);
  transition: height var(--dur-slow) var(--ease), filter var(--dur-fast) var(--ease);
}
.bars .bar:hover { filter: brightness(1.08); }

/* 光谱：进度条自左生长 + 缓慢流光 */
.track .fill {
  transform-origin: left center;
  animation: growX .7s var(--ease-out) both;
  overflow: hidden;
}
.track .fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: translateX(-100%);
  animation: sheen 4.2s var(--ease-in-out) infinite;
}

/* 实验日点、AI 追问 */
.day-dot { animation: dotIn .34s var(--ease-spring); }
.ai-question { transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.ai-question:hover { transform: translateX(2px); box-shadow: var(--shadow-xs); }

/* 弹层与提示条 */
.modal-mask.show { animation: fadeInSoft var(--dur) var(--ease-out); }
.modal-mask.show.closing { animation: fadeOutSoft .16s var(--ease) forwards; }
.modal { animation: modalIn .34s var(--ease-spring); }
.modal-mask.show.closing .modal { animation: modalOut .16s var(--ease) forwards; }
.toast { animation: toastIn .36s var(--ease-spring); }

/* 认证页 */
.auth-brand .mark { animation: none; transition: background var(--dur) var(--ease), transform var(--dur) var(--ease-spring); }
.auth-brand .mark:hover { background: rgba(255, 255, 255, .26); transform: rotate(-6deg) scale(1.06); }
.auth-point i { animation: dotIn .5s var(--ease-spring) both; }
.auth-points .auth-point:nth-child(2) i { animation-delay: .06s; }
.auth-points .auth-point:nth-child(3) i { animation-delay: .12s; }
.auth-points .auth-point:nth-child(4) i { animation-delay: .18s; }

/* 动效降级 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .topbar, .alert, .empty, .weather-hero::before, .weather-hero::after,
  .bars .bar, .track .fill, .track .fill::after, .day-dot, .brand .mark,
  .auth-point i, .modal, .toast { animation: none !important; }
  .tile:hover, .stat:hover, .hotline:hover, .exp-card:hover, .reflection-item:hover,
  .nav a:hover, .user-chip:hover, .btn:hover:not(:disabled) { transform: none; }
}
