/* ============================================================================
   抖音续火花 · Ember 火花设计系统
   概念：活的火焰 + 飘动火星 + 会跳动的火花计数器。暖奶油 / 火焰渐变 / 暖炭黑。
   字体：系统中文栈（大陆可靠即时）；展示与数字用 Fredoka（jsdelivr, swap 非阻塞）。
   ============================================================================ */

/* —— 展示字体：仅用于 Logo / 大数字 / 英文点缀，swap 非阻塞，降级系统栈 —— */
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/fredoka@latest/latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/fredoka@latest/latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/fredoka@latest/latin-700-normal.woff2") format("woff2");
}

:root {
  /* —— 火焰主色（余烬 → 火焰 → 高光） —— */
  --flame-yellow: #ffc53d;
  --flame-amber:  #ff9500;
  --flame-orange: #ff6a1a;
  --flame-red:    #ff3b2f;
  --flame-ember:  #ff1e56;   /* 高能余烬粉，消费级点睛 */

  /* 主渐变：从下往上像一簇火 */
  --grad-flame: linear-gradient(135deg, #ffb020 0%, #ff6a1a 42%, #ff2d55 100%);
  --grad-flame-soft: linear-gradient(135deg, #ffd76a 0%, #ff8a3d 55%, #ff5a7a 100%);
  --grad-ember-dark: radial-gradient(120% 120% at 20% 0%, #3a1a10 0%, #241210 45%, #160c0a 100%);

  /* —— 暖中性 —— */
  --cream:        #fff8f1;   /* 页面底 */
  --cream-soft:   #fdefe3;   /* 次级面 */
  --surface:      #fffdfb;   /* 卡片面 */
  --surface-2:    #fbf3ea;
  --ink:          #241610;   /* 主文字（暖炭） */
  --ink-2:        #5c463b;   /* 次文字 */
  --ink-3:        #9a8478;   /* 辅助文字 */
  --ink-4:        #c4b3a7;   /* 极浅 */
  --line:         #f0e2d6;   /* 描边 */
  --line-2:       #e6d3c4;

  /* —— 功能色（冷暖对比：薄荷做在线/成功，与暖主色拉开） —— */
  --mint:    #10b981;
  --mint-bg: #e7fbf3;
  --danger:  #ef4444;
  --danger-bg: #fef0ef;
  --warn:    #f59e0b;

  /* —— 暗色 hero 上的文字 —— */
  --on-dark:    #fff3ea;
  --on-dark-2:  #e9c9b6;
  --on-dark-3:  #b8917c;

  /* —— 字体 —— */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --font-display: "Fredoka", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* —— 圆角 / 阴影 / 辉光 —— */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(80, 40, 20, 0.06);
  --shadow-md: 0 6px 20px rgba(120, 60, 25, 0.10);
  --shadow-lg: 0 18px 48px rgba(120, 55, 20, 0.16);
  --glow-flame: 0 8px 28px rgba(255, 90, 30, 0.38);
  --glow-flame-sm: 0 4px 14px rgba(255, 90, 30, 0.30);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tr: 220ms var(--ease);
}

/* ============================================================================
   Reset & base
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 暖色背景氛围：柔和的火光辉晕 + 极细颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 85% -5%, rgba(255, 149, 0, 0.12), transparent 60%),
    radial-gradient(55% 40% at 0% 0%, rgba(255, 30, 86, 0.08), transparent 55%),
    radial-gradient(70% 60% at 50% 120%, rgba(255, 176, 32, 0.10), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(255, 106, 26, 0.22); color: var(--ink); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #eccdb8; border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: #e0b699; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.display { font-family: var(--font-display); letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.gradient-text {
  background: var(--grad-flame);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================================
   通用按钮
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr), border-color var(--tr), color var(--tr);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 17px; height: 17px; }

.btn-flame {
  background: var(--grad-flame);
  color: #fff;
  box-shadow: var(--glow-flame-sm);
  border: none;
  background-size: 140% 140%;
}
.btn-flame:hover { box-shadow: var(--glow-flame); transform: translateY(-1px); background-position: 100% 0; }
.btn-flame:disabled, .btn-flame.is-disabled { background: #e9d2c2; color: #fff; box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--flame-orange); color: var(--flame-orange); transform: translateY(-1px); }

.btn-soft {
  background: var(--cream-soft);
  color: var(--flame-red);
  border-color: transparent;
}
.btn-soft:hover { background: #fbe2d1; }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #fbdad7; }

.btn-lg { padding: 15px 30px; font-size: 15.5px; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-on-dark {
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-dark);
  border-color: rgba(255, 200, 170, 0.25);
  backdrop-filter: blur(8px);
}
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 200, 170, 0.5); }

/* ============================================================================
   卡片
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--tr), border-color var(--tr), transform var(--tr);
}
.card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); transform: translateY(-2px); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}
.card-title .ti { width: 20px; height: 20px; color: var(--flame-orange); flex-shrink: 0; }
.card-desc { font-size: 13px; color: var(--ink-3); margin-top: 5px; line-height: 1.55; }

/* 小圆标（图标容器） */
.chip-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-flame-soft);
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--glow-flame-sm);
}
.chip-icon svg { width: 20px; height: 20px; }

/* 状态药丸 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok   { background: var(--mint-bg); color: #0c9b6c; border-color: #b6f0d8; }
.pill-bad  { background: var(--danger-bg); color: #d64036; border-color: #fbcdc8; }
.pill-warn { background: #fff4e0; color: #c77b12; border-color: #fbe1b8; }
.pill-flame{ background: #fff0e8; color: var(--flame-red); border-color: #ffd6c2; }

/* ============================================================================
   顶栏（App 内）
   ============================================================================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 248, 241, 0.82);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 22px; height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; cursor: pointer; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad-flame);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--glow-flame-sm);
  flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.brand-name b { color: var(--flame-red); }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 抖音账号切换器 */
.acct-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-full); cursor: pointer;
  transition: var(--tr); font-size: 13px; font-weight: 600; color: var(--ink);
}
.acct-switch:hover { border-color: var(--flame-orange); box-shadow: var(--shadow-sm); }
.acct-switch .star { color: var(--flame-amber); }
.acct-switch .chev { width: 15px; height: 15px; color: var(--ink-3); }

/* 用户菜单头像 */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: var(--grad-flame-soft);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  border: 2px solid #fff; box-shadow: var(--shadow-sm); flex-shrink: 0;
  transition: var(--tr);
}
.avatar:hover { box-shadow: var(--glow-flame-sm); }
.avatar-lg { width: 84px; height: 84px; font-size: 34px; border-width: 3px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--tr); padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--flame-orange); border-color: var(--flame-orange); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.94); }

/* ============================================================================
   主布局
   ============================================================================ */
.container { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; width: 100%; }
.shell { display: grid; grid-template-columns: 216px 1fr; gap: 26px; align-items: start; }

.sidenav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 84px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 15px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left; transition: var(--tr);
  white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
}
.nav-btn .ni { width: 19px; height: 19px; flex-shrink: 0; color: var(--ink-4); transition: var(--tr); }
.nav-btn:hover { background: var(--surface); color: var(--ink); }
.nav-btn:hover .ni { color: var(--ink-2); }
.nav-btn.active {
  background: var(--surface); color: var(--flame-red);
  border-color: var(--line-2); box-shadow: var(--shadow-sm); font-weight: 700;
}
.nav-btn.active .ni { color: var(--flame-orange); }
.nav-btn .badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--grad-flame); color: #fff;
  padding: 1px 8px; border-radius: var(--r-full); font-variant-numeric: tabular-nums;
}

.view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.view-head { margin-bottom: 2px; }
.view-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.view-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }

/* ============================================================================
   指标看板
   ============================================================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: var(--tr);
}
.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.stat-value { font-size: 27px; font-weight: 700; margin-top: 6px; display: flex; align-items: baseline; gap: 6px; letter-spacing: -0.02em; }
.stat-value .u { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.stat-spark { position: absolute; right: -8px; bottom: -8px; font-size: 56px; opacity: 0.08; }

/* ============================================================================
   好友台账
   ============================================================================ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.desktop-table { display: block; }
.mobile-cards { display: none; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }

/* 手机联系人卡片 */
.contact-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px;
  cursor: pointer; transition: var(--tr); -webkit-tap-highlight-color: transparent;
}
.contact-row:active { background: var(--surface-2); }
.contact-row.sel { border-color: var(--flame-orange); background: #fff6f0; box-shadow: 0 0 0 1px var(--flame-orange) inset; }
.contact-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.contact-av.ph { background: var(--grad-flame-soft); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.contact-meta { flex: 1; min-width: 0; }
.contact-name { font-size: 14.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-sub { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark-tag {
  color: var(--flame-red); background: #fff0e8; border: 1px solid #ffd6c2;
  padding: 3px 9px; border-radius: var(--r-full); font-size: 12px; font-weight: 700;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;
}
.nospark-tag { color: var(--ink-4); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: var(--r-full); font-size: 11.5px; white-space: nowrap; }

/* ============================================================================
   日志终端
   ============================================================================ */
.terminal { background: #1c110b; border: 1px solid #3a231a; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-md); }
.terminal-bar { background: #2a1810; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; color: #d9a988; font-size: 12px; font-family: var(--font-mono); }
.terminal-bar .lights::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff5f56; margin-right: 8px; box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #27c93f; }
.terminal-body { margin: 0; padding: 18px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: #ffdcc2; height: 440px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.user-log-panel { overflow: hidden; }
.user-log-body { min-height: 260px; padding: 24px; background: #fffaf6; border: 1px solid #f0dfd2; border-radius: var(--r-md); color: var(--ink); font-size: 14px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
.tour-prompt { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 15px 17px; border: 1px solid #f3d7c4; border-radius: var(--r-md); background: #fffaf6; }
.tour-prompt > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tour-prompt span { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.tour-mask { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; background: rgba(30, 17, 10, .48); }
.tour-card { width: min(440px, 100%); padding: 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 18px 60px rgba(30, 17, 10, .28); }
.tour-progress { display: flex; gap: 6px; margin-bottom: 20px; }
.tour-progress span { height: 4px; flex: 1; border-radius: var(--r-full); background: var(--line); }
.tour-progress span.active, .tour-progress span.done { background: var(--flame-orange); }
.tour-kicker { color: var(--flame-red); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.tour-card h2 { margin-bottom: 9px; font-size: 21px; }
.tour-card p { color: var(--ink-3); line-height: 1.7; }
.tour-target { margin-top: 16px; padding: 10px 12px; border-radius: var(--r-sm); background: #fff6ef; color: var(--ink-2); font-size: 13px; }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

/* ============================================================================
   空状态 / 引导
   ============================================================================ */
.empty {
  text-align: center; padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty-fire { font-size: 60px; filter: drop-shadow(0 6px 16px rgba(255, 90, 30, 0.35)); animation: flicker 2.6s ease-in-out infinite; }
.empty-title { font-size: 19px; font-weight: 700; color: var(--ink); }
.empty-desc { font-size: 14px; color: var(--ink-3); max-width: 420px; line-height: 1.7; }

/* 大号引导卡（新用户 / 未登录凭证） */
.onboard {
  background: var(--grad-ember-dark); color: var(--on-dark);
  border-radius: var(--r-xl); padding: 40px 36px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.onboard h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.onboard p { color: var(--on-dark-2); font-size: 14.5px; line-height: 1.7; max-width: 520px; }
.onboard .steps { display: flex; gap: 10px; margin: 22px 0; flex-wrap: wrap; }
.onboard .step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-dark-2); background: rgba(255,255,255,0.06); padding: 8px 14px; border-radius: var(--r-full); border: 1px solid rgba(255,200,170,0.14); }
.onboard .step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--grad-flame); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

/* ============================================================================
   扫码进度
   ============================================================================ */
.qr-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qr-frame { width: 244px; height: 244px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; padding: 12px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.qr-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; width: 100%; }
.qr-help { max-width: 360px; margin-left: auto; margin-right: auto; line-height: 1.7; }
.qr-scanline { position: absolute; left: 8%; right: 8%; height: 2px; background: linear-gradient(90deg, transparent, var(--flame-orange), transparent); box-shadow: 0 0 10px var(--flame-orange); animation: scan 2.2s ease-in-out infinite; }
.qr-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ink-3); }
.qr-spinner { width: 46px; height: 46px; border: 4px solid var(--line); border-top-color: var(--flame-orange); border-radius: 50%; animation: spin 0.9s linear infinite; }

/* 阶段步骤条 */
.stage-bar { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 320px; }
.stage-dot { flex: 1; height: 5px; border-radius: var(--r-full); background: var(--line); overflow: hidden; }
.stage-dot.done { background: var(--grad-flame); }
.stage-dot.active { background: var(--line); position: relative; }
.stage-dot.active::after { content: ""; position: absolute; inset: 0; background: var(--grad-flame); animation: fill 1.4s ease-in-out infinite; transform-origin: left; }
.stage-text { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.stage-elapsed { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ============================================================================
   账号管理卡片
   ============================================================================ */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acct-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  transition: var(--tr); position: relative;
}
.acct-card.current { border-color: var(--flame-orange); box-shadow: 0 0 0 1px var(--flame-orange), var(--shadow-md); }
.acct-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.acct-nm { font-size: 16px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.acct-info { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.acct-info code { font-size: 11px; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--ink-2); }
.acct-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ============================================================================
   Profile 个人中心
   ============================================================================ */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-name { font-size: 22px; font-weight: 700; }
.profile-role { font-size: 12.5px; }
.avatar-upload { position: relative; cursor: pointer; }
.avatar-upload .cam { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--grad-flame); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.avatar-upload .cam svg { width: 14px; height: 14px; }

/* ============================================================================
   下拉菜单 / 弹层
   ============================================================================ */
.menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 200px; z-index: 200;
}
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink); cursor: pointer; transition: var(--tr); }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 16px; height: 16px; color: var(--ink-3); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 8px; }
.menu-head { padding: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* 遮罩 */
.scrim { position: fixed; inset: 0; z-index: 150; }

/* ============================================================================
   动画
   ============================================================================ */
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); filter: drop-shadow(0 6px 16px rgba(255,90,30,0.35)); }
  25% { transform: scale(1.05) rotate(1deg); }
  50% { transform: scale(0.97) rotate(-2deg); filter: drop-shadow(0 8px 22px rgba(255,60,80,0.45)); }
  75% { transform: scale(1.03) rotate(1deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { 0%, 100% { top: 12%; } 50% { top: 84%; } }
@keyframes fill { 0% { transform: scaleX(0); } 60% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0.4; } }
@keyframes rise {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes floatSpark {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translateY(-140px) scale(0.3); opacity: 0; }
}
@keyframes gradientShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.rise { animation: rise 0.5s var(--ease) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.19s; }
.rise-4 { animation-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================================
   工具类
   ============================================================================ */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.hide { display: none !important; }
code.inline { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: var(--flame-red); }

/* ============================================================================
   公开区：首页 Landing（暗色戏剧 hero + 暖色卖点）
   ============================================================================ */
.landing { min-height: 100vh; display: flex; flex-direction: column; }

.land-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px; max-width: 1200px; margin: 0 auto; width: 100%;
}
.land-nav .brand-name { color: var(--ink); }

/* Hero：暖炭黑背景 + 火光辉晕 + 上浮火星 */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-ember-dark);
  color: var(--on-dark);
  border-radius: 0 0 40px 40px;
  padding: 30px 24px 90px;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 40% at 70% 20%, rgba(255,106,26,0.35), transparent 60%),
    radial-gradient(45% 35% at 20% 80%, rgba(255,30,86,0.28), transparent 60%),
    radial-gradient(40% 30% at 90% 90%, rgba(255,197,61,0.22), transparent 60%);
}
.hero-nav { max-width: 1160px; margin: 0 auto 40px; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.hero-nav .brand-name { color: #fff; }
.hero-nav .brand-mark { box-shadow: var(--glow-flame); }

.spark-field { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.spark {
  position: absolute; bottom: 20%; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #ffd76a, #ff6a1a);
  box-shadow: 0 0 8px 2px rgba(255,150,40,0.7);
  animation: floatSpark linear infinite;
}

.hero-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,200,170,0.2);
  color: var(--on-dark-2); padding: 7px 15px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); margin-bottom: 22px;
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 62px); font-weight: 700; line-height: 1.04;
  letter-spacing: -0.03em; color: #fff; margin-bottom: 20px;
}
.hero h1 .fire-word {
  background: var(--grad-flame); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; position: relative;
}
.hero-lead { font-size: clamp(15px, 2vw, 18px); color: var(--on-dark-2); line-height: 1.7; max-width: 520px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-trust { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust .t { }
.hero-trust .t b { font-family: var(--font-display); font-size: 26px; color: #fff; display: block; }
.hero-trust .t span { font-size: 12.5px; color: var(--on-dark-3); }

/* Hero 右侧：巨大的活火花计数器 */
.hero-fire {
  display: flex; align-items: center; justify-content: center; position: relative;
}
.fire-orb {
  width: 300px; max-width: 78vw; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, rgba(255,197,61,0.4), rgba(255,60,80,0.12) 55%, transparent 72%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.fire-orb .big-fire { font-size: 120px; animation: flicker 2.6s ease-in-out infinite; filter: drop-shadow(0 10px 30px rgba(255,80,20,0.5)); }
.fire-orb .streak-num { font-family: var(--font-display); font-size: 60px; font-weight: 700; color: #fff; line-height: 1; margin-top: -6px; }
.fire-orb .streak-lbl { font-size: 13px; color: var(--on-dark-2); margin-top: 6px; letter-spacing: 0.04em; }
.fire-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255,180,120,0.25); animation: spin 40s linear infinite; }

/* 卖点区 */
.features { max-width: 1160px; margin: -50px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--shadow-md); transition: var(--tr);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature .fi { width: 52px; height: 52px; border-radius: 15px; background: var(--grad-flame-soft); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; box-shadow: var(--glow-flame-sm); }
.feature .fi svg { width: 26px; height: 26px; }
.feature h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature p { font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }

/* 步骤区 */
.how { max-width: 1160px; margin: 66px auto 0; padding: 0 24px; }
.how-title { text-align: center; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.how-sub { text-align: center; color: var(--ink-3); font-size: 14px; margin-bottom: 36px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.how-step { text-align: center; position: relative; }
.how-step .num { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--grad-flame); color: #fff; font-family: var(--font-display); font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: var(--glow-flame); }
.how-step h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.how-step p { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* CTA 尾部 */
.cta-band { max-width: 1160px; margin: 70px auto 0; padding: 0 24px; }
.cta-inner { background: var(--grad-flame); border-radius: var(--r-xl); padding: 48px 40px; text-align: center; color: #fff; box-shadow: var(--glow-flame); position: relative; overflow: hidden; }
.cta-inner h2 { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.cta-inner p { color: rgba(255,255,255,0.9); font-size: 15px; margin-bottom: 24px; }

/* 页脚 */
.land-footer { max-width: 1160px; margin: 60px auto 0; padding: 30px 24px 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; line-height: 1.9; }
.land-footer .disc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 18px; }

/* ============================================================================
   认证页（登录 / 注册）
   ============================================================================ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--grad-ember-dark); color: var(--on-dark); padding: 50px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 30% 30%, rgba(255,106,26,0.3), transparent 60%); }
.auth-side-content { position: relative; z-index: 1; }
.auth-side .big-fire { font-size: 84px; animation: flicker 2.6s ease-in-out infinite; margin-bottom: 20px; }
.auth-side h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.auth-side p { color: var(--on-dark-2); font-size: 14.5px; line-height: 1.7; max-width: 380px; }
.auth-side .quote { position: relative; z-index: 1; color: var(--on-dark-3); font-size: 13px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--cream); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field .in {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2); background: var(--surface);
  font-size: 14.5px; color: var(--ink); font-family: inherit; transition: var(--tr);
}
.field .in:focus { outline: none; border-color: var(--flame-orange); box-shadow: 0 0 0 3px rgba(255,106,26,0.14); }
.field .in.err { border-color: var(--danger); }
.field .hint { font-size: 12px; margin-top: 6px; color: var(--ink-3); }
.field .hint.err { color: var(--danger); }
.auth-alt { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--ink-3); }
.auth-alt a { color: var(--flame-red); font-weight: 600; cursor: pointer; }
.auth-alt a:hover { text-decoration: underline; }
.pw-meter { display: flex; gap: 4px; margin-top: 8px; }
.pw-meter .seg { flex: 1; height: 4px; border-radius: var(--r-full); background: var(--line); transition: var(--tr); }
.pw-meter .seg.on1 { background: var(--danger); }
.pw-meter .seg.on2 { background: var(--warn); }
.pw-meter .seg.on3 { background: var(--mint); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .hero-cta, .hero-eyebrow { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-fire { order: -1; }
  .fire-orb .big-fire { font-size: 84px; }
  .fire-orb .streak-num { font-size: 44px; }
  .feature-grid, .how-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .land-nav { padding: 14px 18px; }
}

/* ============================================================================
   Element Plus 火花主题覆盖
   ============================================================================ */
.el-button--primary {
  --el-button-bg-color: var(--flame-orange) !important;
  --el-button-border-color: var(--flame-orange) !important;
  --el-button-hover-bg-color: var(--flame-red) !important;
  --el-button-hover-border-color: var(--flame-red) !important;
  --el-button-active-bg-color: var(--flame-red) !important;
}
.el-button { border-radius: var(--r-full) !important; font-weight: 600 !important; }
.el-input__wrapper, .el-textarea__inner {
  border-radius: var(--r-sm) !important;
  box-shadow: 0 0 0 1px var(--line-2) inset !important;
  background: var(--surface) !important;
}
.el-input__wrapper.is-focus, .el-textarea__inner:focus { box-shadow: 0 0 0 2px var(--flame-orange) inset !important; }
.el-switch.is-checked .el-switch__core { background: var(--flame-orange) !important; border-color: var(--flame-orange) !important; }
.el-checkbox__input.is-checked .el-checkbox__inner { background: var(--flame-orange) !important; border-color: var(--flame-orange) !important; }
.el-checkbox__inner { border-radius: 5px !important; }
.el-table {
  --el-table-header-bg-color: #fdf3ea !important;
  --el-table-row-hover-bg-color: #fff6f0 !important;
  --el-table-border-color: var(--line) !important;
  --el-table-header-text-color: var(--ink-3) !important;
  --el-table-text-color: var(--ink-2) !important;
  font-size: 13.5px;
}
.el-table th.el-table__cell { font-weight: 700; }
.el-dialog { border-radius: var(--r-lg) !important; overflow: hidden; }
.el-dialog__title { font-weight: 700 !important; }
.el-tag { border-radius: var(--r-full) !important; }
.el-message { border-radius: var(--r-full) !important; }
.el-time-panel, .el-picker-panel { border-radius: var(--r-md) !important; }

/* ============================================================================
   响应式（≤ 860px）
   ============================================================================ */
@media (max-width: 860px) {
  .container { padding: 16px 13px calc(88px + env(safe-area-inset-bottom)); }
  .shell { grid-template-columns: 1fr; gap: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .view-title { font-size: 20px; }
  .card { padding: 17px 15px; border-radius: var(--r-md); }
  .desktop-table { display: none !important; }
  .mobile-cards { display: flex !important; flex-direction: column; gap: 9px; }
  .acct-grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 13px; height: 56px; }
  .brand-name { font-size: 16px; }

  /* 底部固定导航 */
  .sidenav {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100vw; z-index: 900;
    flex-direction: row; justify-content: space-around; gap: 2px;
    background: rgba(255, 248, 241, 0.94);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(120, 55, 20, 0.10);
  }
  .nav-btn { flex-direction: column; gap: 3px; padding: 5px 3px; font-size: 10.5px; flex: 1; text-align: center; }
  .nav-btn .ni { width: 20px; height: 20px; }
  .nav-btn.active { background: #fff2ea !important; border-color: transparent !important; }
  .nav-btn .badge { display: none; }
  .terminal-body { height: 320px; font-size: 11.5px; }
  .user-log-body { min-height: 220px; padding: 18px; }
  .el-table { min-width: 680px; }
  .el-table__body-wrapper, .el-table__header-wrapper { overflow-x: auto; }
  .card-head { flex-wrap: wrap; }
  .view-sub { overflow-wrap: anywhere; }
  .mobile-stack { grid-template-columns: 1fr !important; gap: 0 !important; }
  .qr-frame { width: min(244px, calc(100vw - 76px)); height: min(244px, calc(100vw - 76px)); }
}

@media (max-width: 600px) {
  .container { padding: 12px 10px calc(92px + env(safe-area-inset-bottom)); }
  .topbar-inner { gap: 7px; }
  .topbar-right { min-width: 0; flex: 1; gap: 5px; justify-content: flex-end; }
  .acct-switch { flex: 1; max-width: none; min-width: 0; padding: 6px 7px 6px 8px; gap: 4px; }
  .acct-switch .account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right > .pill { width: 22px; min-width: 22px; padding: 0; justify-content: center; font-size: 0; }
  .topbar-right > .pill .dot { margin: 0; }
  .brand-name { font-size: 15px; }
  .view-title { font-size: 19px; }
  .view-sub { font-size: 12px; }
  .card { padding: 14px 12px; }
  .card-head { gap: 9px; margin-bottom: 14px; padding-bottom: 12px; }
  .card-title { font-size: 15px; }
  .row, .row-between { gap: 8px; }
  .row > .btn, .row-between > .btn { flex: 1 1 auto; min-width: 0; }
  .btn { max-width: 100%; padding: 10px 13px; font-size: 13px; }
  .btn-lg { padding: 12px 16px; font-size: 14px; }
  .view-head { min-width: 0; }
  .stats { gap: 8px; }
  .stat { padding: 13px 12px; }
  .stat-label { font-size: 11px; }
  .stat-value { font-size: 20px; }
  .toolbar { align-items: stretch; }
  .toolbar > * { min-width: 0; }
  .toolbar .field { flex: 1 1 100% !important; width: 100% !important; }
  .contact-row { gap: 8px; padding: 10px; }
  .contact-name { max-width: 42vw; }
  .spark-tag, .nospark-tag { padding-left: 7px; padding-right: 7px; }
  .terminal-body { height: 280px; padding: 12px; font-size: 11px; }
  .user-log-body { min-height: 200px; padding: 14px; font-size: 13px; line-height: 1.85; }
  .guide-step { align-items: flex-start; padding: 12px 10px; }
  .guide-step .btn { align-self: center; flex-shrink: 0; }
  .el-dialog { width: calc(100vw - 20px) !important; margin: 10px auto !important; }
  .el-dialog__body { padding: 14px !important; }
  .el-dialog__footer { padding: 10px 14px 14px !important; }
  .qr-help { font-size: 12px; }
  .tour-mask { align-items: end; padding: 10px; }
  .tour-card { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .tour-prompt { align-items: stretch; flex-direction: column; gap: 12px; }
  .tour-prompt .btn { width: 100%; }
  .stage-bar { max-width: 100%; }
  .nav-btn { min-width: 0; }
  .nav-btn span:not(.ni):not(.badge) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
