/* ==========================================================================
   V6 · EDITORIAL ATELIER（编辑感升级）
   设计法则：
   · 60-30-10 色彩：30% 米白纸面 / 60% 深咖（字与版）/ 10% 金（线与强调）
   · 字号大跳跃：封面日号 clamp(56px,8vw,104px) → 标题 → 正文 → 标注 11px
   · 去卡片化：重点区用细金线分区，不用一堆框
   · 单一难忘元素：当日日期版面（每天自动变化）
   ========================================================================== */

:root {
  --gold-line: rgba(180, 154, 112, .42);      /* 主分隔线：金 */
  --gold-soft: rgba(180, 154, 112, .16);
  --paper-tint: #F2EDE4;                        /* 纸面暖调 */
  --ink-70: rgba(23, 20, 18, .70);
}

/* ---------- 纸面：极淡纤维纹理 + 顶部暖光，杜绝纯色死板 ---------- */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 78% -8%, rgba(255, 252, 246, .85) 0%, rgba(255, 252, 246, 0) 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
}
.card { background-color: var(--card); }

/* ---------- 封面版面（单一难忘元素） ---------- */
.hero-edition {
  display: flex; align-items: center; gap: 12px;
  font-size: 10px; letter-spacing: .34em; color: var(--text-3);
}
.he-rule { flex: 1; max-width: 56px; height: 1px; background: var(--gold-line); }

.hero-datecover { display: flex; align-items: flex-end; gap: 18px; margin: 18px 0 4px; }
.hero-day {
  font-family: var(--serif-num);
  font-size: clamp(56px, 8vw, 104px);
  line-height: .82; font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-daterest { padding-bottom: 6px; }
.hero-month {
  font-family: var(--serif-en);
  font-size: clamp(20px, 2.2vw, 30px);
  font-style: italic; font-weight: 400;
  color: var(--accent-deep);
  line-height: 1.1;
}
.hero-year {
  margin-top: 8px; font-size: 12px; letter-spacing: .22em;
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.hero-week {
  margin-top: 4px;
  font-size: 10px; letter-spacing: .38em; color: var(--text-3);
}
.home-hello {
  font-family: var(--serif-cn);
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 400; line-height: 1.25;
  color: var(--ink);
  margin-top: 22px;
  position: relative; padding-left: 18px;
}
.home-hello::before {
  content: ""; position: absolute; left: 0; top: .34em; bottom: .3em;
  width: 2px; background: var(--accent);
}
.hero-tagline {
  margin-top: 10px; padding-left: 18px;
  font-size: 13px; line-height: 1.9; color: var(--text-2);
  letter-spacing: .06em; max-width: 30em;
}

/* 主视觉：细金边框，像装裱起来的照片 */
.hero-frame {
  position: relative; padding: 8px;
  border: 1px solid var(--gold-line);
  background: var(--card);
  box-shadow: 0 18px 40px -28px rgba(23, 20, 18, .5);
}
.hero-frame::after {
  content: ""; position: absolute; inset: 3px;
  border: 1px solid var(--gold-soft); pointer-events: none;
}
.hero-script {
  position: absolute; left: 20px; bottom: 18px;
  font-family: var(--serif-en); font-style: italic;
  font-size: clamp(15px, 1.5vw, 20px); line-height: 1.35;
  color: #FCFAF6; text-shadow: 0 2px 14px rgba(23, 20, 18, .55);
}
.hero-user {
  display: flex; align-items: center; gap: 10px;
  padding-top: 2px; font-size: 12px; letter-spacing: .1em; color: var(--text-2);
}
.hero-user .hu-chev { margin-left: auto; color: var(--text-3); }

/* ---------- 去卡片化：今日工作改为「一张纸 · 四栏」 ---------- */
.today-card { padding-bottom: 18px; }
.today-nums { border-top: 1px solid var(--gold-line); }
.tn-item {
  position: relative;
  padding: 20px 18px 6px;
  border-left: 1px solid var(--line);
}
.tn-item:first-child { border-left: none; padding-left: 0; }
.tn-item + .tn-item::before {
  content: ""; position: absolute; left: 0; top: 20px; width: 26px; height: 1px;
  background: var(--gold-line);
}
.tn-val {
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.tn-lab {
  margin-top: 10px; font-size: 11px; letter-spacing: .2em;
  color: var(--text-3); text-transform: uppercase;
}
.tn-delta { margin-top: 7px; font-size: 11.5px; }

/* ---------- 卡片：去阴影，改金线顶饰 ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: none;
  position: relative;
}
.card-title {
  font-family: var(--serif-cn);
  font-size: 15.5px; font-weight: 400; letter-spacing: .16em;
  color: var(--ink);
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid var(--gold-line);
}
.card-title .more, .card-title .head-date { letter-spacing: .1em; }
.more { color: var(--accent-deep); }
.more:hover { color: var(--accent); }

/* ---------- 页面标题：编号 + 金线 + 大字号 ---------- */
.page-head {
  margin-bottom: 30px; padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 72px; height: 2px; background: var(--ink);
}
.page-title {
  font-family: var(--serif-cn);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 400; line-height: 1.05; letter-spacing: .04em;
  color: var(--ink);
  margin-top: 14px;
}
.page-sub {
  margin-top: 10px; font-size: 11px; letter-spacing: .3em;
  color: var(--text-3); text-transform: uppercase;
}
.hero-eyebrow { color: var(--text-3); letter-spacing: .34em; }
.hero-eyebrow .rule { background: var(--gold-line); }

/* ---------- 侧栏导航：金色定位线 + 墨色块 ---------- */
.side .nav-item {
  position: relative;
  border-radius: 2px;
  transition: background .18s ease, color .18s ease;
}
.side .nav-item::before {
  content: ""; position: absolute; left: -26px; top: 50%;
  width: 2px; height: 0; transform: translateY(-50%);
  background: var(--gold); transition: height .22s ease;
}
.side .nav-item.active {
  background: rgba(242, 237, 228, .07);
  color: var(--cream);
}
.side .nav-item.active::before { height: 20px; }
.side .nav-item:hover { background: rgba(242, 237, 228, .05); }
.side .nav-item .ico { color: rgba(242, 237, 228, .45); }
.side .nav-item.active .ico { color: var(--gold); }
.side-foot .sf-line { color: var(--gold-soft); letter-spacing: .3em; }

/* ---------- 订单列表：杂志式编号 + 细线 + 金线悬停 ---------- */
#orderList { counter-reset: orderno; }
.order-row {
  counter-increment: orderno;
  position: relative;
  border-radius: 2px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  padding: 18px 22px 18px 58px;
}
.order-row:last-child { border-bottom: 1px solid var(--line); }
.order-row::before {
  content: counter(orderno, decimal-leading-zero);
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif-num); font-size: 15px;
  color: var(--text-3); letter-spacing: .04em;
  transition: color .18s ease;
}
.order-row:hover {
  background: rgba(252, 250, 246, .9);
  border-left: 2px solid var(--gold);
  padding-left: 56px;
}
.order-row:hover::before { color: var(--accent-deep); }
.order-row.cancelled { opacity: .5; }
.or-name { font-family: var(--serif-cn); font-size: 16px; font-weight: 400; color: var(--ink); }
.or-amt b { font-size: 15px; color: var(--ink); }
.or-amt b.alert { color: var(--accent-deep); }

/* ---------- 客户列表：同样去掉框，改为分栏行 ---------- */
.cust-list { border: none; background: none; box-shadow: none; }
.cust-row { border-radius: 2px; background: transparent; }
.cust-row:hover { background: rgba(252, 250, 246, .9); border-left: 2px solid var(--gold); }

/* ---------- 强调色纪律：金色只用于线与当前态，陶土棕只用于金额/警示 ---------- */
.tl-time b { color: var(--ink); }
.day-amt { color: var(--ink); }
.month-item .m-val { color: var(--ink); }
.donut-hole b { color: var(--ink); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-primary {
  background: var(--ink); color: var(--cream);
  border: 1px solid var(--ink); border-radius: 2px;
  letter-spacing: .14em;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { border-radius: 2px; border-color: var(--line); }
.btn:focus-visible, .side-btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- 动效编排：更小幅度、更长节奏，像翻页而非弹跳 ---------- */
.page.active > * { animation: rise .42s cubic-bezier(.2, .7, .2, 1) both; }
.page.active > *:nth-child(1) { animation-delay: .04s; }
.page.active > *:nth-child(2) { animation-delay: .09s; }
.page.active > *:nth-child(3) { animation-delay: .14s; }
.page.active > *:nth-child(4) { animation-delay: .19s; }
.page.active > *:nth-child(5) { animation-delay: .24s; }
.page.active > *:nth-child(6) { animation-delay: .29s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 平板：收窄侧栏时金线定位点跟着内缩 ---------- */
@media (min-width: 768px) and (max-width: 1199px) {
  .side .nav-item::before { left: -12px; }
  .hero-day { font-size: clamp(52px, 9vw, 84px); }
  .order-row { padding-left: 48px; }
  .order-row::before { left: 14px; }
  .order-row:hover { padding-left: 46px; }
}

/* ---------- 手机：版面改为上下堆叠 ---------- */
@media (max-width: 767px) {
  body { background-attachment: scroll; }
  .hero-datecover { gap: 12px; margin: 14px 0 2px; }
  .hero-day { font-size: 60px; }
  .hero-month { font-size: 19px; }
  .hero-year { font-size: 11px; letter-spacing: .18em; }
  .home-hello { font-size: 24px; margin-top: 18px; }
  .hero-tagline { font-size: 12.5px; line-height: 1.8; }
  .card { border-radius: 3px; }
  .card-title { font-size: 14.5px; padding-bottom: 10px; margin-bottom: 14px; }
  .page-title { font-size: 30px; }
  .page-head { margin-bottom: 22px; padding-bottom: 16px; }
  .page-head::after { width: 48px; }
  /* 今日工作：2×2，用细线分区而不是四个框 */
  .today-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tn-item { padding: 16px 12px 4px; }
  .tn-item:nth-child(3) { border-left: none; padding-left: 0; }
  .tn-item:nth-child(2n) { border-left: 1px solid var(--line); }
  .tn-item + .tn-item::before { display: none; }
  .tn-item:nth-child(n+3)::after {
    content: ""; position: absolute; left: 0; right: 12px; top: 0; height: 1px;
    background: var(--line);
  }
  .tn-item:nth-child(odd)::after { right: 0; }
  .tn-val { font-size: 32px; }
  .tn-lab { font-size: 10.5px; letter-spacing: .16em; }
  .order-row { padding: 16px 14px 16px 44px; }
  .order-row::before { left: 10px; font-size: 13px; }
  .order-row:hover { padding-left: 42px; }
}

/* ==========================================================================
   V6 修正：主视觉图恢复 / 7天格不折行 / 数字标签不拆字
   ========================================================================== */

/* 原.hero-img 是为「绝对定位叠层」设计的，搬进相框后必须复位 */
.hero-frame { position: relative; overflow: hidden; }
.hero-frame .hero-img {
  position: static; inset: auto;
  display: block; width: 100%; height: auto;
  aspect-ratio: 900 / 225;
  object-fit: cover; object-position: 62% 20%;
}
.hero-frame .hero-script { z-index: 2; bottom: 14px; left: 18px; }

/* 桌面端 7 天格：等宽、不折行、超出省略 */
.up-strip { gap: 6px; }
.up-cell { padding: 12px 6px 10px; border-radius: 2px; }
.up-cell .up-d { font-size: 13px; white-space: nowrap; }
.up-cell .up-w { font-size: 10px; white-space: nowrap; letter-spacing: .06em; }
.up-cell .up-n { font-size: 19px; line-height: 1.2; }
.up-cell .up-t {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 10px; color: var(--text-3); margin-top: 3px;
}

/* 本月经营 / 未来 7 天等数值标签：一律不拆字 */
.m-lab, .month-item .m-val, .fin-lab, .tn-lab, .svc-val, .cal-n { white-space: nowrap; }
.m-lab { font-size: 10.5px; letter-spacing: .12em; }
.month-grid { gap: 0 4px; }


/* ==========================================================================
   以下为「平板与电脑」的版式改造 —— 必须限定断点。
   （教训：非断点限定的规则会压过 style.css 里的手机媒体查询，导致手机端布局错乱）
   ========================================================================== */
@media (min-width: 768px) {

/* ---- 封面：主视觉装裱成相框 + 署名行 ---- */
.hero-visual { display: flex; flex-direction: column; gap: 12px; position: relative; }
.hero-visual::before { display: none; }  /* 旧的暖色渐变层已由金线相框取代 */
/* 署名行：原设计是浮在图上的绝对定位，这里复位为正常流 */
.hero-visual .hero-user {
  position: static; inset: auto; transform: none;
  justify-content: flex-start; gap: 10px;
  padding-top: 10px; margin-top: 2px;
  border-top: 1px solid var(--gold-line);
  color: var(--text-2); font-size: 11.5px; letter-spacing: .12em;
}
.hero-visual .hu-ava {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif-cn); font-size: 13px;
}

/* ==========================================================================
   未来 7 天（桌面）：横向 7 节点时间轴 —— 规范第九条「电脑端可用横向 7 天时间轴」
   ========================================================================== */
  .up-strip { position: relative; gap: 0; padding-top: 26px; }
  .up-strip::before {
    content: ""; position: absolute; left: 6%; right: 6%; top: 12px;
    height: 1px; background: var(--gold-line);
  }
  .up-cell {
    position: relative;
    background: transparent; border: none; border-radius: 0;
    padding: 10px 4px 8px;
  }
  .up-cell::before {
    content: ""; position: absolute; top: -19px; left: 50%;
    width: 7px; height: 7px; margin-left: -3.5px;
    border-radius: 50%; background: var(--paper-2);
    box-shadow: 0 0 0 3px var(--card);
    transition: background .18s ease, transform .18s ease;
  }
  .up-cell.busy::before { background: var(--accent); }
  .up-cell.busy { background: transparent; }
  .up-cell:hover { background: rgba(252, 250, 246, .9); }
  .up-cell:hover::before { transform: scale(1.25); }
  .up-cell .up-d { font-size: 14px; color: var(--ink); }
  .up-cell .up-w { font-size: 9.5px; letter-spacing: .16em; margin-top: 4px; }
  .up-cell .up-n { font-size: 22px; color: var(--ink); margin-top: 6px; }
  .up-cell .up-t { display: none; }
  .up-cell:not(.busy) .up-n { color: var(--text-3); }
}


/* ==========================================================================
   修复：手机端 flex 列布局未 stretch，内容为绝对定位图片的卡片会收缩成窄条
   （.home-grid 是 align-items:start，.brand-card 内只有绝对定位图片 -> fit-content 塌成 111px）
   ========================================================================== */
@media (max-width: 767px) {
  .home-grid { align-items: stretch; }
  .home-grid > * { min-width: 0; }
}


/* ==========================================================================
   V6.1 数据可读性 + 栅格秩序
   ========================================================================== */

/* ---- 趋势图：等比缩放（关键：不能用 preserveAspectRatio="none"，会把文字拉扁） ---- */
/* 宽高比由 viewBox 决定：width:100% + height:auto，图表随卡片等比铺满。
   不要加 max-height —— 那会让内容按 meet 信箱化，宽屏上左右留大片空白。 */
.tc-svg { width: 100%; height: auto; display: block; }
.tc-grid { stroke: var(--line); stroke-width: 1; }
.tc-axis { font-size: 11px; fill: var(--text-3); font-family: var(--serif-num); }
.tc-val { font-size: 12px; fill: var(--text-2); font-family: var(--serif-num); }
.tc-bar { fill: var(--paper-2); transition: fill .18s ease; }
.tc-col.hot .tc-bar { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.tc-hit { fill: transparent; }
.tc-col:hover .tc-bar { fill: var(--gold-soft); }
.tc-col.hot:hover .tc-bar { fill: var(--accent-soft); }
.tc-dot { fill: var(--card); stroke: var(--accent-deep); stroke-width: 2; }
.tc-lbl { font-size: 12px; fill: var(--text-2); }

/* ---- 账务流水：日期分组 + 收支语义色 ---- */
.tx-day {
  display: flex; align-items: baseline; gap: 10px;
  margin: 18px 0 4px; padding-bottom: 7px;
  border-bottom: 1px solid var(--gold-line);
}
.tx-day:first-child { margin-top: 0; }
.tx-day-d { font-family: var(--serif-num); font-size: 17px; color: var(--ink); }
.tx-day-w { font-size: 11px; letter-spacing: .18em; color: var(--text-3); }
.tx-day-n { margin-left: auto; font-size: 11px; color: var(--text-3); }
.tx-item {
  border-bottom: 1px solid var(--line);
  padding: 13px 2px; border-radius: 0; background: none;
}
.tx-item:hover { background: rgba(252, 250, 246, .9); }
.tx-amount { font-size: 21px; }
.tx-amount.in { color: var(--ink); }
.tx-amount.out { color: var(--accent-deep); }   /* 支出：陶土红，与收入明确区分 */
.tx-amount.muted { color: var(--text-3); }      /* 已取消订单的历史收款 */
.tx-sub { font-size: 11px; color: var(--text-3); letter-spacing: .08em; }
.tx-ico { border-radius: 50%; }
.tx-ico.in { background: var(--ink); color: var(--cream); }
.tx-ico.out { background: transparent; color: var(--accent-deep); border: 1px solid var(--gold-line); }

/* ---- 栅格秩序：卡片内距统一为一套刻度 ---- */
.card { padding: 24px 28px 26px; }
.fin-block { padding: 18px 28px; }   /* 账务数字块：唯一例外，密度更高 */
@media (max-width: 767px) {
  .card { padding: 16px 16px 18px; }
  .fin-block { padding: 14px 16px; }
  .tx-item { padding: 12px 0; }
  .tx-amount { font-size: 19px; }
}

/* 洞察区/统计区：卡片按内容高度排列，避免被相邻长卡拉出大片空白 */
.insight-row, .stat-row { align-items: start; }
/* 数据柱稍加深，提升可读性 */
.tc-bar { fill: #E3DACD; }
.tc-col.hot .tc-bar { fill: var(--accent-soft); }
