/* ============ 设计变量 ============ */
:root {
  --bg: #E9F2FF;
  --surface: #FFFFFF;
  --primary: #2F6BFF;
  --primary-deep: #143A6B;
  --primary-soft: #D6E6FF;
  --accent: #FF7A1A;
  --text: #1B2A41;
  --muted: #6B7C93;
  --line: #C9DDFF;

  --r-card: 16px;
  --r-btn: 12px;
  --r-pill: 999px;

  --shadow-1: 0 2px 8px rgba(20, 58, 107, .08);
  --shadow-2: 0 10px 24px rgba(20, 58, 107, .12);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms;
  --t-mid: 200ms;
  --t-slow: 320ms;

  --font: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-num: "DIN Alternate", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============ 图标 ============ */
svg.ic {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease),
              background-color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
  user-select: none;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 122, 26, .28);
}
.btn-primary:hover { background: #ff8a33; box-shadow: 0 8px 22px rgba(255, 122, 26, .34); }

.btn-ghost {
  background: rgba(255, 255, 255, .7);
  color: var(--primary-deep);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff; border-color: var(--primary); color: var(--primary); }

.btn-quiet {
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.btn-quiet:hover { background: #c8ddff; }

.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
}

/* ============ 分区标题 ============ */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sec-head h2 { font-size: 20px; color: var(--primary-deep); }
.sec-note { font-size: 12px; color: var(--muted); }

/* ============ 空状态 ============ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 24px;
  text-align: center;
}
.empty-art {
  width: 96px;
  height: 96px;
  color: var(--primary);
  opacity: .55;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.empty-title { font-size: 15px; font-weight: 600; color: var(--primary-deep); }
.empty-text { font-size: 13px; color: var(--muted); max-width: 320px; line-height: 1.7; }

/* ============ 轻提示 ============ */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
@media (max-width: 767px) {
  .toast-host { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(20, 58, 107, .94);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  animation: toast-in var(--t-mid) var(--ease);
}
.toast.is-out { animation: toast-out var(--t-mid) var(--ease) forwards; }
.toast .ic { width: 16px; height: 16px; opacity: .9; }
.toast.is-success { background: rgba(23, 92, 158, .96); }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============ 弹窗 ============ */
.modal-host { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.modal-host.is-open { pointer-events: auto; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 58, 107, .28);
  backdrop-filter: blur(3px);
  animation: fade-in var(--t-mid) var(--ease);
}
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(400px, calc(100vw - 48px));
  transform: translate(-50%, -50%);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  padding: 24px;
  animation: modal-in var(--t-slow) var(--ease);
}
.modal-title { font-size: 17px; color: var(--primary-deep); margin-bottom: 10px; }
.modal-text { font-size: 13px; color: var(--muted); line-height: 1.75; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ============ 动效开关 ============ */
.no-motion *, .no-motion *::before, .no-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
