/* ═══════════════════════════════════
   卡片
═══════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }

/* ═══════════════════════════════════
   按钮 & 输入框基础
═══════════════════════════════════ */
.btn, input, textarea, select {
  font: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

.btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  font-weight: 600;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  letter-spacing: .1px;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #0e9f8c 60%, #10b981 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(15,118,110,.25);
}
.btn-primary:hover { opacity: 0.88; box-shadow: 0 6px 18px rgba(15,118,110,.32); }

.btn-ghost {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1.5px solid transparent;
  font-weight: 600;
}
.btn-ghost:hover { opacity: 0.82; }

.btn-text {
  border: none;
  background: transparent;
  color: var(--brand);
  padding: 0;
  width: auto;
  font-weight: 600;
}

/* ═══════════════════════════════════
   Tab bar 标签
═══════════════════════════════════ */
.tab {
  border: none;
  background: transparent;
  color: var(--subtext);
  border-radius: 12px;
  padding: 6px 4px;
  font-size: 13px;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: color .2s;
}
.tab.plus {
  font-size: 24px; line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  border-radius: 14px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(15,118,110,.30);
  margin: 4px 0;
  transition: transform .1s, opacity .15s;
}
.tab.plus:active { transform: scale(0.93); }

/* ═══════════════════════════════════
   搜索框
═══════════════════════════════════ */
.search-wrap { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.search-wrap input {
  min-width: 0;
  background: var(--surface-2);
  border-color: transparent;
  border-radius: 10px;
}
.search-wrap input:focus { background: var(--surface); border-color: var(--brand); }
.icon-btn { padding: 8px 10px; width: auto; flex-shrink: 0; }
.icon-btn svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════
   Banner
═══════════════════════════════════ */
.banner {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, #0c6e68, #0f9e8e 55%, #18c9b4);
  color: #fff;
  border: none;
  box-shadow: 0 12px 32px rgba(15,118,110,.28);
}
.banner.mini { min-height: auto; padding: 11px 14px; border-radius: 12px; }

/* ═══════════════════════════════════
   Feature grid
═══════════════════════════════════ */
.feature-item {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: background .18s, transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.feature-item:hover {
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,118,110,.13);
  border-color: transparent;
}
.feature-item:active { transform: scale(0.95); }

/* ═══════════════════════════════════
   SOS 紧急按钮
═══════════════════════════════════ */
.sos-btn {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tab-height) + var(--safe-area-bottom) + 14px);
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  z-index: 25;
  box-shadow: 0 8px 22px rgba(220,38,38,.40);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform .1s, box-shadow .15s;
}
.sos-btn:hover { box-shadow: 0 10px 26px rgba(220,38,38,.50); }
.sos-btn:active { transform: scale(0.95); }
.sos-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════
   进度条
═══════════════════════════════════ */
.progress-line {
  height: 7px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-line.warning span {
  background: linear-gradient(90deg, var(--warning), #fbbf24);
}

/* ═══════════════════════════════════
   Chip / 标签筛选
═══════════════════════════════════ */
.chip {
  border: 1.5px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--subtext);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip svg { width: 13px; height: 13px; }
.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 3px 10px rgba(15,118,110,.25);
}
.chip:not(.active):hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft); }

/* ═══════════════════════════════════
   徽章
═══════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
}
.badge.success { background: var(--success-soft); color: #065f46; }
.badge.warn    { background: var(--warning-soft); color: #92400e; }
.badge.hot     { background: var(--danger-soft);  color: #b91c1c; }

/* ═══════════════════════════════════
   步骤条
═══════════════════════════════════ */
.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}
.stepper li {
  padding: 9px 4px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid var(--border);
  transition: background .2s;
}
.stepper li.done {
  background: var(--success-soft);
  color: #065f46;
  border-color: transparent;
}
.stepper li.active {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(245,158,11,.2);
}

/* ═══════════════════════════════════
   悬浮操作按钮
═══════════════════════════════════ */
.float-action {
  position: sticky;
  bottom: calc(var(--tab-height) + var(--safe-area-bottom) + 10px);
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity .15s;
}
.float-action:hover { opacity: .88; }
.float-action svg { width: 15px; height: 15px; }
[data-theme="dark"] .float-action { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }

/* ═══════════════════════════════════
   仪表盘（半圆）
═══════════════════════════════════ */
.gauge {
  width: 220px;
  height: 110px;
  margin: 10px auto;
  position: relative;
  overflow: hidden;
}
.gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 220px 220px 0 0;
  background: var(--border);
  transform: rotate(180deg);
  transform-origin: center bottom;
}
@supports (background: conic-gradient(red 0, blue 0)) {
  .gauge::before {
    background: conic-gradient(
      var(--brand) calc(var(--value, 0) * 1%),
      var(--border) 0
    );
  }
}
.gauge::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 22px; bottom: 0;
  background: var(--surface);
  border-radius: 180px 180px 0 0;
}
.gauge span {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  z-index: 2;
  color: var(--brand);
}

/* ═══════════════════════════════════
   毛玻璃
═══════════════════════════════════ */
.glass {
  background: linear-gradient(120deg, rgba(255,255,255,.58), rgba(255,255,255,.28));
}
@supports (backdrop-filter: blur(1px)) {
  .glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
[data-theme="dark"] .glass {
  background: linear-gradient(120deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
}

/* ═══════════════════════════════════
   对话框
═══════════════════════════════════ */
dialog {
  border: none;
  border-radius: 18px;
  padding: 20px;
  max-width: 420px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(15,23,42,.18);
}
#toast {
  border-radius: 999px;
  background: #111827;
  color: #fff;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
}
[data-theme="dark"] #toast { background: var(--surface-2); }

/* ═══════════════════════════════════
   评分显示
═══════════════════════════════════ */
.score-display {
  font-size: 52px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
  margin: 8px 0 4px;
}

/* ═══════════════════════════════════
   未读消息红点
═══════════════════════════════════ */
.badge-dot {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(12px);
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

/* ═══════════════════════════════════
   表单验证
═══════════════════════════════════ */
.is-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important; }
.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-error::before { content: "!"; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ═══════════════════════════════════
   顶部导航布局
═══════════════════════════════════ */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(15,23,42,.07);
}
