/* ==========================================================================
   components.css —— 按钮 / 卡片 / 标签 / 图标块 / 图表 / 表格 等通用组件
   ========================================================================== */

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 36px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .3s ease;
}
.btn--sm { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn--lg { padding: 18px 36px; }

.btn--primary {
  overflow: hidden;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(37, 99, 235, .8);
}
.btn--primary:hover { background: var(--brand-600); box-shadow: 0 14px 36px -10px rgba(37, 99, 235, .65); }
html.dark .btn--primary:hover { background: var(--brand-400); }
.btn--primary::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -35%;
  width: 35%;
  background: rgba(255, 255, 255, .28);
  filter: blur(10px);
  transform: skewX(-12deg);
  animation: sweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

.btn--ghost,
.btn--line {
  border: 1px solid var(--brand-200);
  background: rgba(255, 255, 255, .7);
  color: var(--brand);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover,
.btn--line:hover { border-color: var(--brand-400); background: var(--brand-50); box-shadow: var(--shadow-card); }
html.dark .btn--ghost, html.dark .btn--line { border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--brand-300); }
html.dark .btn--ghost:hover, html.dark .btn--line:hover { border-color: rgba(91, 155, 255, .5); background: rgba(37, 99, 235, .12); }

.btn--outline { border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .05); color: #fff; backdrop-filter: blur(8px); }
.btn--outline:hover { border-color: rgba(0, 229, 255, .5); background: rgba(255, 255, 255, .1); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  border: 1px solid var(--brand-100);
  background: rgba(255, 255, 255, .7);
  color: var(--text);
  transition: all .25s ease;
}
.icon-btn:hover { background: var(--brand-50); }
html.dark .icon-btn { border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--accent); }
html.dark .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn svg { width: 18px; height: 18px; }
#themeToggle .i-sun { display: none; }
html.dark #themeToggle .i-sun { display: block; }
html.dark #themeToggle .i-moon { display: none; }

/* ---------- 眉标 / 标签 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  background: var(--brand-50);
  font-size: 12px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand);
}
html.dark .eyebrow { border-color: rgba(91, 155, 255, .25); background: rgba(37, 99, 235, .12); color: var(--brand-300); }

.live { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.live::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent); animation: live 1.8s ease-out infinite;
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--brand-50);
  font-size: 11.5px; color: var(--brand-600);
}
html.dark .chip { border-color: rgba(91, 155, 255, .25); background: rgba(37, 99, 235, .12); color: var(--brand-300); }
.chip--accent {
  border-color: rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .05);
  font-family: var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
}

.pill {
  padding: 6px 12px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--brand-50);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--brand-700, var(--brand-600));
}
html.dark .pill { border-color: rgba(91, 155, 255, .22); background: rgba(37, 99, 235, .12); color: var(--brand-300); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips span {
  padding: 6px 11px;
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  background: rgba(234, 244, 255, .6);
  font-size: 12px; color: var(--brand-600);
}
html.dark .chips span { border-color: rgba(91, 155, 255, .2); background: rgba(37, 99, 235, .1); color: var(--brand-300); }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 26px 60px -28px rgba(13,21,39,0.26);
  backdrop-filter: blur(12px);
  transition: transform .5s ease, border-color .5s ease, box-shadow .5s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--brand-200); box-shadow: var(--shadow-hover); }
html.dark .card:hover { border-color: rgba(91, 155, 255, .4); }
.card--pad { padding: 34px; }
@media (min-width: 640px) { .card--pad { padding: 40px; } }

.card__head { display: flex; align-items: center; gap: 14px; }
.card__title { font-size: 19px; color: var(--text); }
.card__hint { margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--brand); }
html.dark .card__hint { color: var(--brand-300); }
.card__text { font-size: 14px; line-height: 1.85; color: var(--text-muted); }
.card__text b { color: var(--text); font-weight: 600; }

.icobox {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, .1);
  color: var(--brand);
}
.icobox svg { width: 22px; height: 22px; }
.icobox--accent { background: rgba(34, 185, 130, .14); color: #137b57; }
html.dark .icobox--accent { color: var(--accent); }
.icobox--fill { background: linear-gradient(135deg, var(--brand), var(--deep)); color: #fff; box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .9); }
.module:nth-child(2) .icobox--fill { background: linear-gradient(135deg, #ff986b, var(--accent-coral)); box-shadow: 0 10px 24px -12px rgba(244, 119, 92, .65); }
.module:nth-child(3) .icobox--fill { background: linear-gradient(135deg, #48d6a1, var(--accent-mint)); box-shadow: 0 10px 24px -12px rgba(34, 185, 130, .55); }
.icobox--glass { background: rgba(255, 255, 255, .1); color: var(--accent); }
html.dark .icobox { background: rgba(37, 99, 235, .16); color: var(--brand-300); }
html.dark .icobox--fill { background: linear-gradient(135deg, var(--brand), var(--deep)); color: #fff; }

/* ---------- 结构小组件 ---------- */
.panel {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.panel__foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--brand);
  display: flex; align-items: center; gap: 8px;
}
html.dark .panel__foot { color: var(--brand-300); }

.flow { position: relative; height: 3px; border-radius: 999px; background: var(--line); margin-bottom: 22px; }
.flow::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 62%;
  border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent));
}
.flow__dot {
  position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0, 229, 255, .9);
  animation: flowdot 4.5s linear infinite;
}

.states { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.states i {
  display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto;
  border-radius: 10px; background: var(--brand-50); color: var(--brand);
  font-family: var(--font-display); font-style: normal; font-size: 13px; font-weight: 600;
}
.states i.on { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .8); }
.states .mono { display: block; margin-top: 8px; font-size: 9.5px; letter-spacing: .14em; }
.states b { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text); }
.states small { display: none; }
@media (min-width: 640px) { .states small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--text-faint); } }
html.dark .states i { background: rgba(37, 99, 235, .15); color: var(--brand-300); }
html.dark .states i.on { background: var(--brand); color: #fff; }

.mem + .mem { margin-top: 18px; }
.mem__row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.mem__row span { font-weight: 500; color: var(--text); }
.mem__row em { font-family: var(--font-mono); font-style: normal; font-size: 12px; color: var(--brand); }
html.dark .mem__row em { color: var(--brand-300); }
.mem small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-faint); }

.bar { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 1.2s cubic-bezier(.22, 1, .36, 1);
}
html.dark .bar { background: rgba(255, 255, 255, .1); }

.dots li,
.ticks li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.75; color: var(--text-muted); }
.dots li + li, .ticks li + li { margin-top: 10px; }
.dots li::before {
  content: ''; position: absolute; left: 2px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.ticks li::before {
  content: ''; position: absolute; left: 1px; top: 9px;
  width: 10px; height: 6px;
  border-left: 1.6px solid var(--brand); border-bottom: 1.6px solid var(--brand);
  transform: rotate(-45deg);
}

.note {
  margin-top: 20px; padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12.5px; line-height: 1.7; color: var(--text-soft);
}
.note .mono { display: block; margin-bottom: 4px; }
html.dark .note { background: rgba(37, 99, 235, .1); }

/* 模块卡 ABCD */
.module { padding: 24px; overflow: hidden; }
.module__tag {
  position: absolute; right: -18px; top: -22px;
  font-family: var(--font-display); font-size: 64px; font-weight: 700; line-height: 1;
  color: rgba(37, 99, 235, .12);
  transition: color .5s ease;
  pointer-events: none;
}
.module:hover .module__tag { color: rgba(37, 99, 235, .2); }
html.dark .module__tag { color: rgba(91, 155, 255, .12); }
.module h4 { margin-top: 20px; font-size: 17px; color: var(--text); }
.module .dots { margin-top: 16px; }

/* ---------- 玻璃卡片（深底用） ---------- */
.gcard {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  transition: all .5s ease;
}
.gcard:hover { transform: translateY(-6px); border-color: rgba(0, 229, 255, .35); background: rgba(255, 255, 255, .09); }
.gcard h4 { font-size: 16px; color: #fff; }
.gcard p { margin-top: 10px; font-size: 13px; line-height: 1.75; color: rgba(255, 255, 255, .6); }
.gcard--row { display: flex; align-items: flex-start; gap: 16px; }
.gcard--row b { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.gcard--row .mono { color: var(--accent); opacity: .8; }

/* ---------- 表格 ---------- */
.table-wrap { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table thead th {
  background: var(--surface-soft);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 400;
}
.table td { color: var(--text-muted); }
.table td:first-child { color: var(--text); font-weight: 500; }
.table td.ok { color: var(--brand); font-weight: 500; }
html.dark .table td.ok { color: var(--brand-300); }
.table tbody tr:hover { background: rgba(37, 99, 235, .04); }
html.dark .table thead th { background: rgba(37, 99, 235, .1); }
@media (max-width: 860px) {
  .table thead { display: none; }
  .table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .table td { display: block; padding: 8px 24px; border: 0; }
  .table td::before {
    content: attr(data-l); display: block;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint);
  }
}

/* ---------- 图表 ---------- */
.mk + .mk { margin-top: 24px; }
.mk__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mk__row b { font-size: 14px; color: var(--text); font-weight: 500; }
.mk__row em { font-family: var(--font-mono); font-style: normal; font-size: 12px; color: var(--text-faint); }
.mk__meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; font-size: 11.5px; color: var(--text-faint); }
.mk__meta span { color: var(--brand); }
html.dark .mk__meta span { color: var(--brand-300); }

.total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 26px; padding: 16px 20px;
  border-radius: var(--radius-sm); background: rgba(37, 99, 235, .07);
  font-size: 13px; color: var(--text);
}
.total b { font-family: var(--font-display); font-size: 16px; color: var(--brand); }
html.dark .total { background: rgba(37, 99, 235, .12); }
html.dark .total b { color: var(--brand-300); }

.chart {
  display: flex; align-items: flex-end; justify-content: center; gap: 32px;
  height: 230px; margin-top: 34px;
}
.chart__col { display: flex; flex-direction: column; align-items: center; width: 76px; }
.chart__tip { margin-bottom: 6px; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--text); }
.chart__track {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  width: 100%; height: 150px;
  border-radius: 10px; background: rgba(37, 99, 235, .07);
}
html.dark .chart__track { background: rgba(255, 255, 255, .05); }
.chart__track i {
  display: block; width: 40px; height: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600) 55%, var(--deep));
  box-shadow: 0 10px 30px -12px rgba(37, 99, 235, .8);
  transition: height 1.1s cubic-bezier(.22, 1, .36, 1);
}
.chart__track::after {
  content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 6px; border-radius: 999px; background: var(--accent);
}
.chart__col b { margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--text); }
.chart__col small { margin-top: 4px; font-size: 11px; color: var(--text-faint); }

.fintable { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.fintable > div { display: grid; grid-template-columns: 1fr repeat(3, 1fr); gap: 8px; font-size: 12.5px; }
.fintable > div + div { margin-top: 12px; }
.fintable span { color: var(--text-faint); }
.fintable em {
  font-style: normal; text-align: right; font-weight: 500; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.fintable em.hi { color: var(--brand); }
html.dark .fintable em.hi { color: var(--brand-300); }

.hairline { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
