/* =====================================================================
 * style.css — 液态玻璃（Glassmorphism）主题
 * ---------------------------------------------------------------------
 * 目录：
 *  01 设计变量与重置
 *  02 背景层（渐变 + 流动光斑 + 网格）
 *  03 玻璃、卡片、按钮、表单
 *  04 登录页
 *  05 应用外壳 / 顶部导航 / 底部导航 / 免责声明
 *  06 账户数字卡片
 *  07 行情列表
 *  08 个股详情（图表 / 盘口 / 交易面板）
 *  09 持仓页（含饼图图例）
 *  10 交易记录页
 *  11 设置页
 *  12 教程抽屉
 *  13 弹窗
 *  14 Toast
 *  15 响应式
 *  16 动效与无障碍
 * ===================================================================== */

/* ============ 01 设计变量与重置 ============ */
:root {
  /* 背景 */
  --bg-0: #05070f;
  --bg-1: #0a0f24;
  --bg-2: #0b0a18;

  /* 玻璃 */
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
  --glass-bg-hover: linear-gradient(160deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.08));
  --glass-stroke: rgba(255, 255, 255, 0.14);
  --glass-stroke-hover: rgba(255, 255, 255, 0.28);
  --glass-blur: blur(22px) saturate(180%);

  /* 文字 */
  --text-1: rgba(255, 255, 255, 0.95);
  --text-2: rgba(255, 255, 255, 0.66);
  --text-3: rgba(255, 255, 255, 0.42);

  /* 强调 / 涨跌 */
  --accent-1: #4facfe;
  --accent-2: #00f2fe;
  --accent-3: #667eea;
  --accent-4: #764ba2;
  --accent-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-grad-2: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --up: #ff4d4f;
  --down: #52c41a;
  --warn: #ffb020;

  /* 尺寸 */
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-glass: 0 22px 60px rgba(2, 5, 18, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --shadow-float: 0 16px 34px rgba(2, 5, 18, 0.5);
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);

  --topbar-h: 68px;
  --disclaimer-h: 34px;
  --bottomnav-h: 62px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background: radial-gradient(1200px 820px at 8% -12%, #1b2a6b 0%, transparent 60%),
    radial-gradient(1000px 720px at 96% -6%, #461a6b 0%, transparent 58%),
    linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 48%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, p, ul, ol, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input,
select {
  font: inherit;
  color: inherit;
}

canvas {
  display: block;
}

::selection {
  background: rgba(79, 172, 254, 0.35);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: content-box;
}

/* 数字统一等宽，避免跳动 */
.num,
.stat-value,
.q-price,
.q-pct,
.q-chg,
.q-vol,
.dh-price,
.book-price,
.book-vol,
.trade-summary b,
.holding-row b,
.meta-item b,
.trade-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.is-up {
  color: var(--up);
}
.is-down {
  color: var(--down);
}
.is-flat {
  color: var(--text-2);
}

.muted {
  color: var(--text-3);
  font-size: 12px;
}

/* ============ 02 背景层 ============ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.blob--1 {
  width: 46vw;
  height: 46vw;
  min-width: 340px;
  min-height: 340px;
  top: -12vw;
  left: -8vw;
  background: radial-gradient(circle at 35% 35%, rgba(79, 172, 254, 0.62), transparent 68%);
  animation: blobFloat1 26s var(--ease) infinite alternate;
}

.blob--2 {
  width: 40vw;
  height: 40vw;
  min-width: 300px;
  min-height: 300px;
  top: 8vh;
  right: -10vw;
  background: radial-gradient(circle at 50% 50%, rgba(118, 75, 162, 0.6), transparent 68%);
  animation: blobFloat2 32s var(--ease) infinite alternate;
}

.blob--3 {
  width: 34vw;
  height: 34vw;
  min-width: 260px;
  min-height: 260px;
  bottom: -14vw;
  left: 34vw;
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.32), transparent 70%);
  animation: blobFloat3 30s var(--ease) infinite alternate;
}

@keyframes blobFloat1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes blobFloat2 {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to   { transform: translate3d(-5vw, 7vh, 0) scale(0.95); }
}
@keyframes blobFloat3 {
  from { transform: translate3d(0, 0, 0) scale(0.98); }
  to   { transform: translate3d(4vw, -6vh, 0) scale(1.1); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 20%, rgba(0, 0, 0, 0.66), transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, rgba(0, 0, 0, 0.66), transparent 78%);
  opacity: 0.55;
}

/* ============ 03 玻璃 / 卡片 / 按钮 / 表单 ============ */
.view {
  position: relative;
  z-index: 1;
}

.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

/* 顶部的液态高光边 */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 34%);
  -webkit-mask-image: linear-gradient(#000, transparent 42%);
  mask-image: linear-gradient(#000, transparent 42%);
  opacity: 0.55;
}

.card {
  padding: 18px 18px 16px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel h3,
.panel-head h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-1);
}

.panel-sub {
  color: var(--text-3);
  font-size: 12px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.25s var(--ease), filter 0.25s var(--ease);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2, 5, 18, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  border-color: var(--glass-stroke-hover);
  background: rgba(255, 255, 255, 0.13);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:focus-visible {
  outline: 2px solid rgba(79, 172, 254, 0.75);
  outline-offset: 2px;
}

.btn--primary {
  border-color: rgba(255, 255, 255, 0.24);
  background: var(--accent-grad);
  box-shadow: 0 12px 26px rgba(102, 126, 234, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:hover {
  background: linear-gradient(135deg, #7a90f2 0%, #8659b4 100%);
  box-shadow: 0 16px 34px rgba(102, 126, 234, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--buy {
  background: linear-gradient(135deg, #ff6b6d 0%, #e0343a 100%);
  box-shadow: 0 12px 26px rgba(255, 77, 79, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn--sell {
  background: linear-gradient(135deg, #6ed66f 0%, #3aa53d 100%);
  box-shadow: 0 12px 26px rgba(82, 196, 26, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
}

.btn--danger {
  border-color: rgba(255, 77, 79, 0.45);
  background: rgba(255, 77, 79, 0.13);
  color: #ffb3b4;
}

.btn--danger:hover {
  background: rgba(255, 77, 79, 0.22);
  border-color: rgba(255, 77, 79, 0.7);
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.icon-btn:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--glass-stroke-hover);
}

.icon-btn--danger:hover {
  color: #ffb3b4;
  border-color: rgba(255, 77, 79, 0.5);
  background: rgba(255, 77, 79, 0.14);
}

/* 表单 */
.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.field input,
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
  font-size: 14px;
  transition: all 0.25s var(--ease);
}

.field input::placeholder,
.input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.field input:focus,
.input:focus {
  outline: none;
  border-color: rgba(79, 172, 254, 0.72);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.16);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 13px;
  height: 13px;
  border: 1.8px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
}

.search::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 22px;
  width: 6px;
  height: 1.8px;
  background: rgba(255, 255, 255, 0.45);
  transform: rotate(45deg);
  border-radius: 2px;
  pointer-events: none;
}

.search input {
  width: 190px;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
  font-size: 12.5px;
  transition: all 0.25s var(--ease);
}

.search input::placeholder {
  color: var(--text-3);
}

.search input:focus {
  outline: none;
  border-color: rgba(79, 172, 254, 0.6);
  background: rgba(255, 255, 255, 0.1);
  width: 220px;
}

.select {
  height: 36px;
  padding: 0 32px 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background-color: rgba(255, 255, 255, 0.06);
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  font-size: 12.5px;
  appearance: none;
  cursor: pointer;
}

.select:focus {
  outline: none;
  border-color: rgba(79, 172, 254, 0.6);
}

.select option {
  background: #10142c;
  color: #fff;
}

/* 分段选择器 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.seg-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-1);
}

.seg-btn.is-active {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.seg-btn .count {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.18);
}

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 15px;
}

.empty .btn {
  margin-top: 14px;
}

/* ============ 04 登录页 ============ */
.view--login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 60px;
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  animation: riseIn 0.6s var(--ease) both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-grad);
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #fff;
  flex: none;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-text strong,
.brand-text h1 {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.brand-text small,
.brand-text p {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--text-3);
}

.brand--lg {
  margin-bottom: 22px;
  padding-left: 4px;
}

.brand--lg .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.brand--lg .brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand--lg h1 {
  font-size: 24px;
  letter-spacing: 0.06em;
}

.brand--lg p {
  letter-spacing: 0.16em;
}

.login-card {
  padding: 22px 22px 20px;
  border-radius: var(--radius-xl);
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
  position: relative;
  z-index: 1;
  height: 34px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.25s var(--ease);
}

.auth-tab.is-active {
  color: #fff;
}

.auth-ink {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 6px);
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: 0 8px 18px rgba(102, 126, 234, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.32s var(--ease);
}

.auth-tabs[data-mode="register"] .auth-ink {
  transform: translateX(calc(100% + 4px));
}

#auth-submit {
  margin-top: 6px;
  height: 46px;
  font-size: 15px;
}

.divider {
  position: relative;
  margin: 18px 0 14px;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.divider span {
  position: relative;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--text-3);
  background: transparent;
}

.login-hint {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
  text-align: center;
}

.login-foot {
  margin-top: 18px;
  padding: 0 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-3);
  text-align: center;
}

/* ============ 05 应用外壳 / 导航 ============ */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar-h);
  padding: 0 max(18px, calc((100vw - 1240px) / 2));
  background: rgba(10, 15, 36, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(2, 5, 18, 0.35);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.topnav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}

.topnav a:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.07);
}

.topnav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 16px rgba(2, 5, 18, 0.3);
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-grad-2);
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.8);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 13px 0 8px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
}

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-grad-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex: none;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta b {
  font-size: 12.5px;
  font-weight: 600;
}

.user-meta i {
  font-size: 11px;
  font-style: normal;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.page-root {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px calc(var(--disclaimer-h) + 34px);
}

.page {
  animation: fadeUp 0.4s var(--ease) both;
}

.disclaimer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--disclaimer-h);
  padding: 0 14px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  background: rgba(8, 11, 26, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bottom-nav {
  display: none;
}

/* ============ 06 账户数字卡片 ============ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 15px 16px 14px;
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.24), transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-stroke-hover);
  box-shadow: 0 24px 52px rgba(2, 5, 18, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

.stat-value {
  display: block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.stat-value.sm {
  font-size: 18px;
}

.stat-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 07 行情列表 ============ */
.market-panel {
  padding: 16px 16px 8px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quote-table {
  width: 100%;
}

.quote-head,
.quote-row {
  display: grid;
  grid-template-columns: minmax(150px, 2.1fr) minmax(76px, 1fr) minmax(78px, 1fr) minmax(74px, 0.9fr) 100px minmax(78px, 0.9fr) 26px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.quote-head {
  height: 34px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-head span:nth-child(n + 2),
.quote-row > div:nth-child(n + 2) {
  text-align: right;
}

.quote-row {
  position: relative;
  height: 60px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease);
}

.quote-row::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.quote-row:last-child::after {
  display: none;
}

.quote-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.quote-row:active {
  transform: scale(0.998);
}

.q-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  text-align: left !important;
}

.q-name > div {
  min-width: 0;
}

.q-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-name span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.q-price {
  font-size: 15.5px;
  font-weight: 700;
}

.q-pct {
  font-size: 13px;
  font-weight: 600;
}

.q-chg {
  font-size: 12.5px;
  color: var(--text-2);
}

.q-spark canvas {
  width: 92px;
  height: 32px;
  margin-left: auto;
}

.q-vol {
  font-size: 12px;
  color: var(--text-2);
}

.q-arrow {
  color: var(--text-3);
  font-size: 16px;
  text-align: right;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.quote-row:hover .q-arrow {
  color: var(--accent-1);
  transform: translateX(2px);
}

.star {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.24);
  transition: all 0.22s var(--ease);
}

.star svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.star:hover {
  color: var(--warn);
  background: rgba(255, 176, 32, 0.12);
}

.star.is-on {
  color: var(--warn);
}

.star.is-on svg {
  fill: currentColor;
}

/* 价格变化高亮 */
@keyframes flashUp {
  0% { background: rgba(255, 77, 79, 0.34); box-shadow: 0 0 0 4px rgba(255, 77, 79, 0.12); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}
@keyframes flashDown {
  0% { background: rgba(82, 196, 26, 0.3); box-shadow: 0 0 0 4px rgba(82, 196, 26, 0.1); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

.flash-up {
  animation: flashUp 0.75s ease-out;
  border-radius: 7px;
}

.flash-down {
  animation: flashDown 0.75s ease-out;
  border-radius: 7px;
}

/* ============ 08 个股详情 ============ */
.page--detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
}

.back-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  font-size: 17px;
  transition: all 0.25s var(--ease);
  flex: none;
}

.back-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(-2px);
}

.dh-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.dh-name h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tag {
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-variant-numeric: tabular-nums;
}

.tag--accent {
  color: #cfe9ff;
  background: rgba(79, 172, 254, 0.16);
  border-color: rgba(79, 172, 254, 0.34);
}

.dh-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-left: auto;
}

.dh-price strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dh-price span {
  font-size: 13px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 14px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.chart-panel {
  padding: 14px 16px 16px;
}

.chart-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.chart-legend {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 268px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.chart-tip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  min-width: 118px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-1);
  background: rgba(16, 20, 44, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(2, 5, 18, 0.5);
  pointer-events: none;
  white-space: nowrap;
  transform: translate3d(0, 0, 0);
}

.chart-tip b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-tip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.chart-tip .tip-row span {
  color: var(--text-3);
}

.quote-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}

.meta-item b {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

/* 盘口 */
.book-panel h3 {
  margin-bottom: 10px;
}

.book {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  overflow: hidden;
}

.book-row .book-bar {
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  border-radius: 5px;
  opacity: 0.18;
  pointer-events: none;
  transition: width 0.4s var(--ease);
}

.book-row.ask .book-bar {
  background: var(--down);
}

.book-row.bid .book-bar {
  background: var(--up);
}

.book-label {
  width: 26px;
  color: var(--text-3);
  font-size: 11px;
  position: relative;
  z-index: 1;
}

.book-price {
  width: 70px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.book-vol {
  margin-left: auto;
  color: var(--text-2);
  position: relative;
  z-index: 1;
}

.book-divider {
  height: 1px;
  margin: 5px 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

/* 交易面板 */
.trade-panel {
  padding: 16px;
}

.trade-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.trade-tab {
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}

.trade-tab:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.1);
}

.trade-tab.is-active[data-side="buy"] {
  color: #fff;
  border-color: rgba(255, 77, 79, 0.6);
  background: linear-gradient(135deg, rgba(255, 107, 109, 0.9), rgba(224, 52, 58, 0.9));
  box-shadow: 0 10px 22px rgba(255, 77, 79, 0.26);
}

.trade-tab.is-active[data-side="sell"] {
  color: #fff;
  border-color: rgba(82, 196, 26, 0.55);
  background: linear-gradient(135deg, rgba(110, 214, 111, 0.92), rgba(58, 165, 61, 0.92));
  box-shadow: 0 10px 22px rgba(82, 196, 26, 0.22);
}

.trade-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-3);
}

.trade-row strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.trade-row .hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
}

.trade-field {
  margin-bottom: 12px;
}

.trade-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.qty-input {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.qty-input button {
  height: 42px;
  font-size: 17px;
  color: var(--text-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.qty-input button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.qty-input input {
  height: 42px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-input input:focus {
  outline: none;
}

.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 7px;
}

.qty-quick button {
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  color: var(--text-2);
  transition: all 0.22s var(--ease);
}

.qty-quick button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-stroke-hover);
}

.trade-summary {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
}

.trade-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  color: var(--text-3);
}

.trade-summary b {
  font-weight: 600;
  color: var(--text-2);
}

.trade-summary .total {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, 0.13);
  color: var(--text-2);
}

.trade-summary .total b {
  font-size: 15px;
  color: var(--text-1);
}

.trade-available {
  margin: 10px 0 12px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.trade-submit {
  height: 44px;
  font-size: 15px;
}

.position-panel {
  font-size: 12.5px;
}

.position-panel h3 {
  margin-bottom: 10px;
}

.position-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.position-list > div {
  display: flex;
  justify-content: space-between;
  color: var(--text-3);
}

.position-list b {
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

/* ============ 09 持仓页 ============ */
.holdings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.holding-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.holding-row {
  display: grid;
  grid-template-columns: minmax(118px, 1.25fr) repeat(4, minmax(62px, 0.85fr)) minmax(108px, 1.05fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.25s var(--ease);
}

/* 桌面端：单元格直接参与父级网格布局 */
.holding-cells {
  display: contents;
}

.holding-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.h-name strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.h-name span {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.h-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.h-cell span {
  font-size: 10.5px;
  color: var(--text-3);
}

.h-cell b {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.alloc-panel {
  display: flex;
  flex-direction: column;
}

.donut-wrap {
  position: relative;
  height: 176px;
  margin: 4px 0 10px;
}

.donut-wrap canvas {
  width: 100%;
  height: 100%;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.legend-item b {
  margin-left: auto;
  color: var(--text-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============ 10 交易记录页 ============ */
.trade-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-item {
  display: grid;
  grid-template-columns: 88px minmax(100px, 1.15fr) 50px repeat(4, minmax(64px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  transition: background 0.22s var(--ease);
}

/* 桌面端：单元格直接参与父级网格布局 */
.trade-cells {
  display: contents;
}

.trade-item:hover {
  background: rgba(255, 255, 255, 0.075);
}

.trade-time {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.trade-name strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.trade-name span {
  font-size: 11px;
  color: var(--text-3);
}

.badge {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge--buy {
  color: #ffc0c1;
  background: rgba(255, 77, 79, 0.18);
  border: 1px solid rgba(255, 77, 79, 0.4);
}

.badge--sell {
  color: #b7e8a4;
  background: rgba(82, 196, 26, 0.16);
  border: 1px solid rgba(82, 196, 26, 0.38);
}

.trade-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
}

.trade-cell span {
  font-size: 10px;
  color: var(--text-3);
}

.trade-cell b {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trade-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

/* ============ 11 设置页 ============ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-row:first-of-type {
  padding-top: 0;
}

.setting-row .label {
  color: var(--text-2);
}

.setting-row .value {
  margin-left: auto;
  color: var(--text-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-all;
}

.setting-row .btn {
  margin-left: auto;
}

.setting-desc {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}

.code-inline {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-num);
  font-size: 11.5px;
  color: #cfe9ff;
}

/* ============ 12 教程抽屉 ============ */
.tutorial-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.tutorial-mask {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 18, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.tutorial-layer.is-open .tutorial-mask {
  opacity: 1;
}

.tutorial-drawer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  height: 100%;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  border-right: 0;
  transform: translateX(102%);
  transition: transform 0.42s var(--ease);
  z-index: 1;
}

.tutorial-layer.is-open .tutorial-drawer {
  transform: translateX(0);
}

.tut-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tut-head h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tut-head .tut-step {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tut-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 16px;
  transition: all 0.22s var(--ease);
}

.tut-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.tut-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 22px 10px;
}

.tut-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 16px;
  border-radius: 20px;
  font-size: 30px;
  line-height: 1;
  background: linear-gradient(150deg, rgba(79, 172, 254, 0.28), rgba(118, 75, 162, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 30px rgba(2, 5, 18, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tut-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.tut-text {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}

.tut-text p {
  margin-bottom: 10px;
}

.tut-text b {
  color: var(--text-1);
  font-weight: 600;
}

.tut-text code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-num);
  font-size: 12px;
  color: #cfe9ff;
}

.tut-tip {
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid rgba(79, 172, 254, 0.26);
  background: rgba(79, 172, 254, 0.1);
  font-size: 12.5px !important;
  color: #cfe9ff !important;
}

.tut-warn {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 176, 32, 0.3);
  background: rgba(255, 176, 32, 0.1);
  font-size: 12.5px !important;
  color: #ffe0a3 !important;
}

.tut-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tut-dots {
  display: flex;
  gap: 5px;
}

.tut-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.3s var(--ease);
}

.tut-dot.is-active {
  width: 18px;
  background: var(--accent-grad-2);
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.7);
}

.tut-dot.is-done {
  background: rgba(79, 172, 254, 0.5);
}

.tut-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.tut-skip {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tut-skip:hover {
  color: var(--text-2);
}

/* ============ 13 弹窗 ============ */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 18, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.modal-layer.is-open {
  opacity: 1;
}

.modal {
  width: min(420px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border-radius: var(--radius-xl);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.32s var(--ease);
  animation: none;
}

.modal-layer.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
}

.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-head .close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 16px;
  transition: all 0.22s var(--ease);
}

.modal-head .close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.modal-body {
  padding: 0 20px 6px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
}

.modal-body p {
  margin-bottom: 10px;
}

.modal-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
}

.modal-foot .btn {
  flex: 1;
}

.confirm-stock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.confirm-stock strong {
  font-size: 16px;
  color: var(--text-1);
}

.confirm-stock span {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.confirm-list {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.confirm-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.confirm-list dt {
  font-size: 12px;
  color: var(--text-3);
}

.confirm-list dd {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.confirm-list .hl {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.confirm-list .hl dd {
  font-size: 16px;
}

.confirm-tip {
  margin: 10px 0 4px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ============ 14 Toast ============ */
.toast-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 460px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  background: rgba(18, 23, 48, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(2, 5, 18, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: toastIn 0.32s var(--ease) both;
  max-width: 100%;
}

.toast.is-out {
  animation: toastOut 0.28s var(--ease) forwards;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--accent-1);
  box-shadow: 0 0 10px rgba(79, 172, 254, 0.9);
}

.toast--success::before {
  background: var(--down);
  box-shadow: 0 0 10px rgba(82, 196, 26, 0.9);
}

.toast--error::before {
  background: var(--up);
  box-shadow: 0 0 10px rgba(255, 77, 79, 0.9);
}

.toast--warn::before {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(255, 176, 32, 0.9);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px) scale(0.97); }
}

/* ============ 15 响应式 ============ */
@media (max-width: 1100px) {
  .overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 980px) {
  .topnav {
    display: none;
  }
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* 奇数个数字卡片时，最后一张占满整行，避免悬空 */
  .overview-grid > .stat-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
  .detail-grid,
  .holdings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .trade-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-h: 58px;
  }
  body {
    font-size: 13.5px;
  }
  .page-root {
    padding: 14px 12px calc(var(--disclaimer-h) + var(--bottomnav-h) + 26px);
  }
  .topbar {
    padding: 0 12px;
    gap: 10px;
  }
  .topbar .brand-text small,
  .topbar-actions .icon-btn[data-action="logout"] {
    display: none;
  }
  .topbar-actions .icon-btn {
    padding: 0 9px;
  }
  .user-chip {
    height: 36px;
    padding: 0 10px 0 6px;
  }
  .user-meta i {
    display: none;
  }
  .disclaimer {
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    height: 34px;
    font-size: 9.5px;
    line-height: 1.25;
    padding: 2px 10px;
    background: rgba(8, 11, 26, 0.9);
  }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 14, 32, 0.72);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -12px 30px rgba(2, 5, 18, 0.45);
  }
  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    color: var(--text-3);
    transition: color 0.25s var(--ease);
  }
  .bn-item svg {
    width: 20px;
    height: 20px;
  }
  .bn-item.is-active {
    color: #fff;
  }
  .bn-item.is-active svg {
    filter: drop-shadow(0 0 8px rgba(79, 172, 254, 0.9));
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .stat-card {
    padding: 12px 13px;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-sub {
    font-size: 10px;
  }

  /* 行情列表 → 卡片式 */
  .quote-head {
    display: none;
  }
  .quote-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 4px;
  }
  .quote-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "name price pct"
      "name spark vol";
    height: auto;
    padding: 11px 12px;
    gap: 4px 10px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
  }
  .quote-row::after {
    display: none;
  }
  .q-name {
    grid-area: name;
  }
  .q-price {
    grid-area: price;
    font-size: 16px;
    text-align: right;
  }
  .q-pct {
    grid-area: pct;
    text-align: right;
    min-width: 62px;
  }
  .q-chg {
    display: none;
  }
  .q-spark {
    grid-area: spark;
    justify-self: start;
  }
  .q-spark canvas {
    width: 84px;
    height: 26px;
    margin-left: 0;
  }
  .q-vol {
    grid-area: vol;
    text-align: right;
    font-size: 11px;
  }
  .q-arrow {
    display: none;
  }

  .chart-wrap {
    height: 224px;
  }
  .detail-head {
    gap: 10px;
    padding: 12px 14px;
  }
  .dh-name h2 {
    font-size: 17px;
  }
  .dh-price {
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    line-height: 1.15;
  }
  .dh-price strong {
    font-size: 20px;
  }
  .dh-price span {
    font-size: 11.5px;
  }
  .quote-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .holding-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name action"
      "cells cells";
    row-gap: 10px;
  }
  .h-name {
    grid-area: name;
  }
  .holding-row .btn {
    grid-area: action;
    justify-self: end;
  }
  .h-cell {
    text-align: left;
  }
  .holding-cells {
    grid-area: cells;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 6px;
    width: 100%;
  }

  .trade-item {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name badge"
      "time time"
      "meta meta";
    row-gap: 4px;
    padding: 10px 12px;
  }
  .trade-time {
    grid-area: time;
    font-size: 10.5px;
  }
  .trade-name {
    grid-area: name;
  }
  .badge {
    grid-area: badge;
  }
  .trade-cells {
    grid-area: meta;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    margin-top: 2px;
  }
  .trade-cell {
    text-align: left;
  }

  .tutorial-drawer {
    width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(102%);
  }
  .tutorial-layer.is-open .tutorial-drawer {
    transform: translateY(0);
  }
  .tutorial-layer {
    align-items: flex-end;
  }
  .tut-body {
    padding: 18px 18px 8px;
  }
  .tut-title {
    font-size: 18px;
  }
  .toast-stack {
    top: calc(var(--topbar-h) + 8px);
  }
}

@media (max-width: 460px) {
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-value {
    font-size: 17px;
  }
  .tag--accent {
    display: none;
  } /* 窄屏隐藏行业标签，保证个股头部一行放得下 */
  .panel-tools {
    width: 100%;
  }
  .panel-tools .search {
    flex: 1;
  }
  .search input,
  .search input:focus {
    width: 100%;
  }
  .panel-head {
    gap: 8px;
  }
  .h-cell {
    text-align: left;
  }
  .holding-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trade-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal {
    width: 100%;
  }
  .modal-layer {
    padding: 12px;
    align-items: flex-end;
  }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

/* ============ 16 动效与无障碍 ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .blob {
    animation: none !important;
  }
}

:focus-visible {
  outline: 2px solid rgba(79, 172, 254, 0.7);
  outline-offset: 2px;
}
