/* ==========================================================================
   甜屿手作 · 奶油焦糖设计系统（浅色）
   暖奶白为底，暖墨为字，焦糖金为饰。宋体标题，克制留白。
   ========================================================================== */

:root {
    /* 纸 —— 由浅到深的面 */
    --bg:        #FBF8F3;
    --surface:   #FFFFFF;
    --surface-2: #F8F4ED;
    --surface-3: #F1EBE1;
    --line:      #EDE6DA;
    --line-2:    #DFD5C6;
    --line-3:    #CBBEA9;

    /* 墨 —— 文字层级（暖调，不用纯黑） */
    --text:   #2C2721;
    --text-2: #6E645A;
    --text-3: #9C9288;

    /* 焦糖金 —— 主色 */
    --brand:      #B8863B;
    --brand-lit:  #D3A257;
    --brand-deep: #8A6224;
    --brand-ink:  #FFFFFF;              /* 金底上的字色 */
    --brand-a08:  rgba(184, 134, 59, .07);
    --brand-a12:  rgba(184, 134, 59, .13);
    --brand-a20:  rgba(184, 134, 59, .26);

    /* 语义色 */
    --jade: #46856A;   /* 已完成 / 已收款 */
    --rose: #C2564A;   /* 待办 / 未收款 */
    --sky:  #4478A6;   /* 信息 / 快递 */
    --plum: #8A6099;   /* 待确认 */

    --jade-a: rgba(70, 133, 106, .11);
    --rose-a: rgba(194, 86, 74, .10);
    --sky-a:  rgba(68, 120, 166, .10);
    --plum-a: rgba(138, 96, 153, .10);

    /* 尺度 */
    --r-sm: 8px;
    --r:    14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --shadow-1: 0 1px 2px rgba(56, 45, 30, .05);
    --shadow-2: 0 2px 4px rgba(56, 45, 30, .04), 0 10px 26px -14px rgba(56, 45, 30, .18);
    --shadow-3: 0 8px 16px rgba(56, 45, 30, .07), 0 28px 60px -20px rgba(56, 45, 30, .28);
    --glow:     0 0 0 1px var(--brand-a20), 0 12px 34px -16px rgba(184, 134, 59, .5);

    --ease: cubic-bezier(.22, 1, .36, 1);
    --dur: .24s;

    --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --font-sans:  -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                  "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
    --font-num:   "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

    --sidebar-w: 224px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: .01em;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 页面底一层极淡的暖光 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(820px 460px at 82% -14%, rgba(211, 162, 87, .13), transparent 64%),
        radial-gradient(620px 380px at 4% 2%,   rgba(198, 168, 140, .10), transparent 62%);
}

/* ── 排版 ────────────────────────────────────────────── */
h1, h2, h3, h4, .serif { font-family: var(--font-serif); font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 26px; line-height: 1.3; }
h2 { font-size: 20px; line-height: 1.35; }
h3 { font-size: 17px; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.muted   { color: var(--text-2); }
.faint   { color: var(--text-3); }
.gold    { color: var(--brand); }
.jade    { color: var(--jade); }
.rose    { color: var(--rose); }
.sky     { color: var(--sky); }
.t-xs { font-size: 11px; } .t-sm { font-size: 13px; } .t-lg { font-size: 17px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 章节小标题：右侧拖一道金线 */
.eyebrow {
    font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
    color: var(--brand); display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--brand-a20), transparent); }

/* ── 布局工具 ─────────────────────────────────────────── */
.row  { display: flex; align-items: center; gap: 10px; }
.row-t{ display: flex; align-items: flex-start; gap: 10px; }
.col  { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.gap-4{gap:4px}.gap-6{gap:6px}.gap-8{gap:8px}.gap-10{gap:10px}.gap-12{gap:12px}.gap-16{gap:16px}.gap-20{gap:20px}
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}
.mt-20{margin-top:20px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.grid { display: grid; gap: 14px; }
.hide { display: none !important; }

/* ── 卡片 ────────────────────────────────────────────── */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    box-shadow: var(--shadow-2);
}
.card.tight { padding: 14px; }
.card.flat  { box-shadow: none; background: var(--surface-2); border-color: var(--line); }
.card.gilt  { border-color: var(--brand-a20); box-shadow: var(--glow); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }

/* ── 按钮 ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 40px; padding: 0 16px;
    font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    cursor: pointer; white-space: nowrap;
    box-shadow: var(--shadow-1);
    transition: all var(--dur) var(--ease);
}
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-deep); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.btn-gold {
    background: linear-gradient(135deg, var(--brand-lit), var(--brand));
    color: var(--brand-ink); border-color: transparent; font-weight: 600;
    box-shadow: 0 2px 8px -2px rgba(184,134,59,.4);
}
.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #DDB06A, var(--brand-lit));
    color: var(--brand-ink); box-shadow: 0 8px 22px -8px rgba(184,134,59,.62);
}
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-a08); }
.btn-danger { color: var(--rose); border-color: rgba(194,86,74,.34); background: transparent; box-shadow: none; }
.btn-danger:hover:not(:disabled) { background: var(--rose-a); border-color: var(--rose); color: var(--rose); }
.btn-jade { color: var(--jade); border-color: rgba(70,133,106,.36); background: var(--jade-a); box-shadow: none; }
.btn-jade:hover:not(:disabled) { background: rgba(70,133,106,.18); border-color: var(--jade); color: var(--jade); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 999px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ── 表单 ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; color: var(--text-2); letter-spacing: .04em; }

.input, .select, .textarea {
    width: 100%;
    font-family: inherit; font-size: 15px; color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    padding: 11px 14px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
    outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-a12);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.select {
    appearance: none; cursor: pointer; padding-right: 36px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236E645A' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.input.sm, .select.sm { padding: 7px 11px; font-size: 13px; border-radius: var(--r-sm); }
.select.sm { padding-right: 30px; background-position: right 10px center; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track {
    width: 42px; height: 24px; border-radius: 999px; background: var(--line-3);
    position: relative; transition: background var(--dur) var(--ease); flex: none;
}
.switch-track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: var(--shadow-1);
    transition: all var(--dur) var(--ease);
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--brand-lit), var(--brand)); }
.switch input:checked + .switch-track::after { left: 21px; }

/* 复选 */
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { display: none; }
.check-box {
    width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-3);
    background: var(--surface);
    display: grid; place-items: center; transition: all var(--dur) var(--ease); flex: none;
}
.check-box::after {
    content: ''; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0); transition: transform var(--dur) var(--ease); margin-top: -3px;
}
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check-box::after { transform: rotate(-45deg) scale(1); }

/* ── 徽章 / 状态点 ────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 10px; border-radius: 999px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2); border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-draft   { background: var(--plum-a); color: var(--plum); }
.badge-pending { background: var(--rose-a); color: var(--rose); }
.badge-made    { background: var(--brand-a12); color: var(--brand-deep); }
.badge-shipped { background: var(--sky-a);  color: var(--sky); }
.badge-done    { background: var(--jade-a); color: var(--jade); }
.badge-cancel  { background: var(--surface-3); color: var(--text-3); }
.badge-paid    { background: var(--jade-a); color: var(--jade); }
.badge-unpaid  { background: var(--rose-a); color: var(--rose); border-color: rgba(194,86,74,.28); }
.badge-gold    { background: var(--brand-a12); color: var(--brand-deep); border-color: var(--brand-a20); }

/* ── 分段控件 ─────────────────────────────────────────── */
.segment {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
    overflow-x: auto; max-width: 100%; scrollbar-width: none;
}
.segment::-webkit-scrollbar { display: none; }
.segment button {
    border: none; background: transparent; color: var(--text-2);
    font-family: inherit; font-size: 13px; padding: 7px 15px; border-radius: 999px;
    cursor: pointer; white-space: nowrap; transition: all var(--dur) var(--ease);
}
.segment button:hover { color: var(--text); }
.segment button.on {
    background: linear-gradient(135deg, var(--brand-lit), var(--brand));
    color: var(--brand-ink); font-weight: 600;
    box-shadow: 0 2px 6px -2px rgba(184,134,59,.45);
}
.segment button .cnt {
    display: inline-block; margin-left: 5px; font-size: 11px; opacity: .78;
    font-family: var(--font-num);
}

/* ── 数据格 ──────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 12px; color: var(--text-2); letter-spacing: .05em; }
.stat-value { font-family: var(--font-num); font-size: 30px; font-weight: 600; line-height: 1.15; }
.stat-value.sm { font-size: 22px; }
.stat-sub { font-size: 11px; color: var(--text-3); }

/* ── 列表行 ──────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 2px; border-bottom: 1px solid var(--line);
    transition: background var(--dur) var(--ease);
}
.list-row:last-child { border-bottom: none; }
.list-row.tap { cursor: pointer; border-radius: var(--r-sm); padding-left: 10px; padding-right: 10px; margin: 0 -10px; }
.list-row.tap:hover { background: var(--surface-2); }

/* 排名条 */
.bar-track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-lit));
    transition: width .5s var(--ease);
}

/* ── 折叠区 ──────────────────────────────────────────── */
.more { border-top: 1px dashed var(--line-2); margin-top: 2px; }
.more-toggle {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
    background: none; border: none; cursor: pointer;
    color: var(--text-3); font-family: inherit; font-size: 13px; padding: 11px 0 9px;
    transition: color var(--dur) var(--ease);
}
.more-toggle:hover { color: var(--brand); }
.more-toggle svg { transition: transform var(--dur) var(--ease); }
.more-toggle svg.up { transform: rotate(180deg); }
.more-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 6px; }

/* ── 空状态 ──────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty .moon { font-size: 40px; margin-bottom: 12px; opacity: .8; }
.empty p { font-size: 14px; }

/* ── 模态框 ──────────────────────────────────────────── */
.mask {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(52, 44, 33, .34); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-xl);
    box-shadow: var(--shadow-3); padding: 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* 头尾固定、中间滚动，内容再长标题和关闭按钮也跑不掉 */
.modal-split { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal-split .modal-head {
    flex: none; margin: 0; padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
}
.modal-split .modal-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 18px 22px;
    overscroll-behavior: contain;
}
.modal-split .modal-foot {
    flex: none; margin: 0; padding: 13px 22px 16px;
    border-top: 1px solid var(--line); background: var(--surface-2);
}

/* ── 吐司 ────────────────────────────────────────────── */
.toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 500;
          display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    padding: 11px 20px; border-radius: 999px; font-size: 14px;
    background: var(--surface); border: 1px solid var(--line-2); color: var(--text);
    box-shadow: var(--shadow-3); max-width: 88vw;
}
.toast.ok   { border-color: rgba(70,133,106,.4); color: #245942; background: #EEF6F1; }
.toast.err  { border-color: rgba(194,86,74,.42); color: #8E2E22; background: #FBEEEC; }

/* ── 动画 ────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.anim-rise { animation: rise .36s var(--ease) both; }
.anim-pop  { animation: pop .28s var(--ease) both; }
.anim-fade { animation: fade .28s var(--ease) both; }
.v-enter-active, .v-leave-active { transition: opacity .2s var(--ease), transform .2s var(--ease); }
.v-enter-from, .v-leave-to { opacity: 0; transform: translateY(6px); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
