/* ── 客户后台（全屏视图）─────────────────────────────
   设计: docs/superpowers/specs/2026-07-06-chopchat-account-dashboard-redesign-design.md
   根节点 #accountDashboard 必须是 body 直接子元素（test_index_html_structure.py 保护） */

.acct-view {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #f5f7fa;
  overflow-y: auto;
}

.acct-topbar {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid #e7eaf0;
  padding: 12px 24px; position: sticky; top: 0; z-index: 10;
}
.acct-back-btn {
  border: 1px solid #e7eaf0; background: #fff; border-radius: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; color: #1c2330;
}
.acct-back-btn:hover { border-color: #00C9C3; color: #00a49f; }
.acct-title { font-size: 16px; font-weight: 700; }
.acct-user { margin-left: auto; font-size: 13px; color: #6b7480; }

.acct-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* ── 概览卡片 ── */
.acct-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.acct-card {
  background: #fff; border: 1px solid #e7eaf0; border-radius: 14px;
  padding: 18px 18px 16px;
}
.acct-card .k { font-size: 12px; color: #6b7480; margin-bottom: 8px; }
.acct-card .v { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.acct-card .v small { font-size: 12px; font-weight: 500; color: #6b7480; }
.acct-card .note { font-size: 11.5px; color: #6b7480; margin-top: 6px; }
.acct-plan-badge {
  display: inline-block; background: rgba(0,201,195,.12); color: #00a49f;
  font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 8px; margin-bottom: 6px;
}
.acct-meter { height: 6px; background: #eef1f5; border-radius: 4px; margin-top: 10px; overflow: hidden; }
.acct-meter i { display: block; height: 100%; background: linear-gradient(90deg, #00C9C3, #37d9d4); border-radius: 4px; transition: width .3s; }

/* ── 区块 ── */
.acct-section { margin-top: 26px; background: #fff; border: 1px solid #e7eaf0; border-radius: 14px; padding: 20px; }
.acct-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.acct-sec-title { font-size: 15px; font-weight: 700; }
.acct-sec-sub { font-size: 12px; color: #6b7480; }
.acct-sec-right { margin-left: auto; font-size: 12px; color: #6b7480; }

/* ── 活跃度热力图（自适应铺满卡片宽度，格子随容器缩放保持正方形） ── */
.acct-heat-scroll { padding-bottom: 4px; }
.acct-heatmap { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-rows: repeat(7, auto); gap: 3px; width: 100%; }
.acct-heatmap .cell { width: auto; height: auto; aspect-ratio: 1 / 1; min-width: 6px; border-radius: 2.5px; background: #ebedf0; }
#acctHeatTip {
  display: none; position: fixed; z-index: 3000; pointer-events: none;
  background: #1f2937; color: #fff; font-size: 12px; line-height: 1.4;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.acct-heatmap .c1 { background: #b7f0ed; }
.acct-heatmap .c2 { background: #66dcd7; }
.acct-heatmap .c3 { background: #17bfb8; }
.acct-heatmap .c4 { background: #068c86; }
.acct-heat-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #6b7480; margin-top: 8px; justify-content: flex-end; }
.acct-heat-legend i { width: 11px; height: 11px; border-radius: 2.5px; background: #ebedf0; display: inline-block; }
.acct-heat-legend i.c1 { background: #b7f0ed; }
.acct-heat-legend i.c2 { background: #66dcd7; }
.acct-heat-legend i.c3 { background: #17bfb8; }
.acct-heat-legend i.c4 { background: #068c86; }

/* ── 每日用量图 ── */
.acct-daily-chart { width: 100%; height: 180px; }

/* ── 模型倍率信息条 ── */
.acct-rate-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.acct-rate-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px dashed #e7eaf0; border-radius: 10px; padding: 10px 14px; font-size: 12.5px;
  background: #fafbfd;
}
.acct-rate-item.rec { border: 1.5px solid #00C9C3; background: rgba(0,201,195,.06); }
.acct-rate-item b { font-size: 14px; }
.acct-rate-item .x { font-weight: 800; color: #00a49f; font-size: 15px; }
.acct-rec-tag {
  font-size: 10.5px; background: #00C9C3; color: #fff; border-radius: 5px;
  padding: 1.5px 6px; font-weight: 700; vertical-align: 2px;
}
.acct-ref-line { font-size: 12px; color: #6b7480; margin-bottom: 16px; }
.acct-ref-line b { color: #1c2330; font-weight: 600; }

/* ── 套餐卡 ── */
.acct-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.acct-pack {
  border: 1.5px solid #e7eaf0; border-radius: 14px; padding: 18px;
  transition: all .15s; background: #fff;
}
.acct-pack:hover { border-color: #00C9C3; box-shadow: 0 6px 18px rgba(0,201,195,.15); transform: translateY(-2px); }
.acct-pack .name { font-size: 14px; font-weight: 700; }
.acct-pack .tokens { font-size: 13px; color: #6b7480; margin: 6px 0 12px; }
.acct-pack .price { font-size: 24px; font-weight: 800; color: #00a49f; margin-bottom: 14px; }
.acct-pack .price small { font-size: 12px; color: #6b7480; font-weight: 500; }
.acct-pack.year { border-color: #f0c33c; background: linear-gradient(180deg, #fffdf4, #fff); }
.acct-pack .tag { float: right; font-size: 11px; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 2px 7px; }
.acct-buy-btn {
  display: block; width: 100%; background: #00C9C3; color: #fff; border: none;
  border-radius: 10px; padding: 11px 0; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.acct-buy-btn:hover { background: #00a49f; }
.acct-pack.year .acct-buy-btn { background: #e6a817; }
.acct-pack.year .acct-buy-btn:hover { background: #c99312; }

/* ── 订单表 ── */
.acct-filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
.acct-chip {
  font-size: 12px; border: 1px solid #e7eaf0; background: #fff; border-radius: 20px;
  padding: 5px 14px; cursor: pointer; color: #6b7480;
}
.acct-chip.on { background: rgba(0,201,195,.1); border-color: #00C9C3; color: #00a49f; font-weight: 600; }
.acct-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-orders-table th { text-align: left; font-size: 12px; color: #6b7480; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid #e7eaf0; }
.acct-orders-table td { padding: 12px 10px; border-bottom: 1px solid #f1f3f7; }
.acct-orders-table tr.dim { opacity: .55; }
.acct-st { font-size: 12px; font-weight: 600; border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.acct-st.paid { color: #16a34a; background: rgba(22,163,74,.08); }
.acct-st.pending { color: #d97706; background: rgba(217,119,6,.1); }
.acct-st.expired, .acct-st.cancelled { color: #9aa1ab; background: #f1f3f7; }
.acct-op-btn {
  font-size: 12px; border: 1px solid #e7eaf0; background: #fff; border-radius: 7px;
  padding: 5px 10px; cursor: pointer; margin-right: 6px; color: #1c2330;
}
.acct-op-btn.primary { background: #00C9C3; border-color: #00C9C3; color: #fff; font-weight: 600; }
.acct-op-btn.link { border: none; color: #00a49f; background: none; text-decoration: underline; }
.acct-inv-st { font-size: 11.5px; color: #6b7480; white-space: nowrap; }
.acct-empty { font-size: 13px; color: #9aa1ab; padding: 20px 0; text-align: center; }

/* ── 结账弹层（三态）/ 发票弹窗 ── */
.acct-modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.acct-modal-mask.show { display: flex; }
.acct-checkout {
  background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 26px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25); text-align: center;
}
.acct-checkout h3 { font-size: 16px; margin: 0 0 18px; }
.acct-co-box { border: 1px solid #e7eaf0; border-radius: 12px; padding: 16px; text-align: left; margin-bottom: 16px; }
.acct-co-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: #6b7480; }
.acct-co-row b { color: #1c2330; }
.acct-co-row.total { border-top: 1px dashed #e7eaf0; margin-top: 8px; padding-top: 12px; font-size: 14px; align-items: baseline; }
.acct-co-row.total b { font-size: 22px; color: #00a49f; }
.acct-pay-btn {
  width: 100%; background: #1677ff; color: #fff; border: none; border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.acct-pay-btn:hover { background: #0e69e8; }
.acct-pay-btn.teal { background: #00C9C3; }
.acct-pay-btn.teal:hover { background: #00a49f; }
.acct-co-cancel { margin-top: 12px; font-size: 13px; color: #6b7480; background: none; border: none; cursor: pointer; text-decoration: underline; }
.acct-qr-holder { width: 200px; height: 200px; margin: 0 auto 12px; border: 1px solid #e7eaf0; border-radius: 12px; padding: 8px; background: #fff; display: flex; align-items: center; justify-content: center; }
.acct-pay-wait { font-size: 13px; color: #d97706; }
.acct-pay-fail { font-size: 13px; color: #dc2626; margin-bottom: 12px; }
.acct-big-check {
  width: 84px; height: 84px; border-radius: 50%; background: rgba(22,163,74,.1);
  margin: 6px auto 16px; display: flex; align-items: center; justify-content: center;
}
.acct-big-check svg { width: 44px; height: 44px; stroke: #16a34a; stroke-width: 3; fill: none; }
.acct-success-title { font-size: 19px; font-weight: 800; color: #16a34a; margin-bottom: 8px; }
.acct-success-sub { font-size: 13px; color: #6b7480; margin-bottom: 20px; }

.acct-form-field { text-align: left; margin-bottom: 12px; }
.acct-form-field label { display: block; font-size: 12px; color: #6b7480; margin-bottom: 4px; }
.acct-form-field input {
  width: 100%; box-sizing: border-box; border: 1px solid #e7eaf0; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; background: #fff; color: #1c2330;
}
.acct-form-field input:focus { outline: none; border-color: #00C9C3; }

/* ── 简化版套餐说明弹窗内部 ── */
.plan-rate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.plan-rate-card {
  display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center;
  border: 1px dashed #e7eaf0; border-radius: 10px; padding: 12px; background: #fafbfd;
}
.plan-rate-card.rec { border: 1.5px solid #00C9C3; background: rgba(0,201,195,.06); }
.plan-rate-card b { font-size: 14px; }
.plan-rate-card .x { font-weight: 800; color: #00a49f; font-size: 16px; }
.plan-ref-box {
  font-size: 12.5px; color: #6b7480; line-height: 2;
  border: 1px dashed #e7eaf0; border-radius: 10px; padding: 10px 14px; margin: 12px 0 20px;
}
.plan-ref-box b { color: #1c2330; }
.plan-goto-note { font-size: 11.5px; color: #6b7480; text-align: center; margin-top: 10px; }

/* ── 暗色主题 ── */
body.dark .acct-view { background: #14171c; }
body.dark .acct-topbar,
body.dark .acct-card, body.dark .acct-section,
body.dark .acct-pack, body.dark .acct-checkout { background: #1d2127; border-color: #2c313a; }
body.dark .acct-title, body.dark .acct-card .v, body.dark .acct-pack .name,
body.dark .acct-sec-title, body.dark .acct-co-row b, body.dark .acct-checkout h3,
body.dark .acct-ref-line b, body.dark .plan-ref-box b { color: #e6e9ee; }
body.dark .acct-back-btn, body.dark .acct-chip, body.dark .acct-op-btn { background: #1d2127; border-color: #2c313a; color: #c6ccd6; }
body.dark .acct-rate-item, body.dark .plan-rate-card { background: #171b20; border-color: #2c313a; }
body.dark .acct-rate-item.rec, body.dark .plan-rate-card.rec { border-color: #00C9C3; }
body.dark .acct-orders-table td { border-color: #262b33; }
body.dark .acct-orders-table th { border-color: #2c313a; }
body.dark .acct-meter { background: #262b33; }
body.dark .acct-heatmap .cell { background: #262b33; }
body.dark .acct-co-box { border-color: #2c313a; }
body.dark .acct-form-field input { background: #171b20; border-color: #2c313a; color: #e6e9ee; }
body.dark .acct-pack.year { background: linear-gradient(180deg, #23211a, #1d2127); }
body.dark .acct-qr-holder { background: #fff; }  /* 二维码必须白底才可扫 */

@media (max-width: 860px) {
  .acct-cards, .acct-packs { grid-template-columns: repeat(2, 1fr); }
  .acct-rate-strip { grid-template-columns: 1fr; }
  .acct-orders-table .hide-sm { display: none; }
}
