/* ============ QT5 设计系统：深浅双主题 ============ */
:root,
html[data-theme="light"] {
    --bg: #f6f7f9;
    --sidebar: #eff1f4;
    --card: #ffffff;
    --input: #ffffff;
    --sunk: #edf0f4;
    --hover: #e9edf2;
    --border: #e3e7ee;
    --border-mid: #d7dce5;
    --border-hover: #c3cad6;
    --text: #0f172a;
    --text-2: #3d4757;
    --muted: #5b6472;
    --blue: #2563eb;
    --blue-soft: #e4edff;
    --green: #059669;
    --green-soft: #e7f8f1;
    --red: #dc2626;
    --red-soft: #feecec;
    --orange: #d97706;
    --orange-soft: #fff5e6;
    --nav-active: #e4edff;
    --sel: #2563eb;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, .16);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
}

html[data-theme="dark"] {
    --bg: #0e1116;
    --sidebar: #0b0e12;
    --card: #161a20;
    --input: #101318;
    --sunk: #12161b;
    --hover: #1d222a;
    --border: #232833;
    --border-mid: #2e3542;
    --border-hover: #3d4552;
    --text: #e6eaf2;
    --text-2: #c3cad6;
    --muted: #8a94a6;
    --blue: #4c8dff;
    --blue-soft: #16233a;
    --green: #34d399;
    --green-soft: #10281f;
    --red: #f87171;
    --red-soft: #2a1414;
    --orange: #fbbf24;
    --orange-soft: #2b2110;
    --nav-active: #16233a;
    --sel: #1e3a63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 13px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { opacity: .88; }
img { max-width: 100%; display: block; }
code { background: var(--sunk); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1 { font-size: 18px; letter-spacing: -.2px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.center-text { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-ok { color: var(--green); }
.text-danger { color: var(--red); }
.unit { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.container { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.section { padding: 28px 0; }

/* ============ 顶栏 ============ */
.topbar {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--card) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    height: 62px;
    display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, var(--blue), #7c3aed);
    color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 35%, transparent);
}
.brand-text { white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.main-nav a {
    color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
}
.main-nav a:hover { background: var(--hover); color: var(--text); opacity: 1; }
.main-nav a.active { background: var(--nav-active); color: var(--blue); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card); color: var(--text-2); cursor: pointer;
    display: grid; place-items: center;
}
.icon-btn:hover { background: var(--hover); border-color: var(--border-hover); }
html[data-theme="light"] .ico-moon { display: none; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="light"] .ico-sun { display: block; }
html[data-theme="dark"] .ico-moon { display: block; }
.balance-chip {
    display: flex; align-items: baseline; gap: 6px;
    background: var(--sunk); border: 1px solid var(--border);
    padding: 6px 11px; border-radius: 8px; color: var(--text);
}
.balance-chip strong { color: var(--blue); font-size: 13px; }
.balance-label { font-size: 11px; color: var(--muted); }
.user-chip { color: var(--text-2); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 按钮 / 输入 ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 16px; border-radius: 8px;
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13px;
    cursor: pointer; transition: .16s ease; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--card); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--hover); border-color: var(--border-hover); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.btn-sm { height: 31px; padding: 0 12px; font-size: 12px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11px; border-radius: 6px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font: inherit; }
.link-btn.tiny { font-size: 11px; }
.input {
    width: 100%; height: 38px; padding: 0 12px;
    background: var(--input); color: var(--text);
    border: 1px solid var(--border-mid); border-radius: 8px;
    font: inherit; outline: none; transition: .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.7; }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input-sm { height: 32px; font-size: 12px; }
.input-xs { height: 28px; font-size: 12px; padding: 0 8px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.checkbox input, .row-check, .tier input, .pay-type input { width: 15px; height: 15px; accent-color: var(--blue); }
.checkbox-row { display: flex; gap: 20px; flex-wrap: wrap; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.form-actions form { margin: 0; }

/* ============ 卡片 / 通用 ============ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 18px 20px 0; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.inline-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    background: var(--sunk); color: var(--muted); border: 1px solid transparent;
}
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--orange-soft); color: var(--orange); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.muted { background: var(--sunk); color: var(--muted); }
.empty-state {
    background: var(--card); border: 1px dashed var(--border-mid); border-radius: var(--radius);
    padding: 54px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted);
}
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state.large strong { font-size: 44px; letter-spacing: 2px; }
.hint-box { margin-top: 16px; background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.hint-box p { margin: 4px 0; }
.code-block {
    background: var(--sunk); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; white-space: pre-wrap; word-break: break-all; font-size: 12px; line-height: 1.7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 420px; overflow: auto;
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.kv > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.kv dt { font-size: 11px; color: var(--muted); }
.kv dd { margin: 0; font-size: 13px; color: var(--text); word-break: break-all; }

/* ============ 首页 ============ */
.hero { padding: 46px 0 10px; }
.hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--blue); background: var(--blue-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: 30px; line-height: 1.3; letter-spacing: -.6px; margin-bottom: 10px; }
.hero-copy p { color: var(--muted); max-width: 520px; font-size: 14px; }
.hero-stats { display: flex; gap: 28px; margin-top: 24px; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 22px; letter-spacing: -.5px; }
.hero-stats span { font-size: 11px; color: var(--muted); }
.hero-art { position: relative; height: 240px; }
.art-card {
    position: absolute; display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; box-shadow: var(--shadow); min-width: 200px;
}
.art-card strong { display: block; font-size: 13px; }
.art-card small { color: var(--muted); font-size: 11px; }
.art-card-a { top: 10px; left: 8%; }
.art-card-b { top: 92px; right: 0; }
.art-card-c { bottom: 8px; left: 16%; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.blue { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.announcement {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--blue);
    border-radius: var(--radius); padding: 16px 18px; margin-top: 22px; box-shadow: var(--shadow);
}
.announcement-tag { flex: none; font-size: 11px; font-weight: 700; color: var(--blue); background: var(--blue-soft); padding: 3px 9px; border-radius: 999px; }
.announcement-body { color: var(--text-2); font-size: 13px; }
.announcement-body p:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-head p { margin: 2px 0 0; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-input { width: 220px; }
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px; background: var(--card);
    border: 1px solid var(--border); color: var(--text-2); font-size: 12px; font-weight: 500;
}
.cat-pill:hover { border-color: var(--border-hover); opacity: 1; }
.cat-pill.active { background: var(--nav-active); border-color: color-mix(in srgb, var(--blue) 35%, transparent); color: var(--blue); }
.cat-icon { width: 16px; height: 16px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
    transition: .18s ease;
}
.product-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.product-head { display: flex; gap: 12px; align-items: flex-start; }
.product-icon {
    width: 44px; height: 44px; border-radius: 10px; flex: none;
    background: var(--sunk); border: 1px solid var(--border);
    display: grid; place-items: center; color: var(--blue); font-weight: 700; font-size: 16px;
    overflow: hidden;
}
.product-icon.lg { width: 58px; height: 58px; font-size: 20px; border-radius: 12px; }
.product-icon img { width: 100%; height: 100%; object-fit: contain; }
.product-title-wrap { min-width: 0; }
.product-cat { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.product-card h3 { font-size: 14px; line-height: 1.45; margin-top: 2px; }
.product-card h3 a { color: var(--text); }
.product-desc { color: var(--muted); font-size: 12px; min-height: 34px; margin: 0; }
.product-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.price .cur { font-size: 12px; font-weight: 600; margin-right: 2px; color: var(--muted); }
.success-strip { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.strip-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.record-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 20px; }
.record { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.record-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.record-mail { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.record-product { color: var(--muted); font-size: 11px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-time { color: var(--muted); font-size: 11px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.faq-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.faq-card h3 { margin-bottom: 6px; }
.faq-card p { color: var(--muted); font-size: 12px; margin: 0; }

/* ============ 商品详情 ============ */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 350px; gap: 18px; align-items: start; }
.detail-head { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.detail-head h1 { font-size: 21px; margin: 8px 0 4px; }
.detail-meta-top { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-section { padding-top: 18px; }
.detail-section h2 { font-size: 14px; margin-bottom: 10px; }
.rich-text { color: var(--text-2); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.feature-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.feature-list li { margin-bottom: 6px; }
.buy-card { position: sticky; top: 82px; }
.buy-price { font-size: 32px; font-weight: 700; letter-spacing: -1px; color: var(--text); }
.buy-price .cur { font-size: 16px; color: var(--muted); margin-right: 2px; }
.buy-form { margin-top: 14px; }
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 36px; height: 38px; border-radius: 8px; border: 1px solid var(--border-mid); background: var(--card); color: var(--text-2); font-size: 16px; cursor: pointer; }
.qty-btn:hover { background: var(--hover); }
.qty-input { text-align: center; }
.buy-total { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; padding-top: 14px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 12px; }
.buy-total strong { font-size: 20px; color: var(--text); }

/* ============ 认证 / 表单页 ============ */
.auth-wrap { display: grid; place-items: center; padding: 64px 18px; }
.auth-card { width: min(430px, 100%); padding: 28px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card > .muted { margin-bottom: 20px; }
.result-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; }
.result-icon.ok { background: var(--green-soft); color: var(--green); }
.result-icon.warn { background: var(--orange-soft); color: var(--orange); }

/* ============ 会员中心 ============ */
.member-shell { display: grid; grid-template-columns: 232px 1fr; gap: 18px; align-items: start; }
.member-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 12px; }
.member-user { display: flex; align-items: center; gap: 10px; padding: 14px; }
.avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; }
.member-user-meta { min-width: 0; display: flex; flex-direction: column; }
.member-user-meta strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-balance { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.member-balance strong { font-size: 24px; letter-spacing: -.5px; color: var(--blue); }
.member-links { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.member-links a { padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.member-links a:hover { background: var(--hover); opacity: 1; }
.member-links a.active { background: var(--nav-active); color: var(--blue); font-weight: 600; }
.member-main { min-width: 0; }
.filter-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.filter-tab { padding: 8px 14px; color: var(--muted); font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.filter-tab:hover { color: var(--text); opacity: 1; }
.filter-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 14px; margin-bottom: 12px; }
.order-product { font-size: 13px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; display: inline-flex; }
.w-check { width: 38px; }
.w-actions { width: 1%; white-space: nowrap; }

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
    text-align: left; font-weight: 600; color: var(--muted); font-size: 11px;
    background: var(--sunk); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.table.compact td, .table.compact th { padding: 8px 10px; }
.empty-cell { text-align: center; color: var(--muted); padding: 36px 10px !important; }
.cell-title { font-size: 13px; color: var(--text); }
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.page-link { min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); font-size: 12px; background: var(--card); }
.page-link.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.row-details summary { cursor: pointer; color: var(--blue); font-size: 12px; }
.row-details[open] { min-width: 250px; }
.mini-form { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ============ 充值 ============ */
.recharge-card { max-width: 620px; }
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tier, .pay-type { position: relative; display: block; cursor: pointer; }
.tier input, .pay-type input { position: absolute; opacity: 0; pointer-events: none; }
.tier span, .pay-type span {
    display: flex; align-items: center; justify-content: center; height: 44px;
    border: 1px solid var(--border-mid); border-radius: 8px; color: var(--text-2); font-weight: 600; background: var(--card);
}
.tier input:checked + span, .pay-type input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.pay-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.notice-card { border-left: 3px solid var(--orange); }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; }
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.file-icon { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.file-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

/* ============ 工单 ============ */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ticket-msg { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; max-width: 88%; }
.ticket-msg.from-admin { margin-left: auto; border-color: color-mix(in srgb, var(--blue) 30%, transparent); background: color-mix(in srgb, var(--blue-soft) 55%, var(--card)); }
.ticket-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.ticket-msg-body { font-size: 13px; color: var(--text-2); }
.form-card { margin-bottom: 18px; }
.form-card h2 { margin-bottom: 14px; }

/* ============ 状态卡片 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.stat-card strong { font-size: 24px; letter-spacing: -.5px; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-links a { background: var(--sunk); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text-2); font-size: 12px; }
.quick-links a:hover { border-color: var(--blue); color: var(--blue); opacity: 1; }

/* ============ 后台布局 ============ */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 18px; color: var(--text); font-weight: 600; font-size: 14px; }
.admin-brand small { margin-left: auto; font-size: 9px; letter-spacing: 1px; color: var(--muted); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.admin-nav a { padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.admin-nav a:hover { background: var(--hover); opacity: 1; }
.admin-nav a.active { background: var(--nav-active); color: var(--blue); font-weight: 600; }
.nav-group { font-size: 10px; letter-spacing: 1px; color: var(--muted); padding: 14px 10px 4px; text-transform: uppercase; }
.nav-badge { margin-left: auto; background: var(--orange-soft); color: var(--orange); border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; display: flex; justify-content: space-between; border-top: 1px solid var(--border); font-size: 12px; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.admin-topbar h1 { font-size: 16px; }
.admin-content { padding: 22px 24px 40px; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.admin-form .card { padding: 18px; }
.admin-login-body { background: radial-gradient(1000px 500px at 50% -10%, var(--blue-soft), transparent), var(--bg); min-height: 100vh; }
.admin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.admin-login-brand small { display: block; color: var(--muted); font-size: 11px; }

/* ============ 弹窗 ============ */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(8, 11, 16, .55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
    width: min(820px, 100%); max-height: min(86vh, 900px); background: var(--card);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; animation: modalIn .16s ease;
}
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot:empty { display: none; }
.cred-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.cred-label { width: 92px; flex: none; color: var(--muted); font-size: 11px; }
.cred-value { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.modal-section-title { font-size: 12px; color: var(--muted); margin: 14px 0 4px; }
.mailbox-account-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mailbox-account-btn { border: 1px solid var(--border-mid); background: var(--card); color: var(--text-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.mailbox-account-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.mailbox-note { background: var(--sunk); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.mailbox-msg { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.mailbox-msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 4px; }
.mailbox-msg-body { font-size: 12px; color: var(--muted); white-space: pre-wrap; max-height: 180px; overflow: auto; }

/* ============ Toast ============ */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--blue);
    color: var(--text); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 11px 16px; font-size: 12px;
    min-width: 220px; max-width: 360px; animation: toastIn .18s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.danger { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--orange); }
@keyframes toastIn { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ 页脚 ============ */
.footer { border-top: 1px solid var(--border); margin-top: 30px; background: var(--card); }
.footer-inner { width: min(1180px, calc(100% - 36px)); margin: 0 auto; height: 62px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 16px; }

/* ============ 响应式 ============ */
@media (max-width: 1000px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .record-list { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .buy-card { position: static; }
    .member-shell { grid-template-columns: 1fr; }
    .member-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .member-user, .member-balance { flex: 1; min-width: 220px; }
    .member-links { flex-direction: row; flex-wrap: wrap; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid-2 { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .nav-group { display: none; }
    .sidebar-foot { display: none; }
}
@media (max-width: 720px) {
    .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; }
    .topbar-right { margin-left: auto; }
    .user-chip, .balance-label { display: none; }
    .product-grid { grid-template-columns: 1fr; }
    .faq-grid, .record-list, .form-grid, .grid-2, .kv { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .search-form { width: 100%; flex-wrap: wrap; }
    .search-input { flex: 1; width: auto; }
    .hero h1 { font-size: 24px; }
    .hero-stats { gap: 18px; }
    .tier-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
    .admin-topbar { padding: 0 16px; }
    .table { font-size: 11px; }
    .table th, .table td { padding: 8px; }
}
