/* ==========================================================
   报价单前台样式 —— 深酒红主题
   所有颜色/尺寸由后台主题系统注入的 CSS 变量驱动
   ========================================================== */
:root {
    --bg-deep: #4a0f1c;
    --bg-mid: #5c1524;
    --bg-glow: #7a1f31;
    --bg-image: radial-gradient(1200px 600px at 50% -10%, #7a1f31 0%, transparent 60%),
                linear-gradient(180deg, #5c1524 0%, #4a0f1c 40%, #3d0a15 100%);
    --card: rgba(255, 255, 255, .06);
    --card-hi: rgba(255, 255, 255, .12);
    --line: rgba(255, 255, 255, .14);
    --fg: #f4e6e8;
    --fg-dim: #d8b9be;
    --accent: #ffb4a2;
    --accent-2: #ffd9a0;
    --radius: 18px;
    --wrap-max: 900px;
    --prod-pad-y: 20px;
    --prod-pad-x: 18px;
    --prod-gap: 14px;
    --f-prod: 21px;
    --f-cat: 22px;
    --f-pill: 13px;
    --f-pill-v: 15px;
    --shadow-on: box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-deep);
    background-image: var(--bg-image);
    background-attachment: fixed;
    color: var(--fg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg-deep) 84%, transparent);
    background: rgba(0, 0, 0, .28);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
    .topbar { background: color-mix(in srgb, var(--bg-deep) 84%, transparent); }
}
.topbar-in {
    max-width: var(--wrap-max); margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.brand .logo {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; color: var(--bg-deep); font-size: 15px; flex: 0 0 auto;
}
.spacer { flex: 1; }

.icon-btn {
    appearance: none; border: 1px solid var(--line);
    background: var(--card); color: var(--fg);
    border-radius: 12px; padding: 7px 11px;
    font-size: 13px; cursor: pointer; line-height: 1;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .18s, transform .1s;
}
.icon-btn:hover { background: var(--card-hi); }
.icon-btn:active { transform: scale(.96); }
a.icon-btn { text-decoration: none; }

.notice-text { font-size: 12px; color: var(--fg-dim); }

/* 搜索 */
.searchbar { max-width: var(--wrap-max); margin: 10px auto 0; position: relative; }
.searchbar input {
    width: 100%; padding: 10px 14px 10px 36px;
    border-radius: 14px; border: 1px solid var(--line);
    background: rgba(0, 0, 0, .22); color: var(--fg);
    font-size: 14px; outline: none;
}
.searchbar input::placeholder { color: var(--fg-dim); opacity: .65; }
.searchbar input:focus { border-color: var(--accent); }
.searchbar .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .55; font-size: 14px; }

/* ---------- 分类导航 ---------- */
.catnav {
    max-width: var(--wrap-max); margin: 0 auto;
    display: flex; gap: 8px; overflow-x: auto;
    padding: 12px 14px 4px;
    scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav a {
    flex: 0 0 auto;
    padding: 7px 14px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line);
    color: var(--fg-dim); text-decoration: none;
    font-size: 13px; white-space: nowrap;
    transition: all .18s;
}
.catnav a.on, .catnav a:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg-deep); border-color: transparent; font-weight: 600;
}

/* ---------- 主体 ---------- */
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 8px 14px 40px; }

.cat { scroll-margin-top: 118px; margin-top: 26px; }

.cat-head {
    text-align: center; margin-bottom: 18px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.cat-head .ico {
    font-size: 30px; line-height: 1;
    width: 60px; height: 60px; border-radius: 20px;
    display: grid; place-items: center;
    background: var(--card);
    border: 1px solid var(--line);
}
.cat-head h2 { margin: 0; font-size: var(--f-cat); font-weight: 700; letter-spacing: .5px; }
.cat-head .sub { font-size: 12px; color: var(--fg-dim); }

/* 品名卡片 */
.prod {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--prod-pad-y) var(--prod-pad-x);
    margin-bottom: var(--prod-gap);
    box-shadow: var(--shadow-on);
    transition: background .2s, border-color .2s;
}
.prod:hover { background: var(--card-hi); }

.prod-name {
    text-align: center; font-size: var(--f-prod); font-weight: 600;
    margin: 0 0 6px; letter-spacing: .3px;
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.tag {
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 999px; letter-spacing: .5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg-deep);
}
.prod-spec {
    text-align: center; font-size: 13px; color: var(--fg-dim);
    margin: 0 0 14px; line-height: 1.6;
}

/* 规格行 */
.var { padding: 9px 0; border-top: 1px dashed var(--line); }
.var:first-of-type { border-top: none; }
.var-title { font-size: 13px; color: var(--accent-2); margin-bottom: 8px; font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
    display: inline-flex; align-items: baseline; gap: 5px;
    padding: 6px 11px; border-radius: 10px;
    background: rgba(0, 0, 0, .2);
    border: 1px solid var(--line);
    font-size: var(--f-pill); cursor: pointer; user-select: none;
    transition: all .15s;
}
.pill:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.pill .k { color: var(--fg-dim); font-size: 12px; }
.pill .v { color: var(--accent); font-weight: 700; font-size: var(--f-pill-v); letter-spacing: .3px; }
.pill.copied { background: var(--accent); border-color: var(--accent); }
.pill.copied .k, .pill.copied .v { color: var(--bg-deep); }

/* 底部联系方式 */
.foot {
    max-width: var(--wrap-max); margin: 34px auto 0;
    padding: 24px 18px 30px;
    border-top: 1px solid var(--line);
    text-align: center;
}
.foot .row { margin: 5px 0; font-size: 14px; }
.foot .tel { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.foot .qr { margin-top: 14px; }
.foot .qr img { width: 132px; height: 132px; border-radius: 14px; background: #fff; padding: 7px; }
.foot .brand-name { font-size: 17px; font-weight: 600; margin-top: 12px; letter-spacing: 2px; }
.foot .copy { color: var(--fg-dim); font-size: 11px; margin-top: 10px; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--fg-dim); }
.empty .big { font-size: 40px; margin-bottom: 12px; }

/* 悬浮操作条 */
.fabbar {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: 16px; z-index: 60;
    display: flex; gap: 8px;
    background: color-mix(in srgb, var(--bg-deep) 90%, transparent);
    border: 1px solid var(--line);
    border-radius: 999px; padding: 7px 9px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
    max-width: calc(100vw - 24px);
}
.fabbar .icon-btn { border-radius: 999px; }

/* toast */
.toast {
    position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%) translateY(14px);
    background: rgba(0, 0, 0, .82); color: #fff;
    padding: 9px 18px; border-radius: 999px; font-size: 13px;
    opacity: 0; pointer-events: none; transition: all .25s; z-index: 99;
    border: 1px solid var(--line);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 导出遮罩 */
.exporting {
    position: fixed; inset: 0; z-index: 200;
    display: grid; place-items: center; font-size: 14px;
    background: rgba(0, 0, 0, .78); color: #fff;
}

/* ---------- 移动端 ---------- */
@media (max-width: 560px) {
    .prod { border-radius: calc(var(--radius) * .85); }
    .cat-head .ico { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
    .pill { padding: 5px 9px; }
    .brand span.txt { display: none; }
    .notice-text { display: none; }
}

/* ---------- 打印 ---------- */
@media print {
    body { background: #fff !important; color: #111 !important; }
    .topbar, .fabbar, .catnav, .searchbar, .toast, .pill .k { display: none !important; }
    .prod { break-inside: avoid; border: 1px solid #ddd; box-shadow: none !important; background: #fff; }
    .prod-name, .cat-head h2 { color: #111 !important; }
    .pill { border-color: #ccc; background: #fff; }
    .pill .v { color: #c0392b !important; }
    .pill .k { color: #666 !important; }
    .tag { color: #111 !important; background: #eee !important; }
    .foot { color: #111; border-top: 1px solid #ddd; }
    .foot .tel { color: #c0392b !important; }
}