/* ==========================================================================
   积分中心（/topup）页面样式 —— 2026-09-23 第 15 轮从 topup.html 里抽出来
   --------------------------------------------------------------------------
   为什么抽成独立文件（用户明确要求「结构化，不要把内容都写在一起」）：
     · 结构：templates/topup.html 只留 HTML 骨架
              static/css/points.css 样式（本文件）
              static/js/points.js   逻辑（拉数据/渲染/交互）
     · 这是全站第三个这样拆的页（前两个：CRM 用 static/css/crm.css + static/js/crm/*，
       工作台用 static/js/app.js + static/js/{core,tools}/*）—— 新页面照这个来。
   ⚠️ 新增静态目录/文件后，必须同步 server/deploy_web.py 的 upload 清单，否则线上 404。
   颜色仍走全站那套深海青蓝（#0f3a52 / #1b6b8f / #eef5f9），不引新色。
   ========================================================================== */
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.75 system-ui, "Microsoft YaHei", sans-serif; color: #182230; background: #f7f8fa; }
a { color: #1b6b8f; }

/* 页头是 sticky 的 64px（templates/_topbar.html 提供）。
   点「充值积分」跳到 #recharge 时，浏览器会把目标滚到视口最顶 → 被页头吃掉一截。
   scroll-margin-top 给锚点目标留出页头高度 + 一点呼吸（用户原话：
   「点击充值积分按钮，跳转的时候不太精准，可能是没考虑到页头高度，会吞一点」）。 */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
#recharge, #usage, .anchor-target { scroll-margin-top: 76px; }

.hero { background: #fff; border-bottom: 1px solid #e5eaf1; padding: 22px 20px 18px; text-align: center; }
.hero h1 { margin: 0 0 7px; font-size: 24px; font-weight: 800; }
.hero h1 em { font-style: normal; color: #1b6b8f; }
/* 顶部说明压成一行（用户：「把上面的积分中心的介绍…保留的话，就把『积分长期有效，用多少扣多少』去掉，
   就显示一行」）——只留「会员给工具使用权 + AI 按量扣积分 + 兑换比例」这一行事实。 */
.hero p { margin: 0 auto; max-width: 760px; font-size: 13px; color: #5b6b7d; }
.hero p b { color: #1b6b8f; }
.wrap { max-width: 960px; margin: 0 auto; padding: 22px 18px 56px; }

.card { background: #fff; border: 1px solid #e5eaf1; border-radius: 13px; padding: 18px 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-title { font-size: 17px; font-weight: 800; color: #0f3a52; margin: 0; }
.sec-sub { font-size: 13px; color: #5b6b7d; margin: 4px 0 0; }

/* 余额卡 */
.balance { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.balance .b-left { font-size: 13px; color: #5b6b7d; }
.balance .b-left b { display: block; font-size: 15px; color: #0f3a52; margin-bottom: 2px; }
.balance .num { font-size: 30px; font-weight: 800; color: #1b6b8f; line-height: 1.2; }
.balance .num small { font-size: 13px; font-weight: 400; color: #5b6b7d; margin-left: 3px; }
.buckets { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.bucket { flex: 1 1 190px; background: #f7fafc; border: 1px solid #e9eff5; border-radius: 10px; padding: 10px 13px; }
.bucket .bk-t { font-size: 12px; color: #5b6b7d; }
.bucket .bk-v { font-size: 18px; font-weight: 800; color: #0f3a52; margin: 2px 0 1px; }
.bucket .bk-n { font-size: 11.5px; color: #93a1b0; }
.btn-go { background: #1b6b8f; color: #fff; border: 0; border-radius: 9px; padding: 9px 18px;
          font-size: 13.5px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none;
          display: inline-flex; align-items: center; white-space: nowrap; }
.btn-go:hover { background: #0f3a52; }

/* 分段控件（时间范围 / 分组 / 类型） */
/* ⚠️ 本页专属 .seg（/topup 充值页的分段切换）。
   注意：crm.css 和 login.css 里也有同名 .seg，但长相与结构都不同
   （本页是 <button> 子元素，crm 是 <div> 子元素，login 是 .seg-btn）。
   三个页面互不同时加载，所以不构成冲突；但改这里不要以为别页会跟着变。 */
.seg { display: inline-flex; background: #f1f5f8; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; cursor: pointer;
              font-size: 13px; font-family: inherit; color: #55636f; font-weight: 600; white-space: nowrap; }
.seg button:hover { color: #0f3a52; }
.seg button.on { background: #fff; color: #0f3a52; box-shadow: 0 1px 3px rgba(16,26,40,.10); }
.row-head2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }
.custom-range { display: none; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: #5b6b7d; flex-wrap: wrap; }
.custom-range input { padding: 7px 10px; border: 1px solid #e5eaf1; border-radius: 8px; font: inherit; font-size: 13px; outline: none; }
.custom-range button { background: #1b6b8f; color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* 汇总小卡 */
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 6px; }
.sum .s-item { background: #f7fafc; border: 1px solid #e9eff5; border-radius: 10px; padding: 11px 13px; }
.sum .s-t { font-size: 12px; color: #5b6b7d; }
.sum .s-v { font-size: 19px; font-weight: 800; color: #0f3a52; margin-top: 2px; }
.sum .s-v.out { color: #1b6b8f; }
.sum .s-v.in { color: #16a34a; }
.sum .s-n { font-size: 11.5px; color: #93a1b0; margin-top: 1px; }

/* ── 按天柱状图（纯 CSS，不引图表库 —— 同 CRM 驾驶舱的做法）
   2026-09-23 修（用户原话：「我点击用量与明细，近7天/近30天的时候，只见到一点点的柱状，
   下面的日期没跟着显示」）：
     · 日期必须**和柱子一一对齐**：柱子和刻度共用同一套 flex 尺寸（.bar-wrap / .tick 同 flex），
       所以日期在柱子正下方，不会「没跟着显示」。
     · 零消耗的那天不是空白，给一条浅灰短桩（看得见「这天没花」）。
     · 顶部给一行「最高 / 合计」，让柱高有参照，不然小柱子看着像没画出来。 */
.chart-top { display: flex; justify-content: space-between; font-size: 12px; color: #93a1b0; margin: 14px 0 6px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 112px; padding: 0 2px; }
.chart .bar-wrap { flex: 1 1 0; min-width: 10px; display: flex; flex-direction: column;
                   align-items: center; justify-content: flex-end; height: 100%; cursor: default; }
.chart .bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #38bdf8, #1b6b8f);
              border-radius: 3px 3px 0 0; min-height: 3px; }
.chart .bar.zero { background: #e3ebf2; }
.chart .in-dot { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; margin-bottom: 2px; }
.chart .in-dot.hide { visibility: hidden; }
/* 刻度行：和柱子同宽同序，日期就在柱子正下方 */
.chart-x { display: flex; gap: 3px; padding: 6px 2px 0; font-size: 11px; color: #93a1b0; border-top: 1px solid #eef2f6; }
.chart-x .tick { flex: 1 1 0; min-width: 10px; text-align: center; white-space: nowrap; overflow: hidden; }
.chart-x .tick.hide { visibility: hidden; }
.chart-x .tick.today { color: #1b6b8f; font-weight: 700; }

/* 明细分组 */
.lg { border: 1px solid #e9eff5; border-radius: 11px; margin-bottom: 10px; overflow: hidden; }
.lg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
           padding: 10px 14px; background: #f7fafc; cursor: pointer; font-size: 13.5px; }
.lg-head:hover { background: #eef4f8; }
.lg-head .lg-day { font-weight: 700; color: #0f3a52; }
.lg-head .lg-sum { color: #5b6b7d; font-size: 12.5px; }
.lg-head .lg-sum b { color: #1b6b8f; }
.lg-head .lg-sum b.in { color: #16a34a; }
.lg-body { display: none; }
.lg.open .lg-body { display: block; }
.lg-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lg-body td { padding: 8px 14px; border-top: 1px solid #f0f4f8; color: #33404f; }
.lg-body td.amt { text-align: right; white-space: nowrap; font-weight: 700; }
.lg-body td.amt.out { color: #1b6b8f; }
.lg-body td.amt.in { color: #16a34a; }
.lg-body td.tm { color: #93a1b0; white-space: nowrap; width: 48px; }
/* 工具名列：这一格是「哪个工具花的」（用户要求），给点分量 */
.lg-body td.use { font-weight: 600; color: #182230; }
.lg-body td.use .sub { font-weight: 400; color: #93a1b0; font-size: 11.5px; margin-left: 6px; }
.lg-body .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
                background: #eef4f8; color: #4a5560; margin-left: 6px; }
.lg-body .tag.bonus { background: #fef3c7; color: #92400e; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 13px; color: #5b6b7d; }
.pager button { background: #fff; border: 1px solid #e5eaf1; border-radius: 8px; padding: 6px 13px;
                font: inherit; font-size: 13px; cursor: pointer; color: #33404f; }
.pager button:disabled { opacity: .45; cursor: default; }
.empty { text-align: center; color: #93a1b0; font-size: 13px; padding: 22px 0; }
.hist-note { font-size: 12px; color: #93a1b0; margin-top: 8px; }

/* 充值套餐卡 */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; }
.pack { position: relative; background: #fff; border: 1.5px solid #e5eaf1; border-radius: 13px;
        padding: 18px 16px; text-align: center;
        transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pack:hover { transform: translateY(-3px); border-color: #1b6b8f; box-shadow: 0 12px 28px rgba(27,107,143,.14); }
.pack .pk-name { font-size: 12px; color: #5b6b7d; }
.pack .pk-yuan { font-size: 25px; font-weight: 800; color: #182230; margin: 5px 0 2px; }
.pack .pk-points { font-size: 12px; color: #9aa9b8; margin-bottom: 13px; }
.pack .pk-points b { color: #1b6b8f; font-weight: 700; }
.pack button { display: block; width: 100%; padding: 9px; border-radius: 8px;
               background: #1b6b8f; color: #fff; border: 1px solid #1b6b8f;
               font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all .16s ease; }
.pack button:hover { background: #0f3a52; border-color: #0f3a52; }

#pay-panel { display: none; background: #fff; border: 2px solid #1b6b8f; border-radius: 13px;
             padding: 24px; margin-top: 22px; text-align: center; }

.note { background: #fff; border: 1px solid #e5eaf1; border-radius: 12px; padding: 16px 18px;
        margin-top: 20px; font-size: 13px; color: #5b6b7d; line-height: 1.8; }
.note b { color: #1b6b8f; }
.note ul { margin: 8px 0 0; padding-left: 19px; }
.note li { margin: 4px 0; }

.back { text-align: center; margin-top: 22px; font-size: 13px; }
.back a { text-decoration: none; margin: 0 8px; }

@media (max-width: 560px) {
  .packs { grid-template-columns: repeat(2, 1fr); }
  .balance .num { font-size: 25px; }
  .chart { height: 92px; }
  .chart-x { font-size: 10px; }
}
