:root {
    --brand: #ff6a00;
    --brand-deep: #e05a00;
    --brand-dark: #b34700;
    --brand-soft: #fff3ea;
    --brand-border: #ffd7bb;
    --ink: #1f2329;
    --ink-2: #4a5058;
    --muted: #8a9099;
    --line: #e8eaed;
    --bg: #f5f6f7;
    --white: #fff;
    --ok: #1f9d55;
    --danger: #d93025;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(31, 35, 41, .07);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(1320px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 62px;
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark {
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 18px;
}
.brand-text { font-size: 20px; font-weight: 800; color: var(--brand-deep); letter-spacing: 2px; }
.main-nav { display: flex; gap: 15px; color: var(--ink-2); white-space: nowrap; font-size: 14px; }
.main-nav a { padding: 5px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.is-active { color: var(--brand-deep); border-color: var(--brand); }
.nav-mobile-only { display: none; }
.nav-sep { width: 1px; height: 16px; background: var(--line, #e5e7eb); align-self: center; }
.header-search { display: none; flex: 1 1 260px; align-items: center; min-width: 180px; max-width: 460px; margin-left: auto; background: #f2f3f5; border-radius: 999px; padding: 2px 4px 2px 8px; }
.header-search input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 7px 8px;
    outline: none;
    min-width: 0;
    font-size: 14px;
}
.header-search .header-search-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.header-search .header-search-submit:hover { background: var(--brand-deep); }
.header-cart-icon {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--ink);
    text-decoration: none;
}
.header-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}
.header-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; white-space: nowrap; margin-left: auto; }
.header-actions a:hover { color: var(--brand-deep); }
.cart-link { position: relative; }
.cart-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--brand);
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    padding: 0 5px;
    margin-left: 3px;
}
.inline-form { display: inline; }
.link-button { background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 0; }
.link-button:hover { color: var(--brand-deep); }

/* ---------- Buttons / alerts ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    line-height: 1.3;
}
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 34px; font-size: 17px; }
.btn-ghost { background: #fff; color: var(--brand-deep); border-color: var(--brand-border); }
.btn-ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c4c0; }
.btn-danger:hover { background: #fff5f4; border-color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

.alert {
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 14px;
}
.alert-success { background: #eef9f1; color: #176b3a; border-color: #c5e9d2; }
.alert-error { background: #fff3f2; color: #a52118; border-color: #f5c8c3; }
.alert-warning { background: #fff8e6; color: #8a5a00; border-color: #f2ddb0; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-border); }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 106, 0, .22), transparent 38%),
        linear-gradient(130deg, #1f2329 0%, #2d3036 55%, #3a2a1d 100%);
    color: #fff;
    padding: 94px 0 92px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "1688";
    position: absolute;
    right: 4%;
    bottom: -46px;
    font-size: 210px;
    font-weight: 900;
    color: rgba(255, 255, 255, .035);
    letter-spacing: -8px;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero-tag {
    display: inline-block;
    background: rgba(255, 106, 0, .16);
    border: 1px solid rgba(255, 106, 0, .45);
    color: #ffb27a;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 1px;
}
.hero h1 { font-size: 40px; line-height: 1.22; margin: 12px 0 30px; letter-spacing: .5px; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p { color: #c8ccd2; font-size: 16px; margin: 0 0 26px; }
.hero-search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 1060px;
    align-items: stretch;
    position: relative;
}
.hero-search {
    display: flex;
    max-width: none;
    min-width: 0;
    border: 2px solid rgba(255, 255, 255, .78);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .5), 0 0 0 4px rgba(255, 106, 0, .16);
}
.hero-search input {
    flex: 1;
    border: 0;
    border-radius: 0;
    padding: 18px 22px;
    outline: none;
    min-width: 0;
    background: transparent;
    color: #fff;
    font-size: 17px;
}
.hero-search input::placeholder { color: rgba(255, 255, 255, .6); }
.hero-search button {
    border: 0;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    padding: 0 36px;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
}
.hero-search button:hover { background: var(--brand-deep); }

/* ---------- Reviews marquee ---------- */
.reviews-section { padding: 20px 0 0; overflow: hidden; }
.reviews-track { display: flex; gap: 14px; width: max-content; animation: reviews-scroll 30s linear infinite; }
.reviews-track:hover { animation-play-state: paused; }
.reviews-track.is-static { animation: none; }
.review-card {
    flex: 0 0 auto;
    width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow);
}
.review-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #ff9a4d, var(--brand));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; flex: 0 0 auto; overflow: hidden;
}
.review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-name { font-weight: 700; font-size: 14px; }
.review-date { color: var(--muted); font-size: 11px; margin-top: 1px; }
.review-text {
    font-size: 13px; color: var(--ink-2); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@keyframes reviews-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (max-width: 820px) {
    .review-card { width: 165px; }
}
.hero-points { display: flex; gap: 26px; margin-top: 50px; flex-wrap: wrap; color: #d9dde2; font-size: 14px; }
.hero-points span::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 7px; }

/* ---------- Sections ---------- */
.section { padding: 36px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: .3px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel-pad { padding: 24px; }
.panel-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-head h3 { margin: 0; font-size: 17px; }
.chips {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 3px;
    scrollbar-width: thin;
}
.chip {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    color: var(--ink-2);
    flex: 0 0 auto;
    white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* 首頁本週精選：5 排、圖片小一些 */
.product-grid-five { grid-template-columns: repeat(5, 1fr); gap: 14px; }
.product-grid-five .product-thumb { aspect-ratio: 1 / 1; }
.product-grid-five .product-title { font-size: 13px; }
.product-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: .18s;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(31, 35, 41, .10); border-color: var(--brand-border); }
.product-thumb { display: block; aspect-ratio: 4 / 3; background: var(--brand-soft); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.product-body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.product-shop { font-size: 12px; color: var(--muted); margin: -5px 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-title {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 45px;
}
.product-meta { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price-twd { color: var(--brand-deep); font-size: 22px; font-weight: 800; line-height: 1.1; }
.price-twd small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.price-line { display: flex; align-items: baseline; gap: 8px; }
.price-cny { color: #9aa0a6; font-size: 12px; }
.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.6;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand-border);
}
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.step {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px 16px;
    position: relative;
}
.step-no {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; margin-bottom: 10px;
}
.step h4 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Solutions ---------- */
.solution-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.solution-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 30px 22px;
    text-align: center;
    display: block;
    transition: .18s;
}
.solution-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(31, 35, 41, .10); border-color: var(--brand-border); }
.solution-icon { font-size: 36px; line-height: 1; display: block; margin-bottom: 14px; }
.solution-card h4 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.solution-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.form-row label .req { color: var(--brand); }
.input, .select, .textarea {
    width: 100%;
    border: 1px solid #dcdfe3;
    border-radius: 9px;
    padding: 10px 13px;
    outline: none;
    background: #fff;
    transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 106, 0, .12); }
.textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.input-qty { width: 78px; text-align: center; padding: 6px; border: 1px solid #dcdfe3; border-radius: 7px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { background: #fafbfc; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .4px; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .thumb { width: 62px; height: 62px; border-radius: 9px; object-fit: cover; background: var(--brand-soft); border: 1px solid var(--line); }
.table .prod-cell { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.table .prod-cell .t { font-weight: 600; line-height: 1.45; }
.table .prod-cell .s { font-size: 12px; color: var(--muted); }

/* ---------- Cart / checkout ---------- */
.page-head { padding: 22px 0 14px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: .3px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.value-note { max-width: 760px; margin-top: 8px !important; }
.cart-layout { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
.cart-layout > * { min-width: 0; }
.summary { position: sticky; top: 92px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; color: var(--ink-2); }
.summary-row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 14px; font-size: 16px; color: var(--ink); font-weight: 700; }
.summary-total { color: var(--brand-deep); font-size: 26px; font-weight: 800; line-height: 1.1; }
.notice { background: var(--brand-soft); border: 1px solid var(--brand-border); color: var(--brand-dark); padding: 12px 14px; border-radius: 9px; font-size: 13px; }
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Order ---------- */
.status { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-block; }
.status-warn { background: #fff3e8; color: #b25a00; }
.status-info { background: #eaf3ff; color: #1b5fa8; }
.status-ok { background: #eaf8ef; color: #176b3a; }
.status-danger { background: #fff0ef; color: #a52118; }
.status-muted { background: #f0f1f3; color: #666d75; }
.order-card { padding: 20px 22px; margin-bottom: 16px; }
.order-card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 13px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.order-no { font-weight: 800; letter-spacing: .4px; }
.order-items-mini { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.order-items-mini img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); position: absolute; left: -6px; top: 7px; }
.timeline .time { font-size: 12px; color: var(--muted); }
.timeline .what { font-weight: 600; }
.address-box { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 14px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 72px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 34px 30px; }
.auth-card h1 { margin: 0 0 6px; font-size: 25px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }
.auth-foot a { color: var(--brand-deep); font-weight: 700; }
.forgot-matches { margin-top: 18px; margin-bottom: 8px; }
.forgot-matches h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.forgot-account { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 14px; background: #fafbfc; }
.forgot-account-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; word-break: break-all; margin-bottom: 10px; }
.forgot-email { font-size: 14px; }
.send-status { display: block; margin-top: 8px; min-height: 18px; line-height: 1.6; }
.forgot-sms-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: 28px; padding: 14px 2px; border: none; border-top: 1px solid var(--line); background: none; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.forgot-sms-toggle:hover { color: var(--brand-deep); }
.forgot-chev { transition: transform .2s; font-size: 12px; }
.forgot-sms-toggle[aria-expanded="true"] .forgot-chev { transform: rotate(180deg); }
.login-card { width: min(760px, 100%); }
.login-split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 8px; }
.login-scan { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px; border-right: 1px solid var(--line); }
.login-scan-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.login-qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 10px; }
.login-scan-note { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-form-full { grid-column: 1 / -1; }
@media (max-width: 820px) {
    .login-card { width: min(440px, 100%); }
    .login-split { grid-template-columns: 1fr; gap: 0; }
    .login-scan { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 6px; }
    .login-qr { width: 150px; height: 150px; }
    .login-qr-desktop { display: none; }
}
.auth-links { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 13px; }
.auth-links a { color: var(--muted); }
.auth-links a:hover { color: var(--brand-deep); }

/* ---------- Footer ---------- */
.site-footer { background: #23262b; color: #aeb3ba; margin-top: 40px; padding: 34px 0 28px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 14px; }
.site-footer a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 22px; padding-top: 16px; color: #7c828a; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-balance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 820px) { .account-balance-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Product detail ---------- */
.detail-layout { display: grid; grid-template-columns: 460px 1fr; gap: 36px; padding: 30px 0; align-items: start; }
.detail-image { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--brand-soft); }
.detail-image img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.product-detail-images { display: flex; flex-direction: column; gap: 0; padding: 4px; }
.product-detail-images img { width: 100%; height: auto; display: block; border-radius: 6px; }
.spec-table { display: flex; flex-direction: column; padding: 4px; }
.spec-row { display: flex; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line, #e5e7eb); font-size: 13px; }
.spec-row:last-child { border-bottom: 0; }
.spec-key { flex: 0 0 120px; color: var(--muted, #8a919c); }
.spec-val { flex: 1 1 auto; color: var(--ink, #1f2329); white-space: pre-wrap; word-break: break-word; }
.detail-info h1 { margin: 6px 0 14px; font-size: 26px; line-height: 1.4; }
.detail-price-box { background: linear-gradient(120deg, var(--brand-soft), #fff); border: 1px solid var(--brand-border); border-radius: 12px; padding: 16px 18px; margin: 16px 0; }
.detail-price-box .label { font-size: 13px; color: var(--brand-dark); }
.detail-price-box .big { font-size: 34px; font-weight: 900; color: var(--brand-deep); line-height: 1.2; }
.detail-price-box .cny { color: var(--muted); font-size: 13px; }
.spec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spec-head label { margin-bottom: 6px; }
.spec-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.spec-option { position: relative; min-width: 0; }
.spec-option input { position: absolute; opacity: 0; pointer-events: none; }
.spec-card {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #dcdfe3;
    border-radius: 10px;
    padding: 7px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    min-width: 0;
}
.spec-card-thumb {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 7px;
    overflow: hidden;
    background: #f5f6f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spec-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.spec-card-noimg { font-size: 11px; font-weight: 800; color: var(--muted); }
.spec-card-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.spec-card-name { line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spec-card-price { color: var(--brand-deep); font-weight: 800; }
.spec-card-stock { color: var(--muted); font-size: 11px; }
.spec-card-stock.is-out { color: #a56700; }
.spec-option input:checked + .spec-card { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(255, 106, 0, .12); }
.qty-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.qty-stepper { display: flex; align-items: center; border: 1px solid #dcdfe3; border-radius: 9px; overflow: hidden; }
.qty-stepper button { width: 36px; height: 38px; border: 0; background: #fafbfc; cursor: pointer; font-size: 18px; }
.qty-stepper input { width: 62px; height: 38px; border: 0; text-align: center; outline: none; }
.feature-list { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 8px; }

/* ---------- Product detail gallery / buy terms ---------- */
.detail-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.detail-thumb {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    padding: 0;
    aspect-ratio: 1 / 1;
    transition: border-color .15s, box-shadow .15s;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-thumb:hover { border-color: var(--brand); }
.detail-thumb.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-border); }

.buy-terms {
    background: #fffdf8;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.7;
    margin-top: 18px;
}
.buy-terms p { margin: 0 0 8px; }
.buy-terms p:last-of-type { margin-bottom: 10px; }
.agree-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}
.agree-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.buy-terms.has-error { border-color: #ff4d4f; }
.buy-terms-error { color: #ff4d4f; font-size: 13px; font-weight: 700; margin-top: 8px; }

.header-scan-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    padding: 0;
}
.header-scan-btn:hover { color: var(--brand-deep); }
.scan-menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    display: none;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .18);
}
.scan-menu.is-open { display: flex; }
.scan-menu-item {
    border: 0;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    padding: 15px 14px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
}
.scan-menu-item:hover { background: var(--brand-soft); color: var(--brand-deep); }
.scan-menu-cancel { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; }

.float-cart {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    z-index: 40;
    text-decoration: none;
}
.float-cart:hover { background: var(--brand-deep); color: #fff; }
.float-cart-icon { display: flex; align-items: center; justify-content: center; }
.float-cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 11px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ---------- Admin ---------- */
.admin-body {
    --ab-bg: #f2f3f5;
    --ab-fg: #1f2329;
    --ab-panel: #ffffff;
    --ab-border: #e8eaef;
    --ab-muted: #7a8087;
    --ab-top: #ffffff;
    --ab-input: #ffffff;
    --ab-th: #f8f9fa;
    --ab-side-bg: #f4f5f7;
    --ab-side-fg: #4b5563;
    --ab-side-strong: #1f2329;
    --ab-side-hover: rgba(0,0,0,.05);
    --ab-side-active: rgba(0,0,0,.08);
    --ab-side-line: rgba(0,0,0,.08);
    --ab-side-title: #7a8087;
    background: var(--ab-bg);
    color: var(--ab-fg);
}
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: var(--ab-side-bg); color: var(--ab-side-fg); padding: 20px 14px; }
.admin-brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 20px; color: var(--ab-side-strong); }
.admin-brand .brand-mark { background: var(--brand); }
.admin-nav a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px 9px 26px; border-radius: 8px; margin-bottom: 2px; font-size: 13px;
}
.admin-nav a:hover { background: var(--ab-side-hover); color: var(--ab-side-strong); }
.admin-nav a.is-active { background: var(--ab-side-active); color: var(--ab-side-strong); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.nav-group { position: relative; margin-bottom: 6px; }
.nav-group-title {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 10px 12px 10px 15px; border: 0; border-radius: 8px; background: transparent;
    color: var(--ab-side-title); font-size: 12px; font-weight: 700; letter-spacing: .5px; cursor: pointer; text-align: left;
}
.nav-group-title::after { content: "▾"; transition: transform .2s; opacity: .7; }
.nav-group-title::before {
    content: ""; position: absolute; left: 8px; top: 50%; width: 3px; height: 12px;
    margin-top: -6px; border-radius: 2px; background: var(--ab-side-line);
}
.nav-group:not(.is-collapsed) .nav-group-title { color: var(--ab-side-strong); background: var(--ab-side-active); }
.nav-group:not(.is-collapsed) .nav-group-title::before { background: var(--brand); }
.nav-group.is-collapsed .nav-group-title::after { transform: rotate(-90deg); }
.nav-group-body {
    padding: 2px 0 4px 14px;
}
.nav-group.is-collapsed .nav-group-body { display: none; }
.nav-overview {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 8px;
    color: var(--ab-side-fg); font-size: 13px; font-weight: 700; text-decoration: none;
}
.nav-overview:hover { background: var(--ab-side-hover); color: var(--ab-side-strong); }
.nav-overview.is-active { background: var(--ab-side-active); color: var(--ab-side-strong); box-shadow: inset 3px 0 0 var(--brand); }
.nav-front { margin-top: 10px; border-top: 1px solid var(--ab-side-line); padding-top: 12px; }
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
}
.admin-main { min-width: 0; }
.admin-top {
    height: 64px; background: var(--ab-top); border-bottom: 1px solid var(--ab-border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
}
.admin-top h1 { font-size: 17px; margin: 0; color: var(--ab-fg); }
.admin-top .who { font-size: 13px; color: var(--ab-muted); display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 24px 26px 40px; color: var(--ab-fg); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--ab-panel); border: 1px solid var(--ab-border); border-radius: 12px; padding: 18px 20px; }
.stat-card .k { font-size: 13px; color: var(--ab-muted); }
.stat-card .v { font-size: 27px; font-weight: 800; margin-top: 4px; color: var(--ab-fg); }
.stat-card .v.brand { color: var(--brand-deep); }
.admin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.admin-card { background: var(--ab-panel); border: 1px solid var(--ab-border); border-radius: 12px; overflow: hidden; }
.admin-card-head { padding: 15px 18px; border-bottom: 1px solid var(--ab-border); display: flex; justify-content: space-between; align-items: center; }
.admin-card-head h3 { margin: 0; font-size: 15px; color: var(--ab-fg); }
.admin-card-body { padding: 18px; color: var(--ab-fg); }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.status-list li:last-child { border-bottom: 0; }
.status-list .n { font-weight: 800; }
.admin-filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.admin-filters .input, .admin-filters .select { width: auto; min-width: 160px; }
.login-admin { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2329, #3a2a1d); padding: 30px 20px; }
.login-admin .auth-card { border: 0; }
.admin-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; background: #f6f7f9; border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; font-size: 12px; }

/* ---------- 後台：狀態籤 / 分頁 / 手風琴列表 ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.admin-tab {
    display: inline-flex; align-items: center; padding: 8px 16px;
    border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
    color: var(--ink-2); background: #fff; text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
}
.admin-tab:hover { border-color: var(--brand); color: var(--brand-deep); }
.admin-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.admin-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.admin-pagination-info { color: var(--muted); font-size: 13px; }
.admin-pagination .pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.admin-pagination .pagination li a,
.admin-pagination .pagination li span {
    display: inline-flex; min-width: 34px; height: 34px; padding: 0 10px;
    align-items: center; justify-content: center; border: 1px solid var(--line);
    border-radius: 8px; font-size: 13px; color: var(--ink-2); text-decoration: none; background: #fff;
}
.admin-pagination .pagination li a:hover { border-color: var(--brand); color: var(--brand-deep); }
.admin-pagination .pagination li.active span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.admin-pagination .pagination li.disabled span { color: #b8bec3; background: #fafbfc; cursor: not-allowed; }

.purchase-list { border-radius: inherit; }
.purchase-row { border-bottom: 1px solid var(--line); }
.purchase-row:last-child { border-bottom: 0; }
.purchase-row-head {
    width: 100%; display: grid; grid-template-columns: 1.3fr auto 1fr auto auto 18px;
    gap: 12px; align-items: center; padding: 13px 18px; border: 0;
    background: transparent; text-align: left; cursor: pointer; font-size: 14px; color: var(--ink);
}
.purchase-row-head:hover { background: #fafbfc; }
.purchase-order { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }
.purchase-user { color: var(--muted); }
.purchase-amount { font-weight: 700; }
.purchase-time { color: var(--muted); font-size: 12px; }
.purchase-caret { color: var(--muted); transition: transform .2s; }
.purchase-row.is-open .purchase-caret { transform: rotate(180deg); }
.purchase-row-body { display: none; padding: 4px 18px 18px; }
.purchase-row.is-open .purchase-row-body { display: block; }

.table-compact th, .table-compact td { padding: 9px 12px; }
.input-xs { padding: 5px 8px; font-size: 12px; min-height: 30px; }
.btn-xs { padding: 5px 10px; font-size: 12px; }
.bank-review-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- 前台：找回密碼分隔線 / 簡訊行 ---------- */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sms-row { display: flex; gap: 8px; }
.sms-row .input { flex: 1; }
.sms-row .btn { white-space: nowrap; }

.calc-result { background: #fff; border: 1px dashed var(--brand-border); border-radius: 12px; padding: 18px 20px; }
.calc-result .label { color: var(--muted); font-size: 13px; }
.calc-result .amount { color: var(--brand-deep); font-size: 36px; font-weight: 900; line-height: 1.25; }
.calc-result .hint { color: var(--muted); font-size: 12px; }
.breadcrumb { font-size: 13px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--brand-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .detail-layout { grid-template-columns: 360px 1fr; gap: 24px; }
    .cart-layout { grid-template-columns: 1fr 300px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 12px; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; gap: 16px; }
    .header-search { order: 2; flex-basis: 100%; }
    .header-actions { margin-left: auto; }
    .hero h1 { font-size: 30px; }
    .hero { padding: 38px 0; }
    .product-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
    .detail-layout { grid-template-columns: 1fr; }
    .cart-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding: 12px; }
    .admin-brand { padding: 0 8px 0 0; white-space: nowrap; }
    .admin-nav { display: flex; gap: 6px; }
    .admin-nav a { white-space: nowrap; margin: 0; padding: 7px 11px; }
    .admin-content { padding: 16px; }
    .table .prod-cell { min-width: 200px; }
}

/* ---------- 性价比 / 下单需求 ---------- */
.product-thumb { position: relative; }
.thumb-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    background: var(--brand-deep);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(31, 35, 41, .18);
}
.product-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}
.detail-signals { margin: 8px 0 6px; font-size: 13px; }
.detail-signals a { color: var(--brand-deep); font-weight: 700; }
.pill-best { background: var(--brand); color: #fff; }
.pill-soft { background: #fff4e8; color: var(--brand-dark); border: 1px solid var(--brand-border); }
.value-badge {
    display: inline-block;
    background: #f6f7f9;
    border: 1px solid var(--line);
    color: var(--ink-2);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
}
.value-badge.is-best { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-dark); font-weight: 800; }
.sourcing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.admin-inline-form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.admin-inline-form .input, .admin-inline-form .select { padding: 7px 9px; font-size: 13px; }

/* ---------- 客服中心 ---------- */
.support-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(255, 106, 0, .35);
    transition: opacity .15s, transform .15s, background .15s;
}
.support-fab:hover { background: var(--brand-deep); color: #fff; }
.support-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
.support-fab-badge[hidden] { display: none; }
.support-widget.is-panel-open .support-fab { opacity: .25; pointer-events: none; transform: scale(.9); }

/* ---------- 後台浮動客服圖標 ---------- */
.admin-support-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(255, 106, 0, .35);
    transition: transform .15s, background .15s;
}
.admin-support-fab:hover { background: var(--brand-deep); color: #fff; transform: translateY(-2px); }
.admin-support-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px #12141a;
}
.admin-support-badge[hidden] { display: none; }

/* ---------- 匯出行憑證彈窗 ---------- */
.credential-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.credential-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.62); }
.credential-modal-box { position: relative; max-width: 92vw; max-height: 90vh; }
.credential-modal-box img { display: block; max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.credential-modal-close { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #333; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }

/* ---------- 後台客服工作台（照舊站：左客戶名單 + 右對話） ---------- */
.admin-chat-workbench { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-chat-list { background: #1f232b; border: 1px solid #2a2f3a; border-radius: 12px; overflow: hidden; }
.admin-chat-list-head { padding: 13px 15px; border-bottom: 1px solid #2a2f3a; font-weight: 700; color: #fff; }
.admin-chat-list-body { max-height: 640px; overflow-y: auto; }
.admin-chat-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #2a2f3a; background: transparent; color: #d5dae0; padding: 12px 15px; cursor: pointer; }
.admin-chat-item:hover { background: rgba(255,255,255,.05); }
.admin-chat-item.is-active { background: var(--brand); color: #fff; }
.admin-chat-item.is-active .admin-chat-item-sub, .admin-chat-item.is-active .admin-chat-item-msg { color: rgba(255,255,255,.85); }
.admin-chat-ava { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #ff9a4d, #ff6a00); color: #fff; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.admin-chat-item-body { flex: 1 1 auto; min-width: 0; }
.admin-chat-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-chat-item-sub { color: #9aa1ab; font-size: 12px; margin-top: 3px; }
.admin-chat-item-msg { color: #b8bec8; font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-chat-badge { background: #ff3b30; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; font-weight: 800; padding: 0 5px; }
.admin-chat-panel { background: #1f232b; border: 1px solid #2a2f3a; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.admin-chat-panel-head { padding: 13px 15px; border-bottom: 1px solid #2a2f3a; display: flex; align-items: baseline; gap: 10px; }
.admin-chat-panel-head strong { color: #fff; }
.admin-chat-messages { flex: 1; min-height: 380px; max-height: 560px; overflow-y: auto; }
@media (max-width: 980px) {
    .admin-chat-workbench { grid-template-columns: 1fr; }
    .admin-chat-list-body { max-height: 300px; }
}
/* 工作台對話氣泡在深色後台下的配色（用高優先級覆蓋前台淺色樣式） */
.admin-chat-workbench .support-messages { background: transparent; }
.admin-chat-workbench .support-msg .bubble { background: #2a2f3a; border-color: #3a4150; color: #d5dae0; }
.admin-chat-workbench .support-msg.is-user .bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.admin-chat-workbench .support-msg.is-bot .bubble { background: #24332a; border-color: #33503d; color: #cfe8d8; }
.admin-chat-workbench .support-msg .meta { color: #9aa1ab; }
.admin-chat-workbench .support-welcome { background: #2a2f3a; border-color: #3a4150; color: #b8bec8; }
.admin-chat-panel .support-form { border-top-color: #2a2f3a; }
.admin-chat-panel .support-form textarea { background: #2a2f3a; border-color: #3a4150; color: #d5dae0; }
.admin-chat-panel .support-tool-btn { background: #2a2f3a; border-color: #3a4150; color: #d5dae0; }
.support-widget-panel {
    position: fixed;
    right: 22px;
    bottom: 90px;
    z-index: 80;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 112px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(31, 35, 41, .24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.98);
    transform-origin: right bottom;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.support-widget-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.support-widget-panel.is-fullscreen {
    inset: 14px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 14px;
    transform-origin: center;
}
.support-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
    color: #fff;
    flex: 0 0 auto;
}
.support-widget-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-widget-title strong { font-size: 15px; }
.support-widget-title span { color: rgba(255, 255, 255, .78); font-size: 11px; }
.support-widget-tools { display: flex; align-items: center; gap: 4px; }
.support-widget-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}
.support-widget-icon:hover { background: rgba(255, 255, 255, .24); }
.support-widget-fullscreen-label { font-size: 11px; }
.support-widget-messages {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    overscroll-behavior: contain;
}
.support-widget-guest {
    background: #fff;
    border: 1px dashed var(--brand-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--ink-2);
    line-height: 1.65;
}
.support-widget-guest p { margin: 7px 0 14px; color: var(--muted); font-size: 13px; }
.support-widget-guest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.support-widget-form { padding: 10px 12px 12px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.support-widget-form textarea { min-height: 58px; max-height: 120px; font-size: 13px; }
.support-widget-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.support-widget-form-foot .small { font-size: 10px; line-height: 1.3; }
.support-widget-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
    color: var(--muted);
    font-size: 11px;
    flex: 0 0 auto;
}
.support-widget-foot a { color: var(--brand-deep); }
.support-widget-notice {
    background: #fff3f2;
    border: 1px solid #f5c8c3;
    color: #a52118;
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 12px;
    line-height: 1.5;
}
.mobile-tabbar { display: none; }
.support-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.support-chat-panel { display: flex; flex-direction: column; min-height: 560px; }
.support-messages {
    height: 430px;
    overflow-y: auto;
    padding: 18px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.support-welcome {
    background: #fff;
    border: 1px dashed var(--brand-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.7;
}
.support-msg { max-width: 62%; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.support-msg.is-user { align-self: flex-end; align-items: flex-end; }
.support-msg.is-admin { align-self: flex-start; align-items: flex-start; }
.support-msg .bubble {
    width: fit-content;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}
.support-msg.is-user .bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.support-msg.is-bot { align-self: flex-start; align-items: flex-start; }
.support-msg.is-bot .bubble { background: linear-gradient(135deg, #f3fbf6, #eef7ff); border-color: #cfe7d8; }
.support-msg.is-bot .meta { color: #3f7a58; }
.support-msg .meta { color: var(--muted); font-size: 11px; }
.support-bot-status { margin: 0 18px; padding: 9px 12px; border-radius: 8px; background: #fff7e8; color: #9a6418; font-size: 12px; }
.support-quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 4px; }
.support-quick button { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.support-quick button:hover { border-color: var(--brand); color: var(--brand); }
.support-form { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.support-form textarea { min-height: 72px; }
.support-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.admin-support-messages { height: 420px; border: 1px solid var(--line); border-radius: 10px; margin: 0 18px; }
.admin-chat-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-chat-toolbar .status { margin-right: 8px; }
.support-side { position: sticky; top: 82px; }

/* ---------- 客服聊天增強：圖片 / 表情 / 正在輸入 ---------- */
.support-msg .bubble .support-img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin: 0 0 6px; object-fit: cover; }
.support-msg .bubble span { white-space: pre-wrap; word-break: break-word; }
.support-msg .bubble .support-opt-btn { display: block; border: 1px solid var(--brand-border); background: #fff; color: var(--brand-deep); border-radius: 999px; padding: 4px 12px; margin: 3px 0; font-size: 13px; cursor: pointer; white-space: nowrap; text-align: left; }
.support-msg .bubble .support-opt-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.support-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.support-tool-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.support-tool-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.support-image-preview { margin-bottom: 8px; position: relative; display: inline-block; }
.support-image-preview img { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.support-img-clear { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #333; color: #fff; cursor: pointer; line-height: 1; }
.support-typing { padding: 2px 18px 6px; color: var(--muted); font-size: 12px; }

/* ---------- 集運運費試算 ---------- */
.check-line { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.shipping-dims { display: flex; align-items: center; gap: 6px; }
.shipping-dims .input { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; text-align: center; }
.shipping-dims span { color: var(--muted); font-size: 12px; }
.shipping-quote-result {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    background: linear-gradient(135deg, #fffaf5, #fff);
}
.shipping-quote-amount { display: flex; align-items: baseline; gap: 8px; color: var(--brand-deep); }
.shipping-quote-amount span { font-size: 30px; font-weight: 800; line-height: 1.15; }
.shipping-quote-amount small { color: var(--muted); font-size: 12px; font-weight: 700; }
.shipping-fee-lines { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); }
.shipping-fee-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; color: var(--ink-2); }
.shipping-fee-lines li strong { color: var(--ink); }
.shipping-quote-result .alert { margin: 10px 0 0; }

@media (max-width: 1080px) {
    .sourcing-grid { grid-template-columns: 1fr; }
    .support-layout { grid-template-columns: 1fr; }
    .support-side { position: static; }
}
@media (max-width: 820px) {
    body { padding-bottom: 66px; }
    .main-nav { font-size: 13px; gap: 14px; }
    .header-search { max-width: none; margin-left: 0; }
    .header-actions { font-size: 13px; gap: 10px; }
    .hero { padding: 32px 0 30px; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 14px; }
    .hero-search-row { grid-template-columns: 1fr; gap: 10px; }
    .hero-search input { padding: 12px 14px; }
    .hero-search button { padding: 0 18px; }
    .hero-paste-link { min-height: 52px; justify-content: center; }
    .support-widget-panel {
        left: 12px;
        right: 12px;
        bottom: 78px;
        width: auto;
        height: min(540px, calc(100vh - 98px));
        max-height: none;
    }
    .support-widget-panel.is-fullscreen {
        inset: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        border-radius: 0;
        border: 0;
    }
    .support-chat-panel { min-height: 0; }
    .support-messages { height: 52vh; min-height: 300px; padding: 12px; }
    .support-widget .support-widget-messages { height: auto; min-height: 0; flex: 1 1 auto; }
    .support-form { padding: 12px; }
    .support-form-foot { flex-wrap: wrap; }
    .shipping-dims { flex-wrap: wrap; }
    .shipping-dims .input { flex: 1 1 70px; }
    .support-fab {
        right: 14px;
        bottom: 78px;
        width: 46px;
        height: 46px;
        font-size: 12px;
    }
    .mobile-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        display: flex;
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -6px 20px rgba(31, 35, 41, .06);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mobile-tabbar a {
        flex: 1;
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--muted);
        font-size: 12px;
        position: relative;
    }
    .mobile-tabbar a.is-active { color: var(--brand-deep); font-weight: 800; }
    .mobile-tabbar em {
        position: absolute;
        top: 5px;
        margin-left: 28px;
        background: var(--brand);
        color: #fff;
        border-radius: 999px;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        text-align: center;
        font-size: 10px;
        font-style: normal;
        padding: 0 4px;
    }
    .auth-card { padding: 26px 20px 22px; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 160px; }
    .admin-inline-form { min-width: 180px; }
}






/* 常用地址 / 付款方式 */
.address-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr); gap: 20px; align-items: start; }
.address-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.address-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 6px 18px rgba(30, 42, 60, .04); }
.address-card.is-default { border-color: #ffc18f; box-shadow: 0 8px 22px rgba(232, 84, 28, .08); }
.address-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.address-card-head strong { font-size: 16px; }
.address-card-phone { color: var(--brand-deep); font-weight: 700; font-size: 13px; margin: 6px 0; }
.address-card-text { color: var(--muted); font-size: 13px; line-height: 1.7; min-height: 44px; }
.address-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.danger-link { color: var(--danger); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.bank-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f7f8fa; border: 1px solid var(--line); }
.bank-status-1 { background: #edf9f1; border-color: #bde8cc; color: #1e7a43; }
.bank-status-2 { background: #fff8e8; border-color: #f1d59b; color: #98650b; }
.bank-status-3 { background: #fff1ef; border-color: #f3c3ba; color: #b23d2a; }
.payment-method-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 6px 18px rgba(30, 42, 60, .04); }
.payment-method-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(145deg, #fff3e7, #ffe2c9); flex: 0 0 auto; }
.payment-method-body { flex: 1; min-width: 0; }
.payment-method-body h3 { margin: 0 0 3px; font-size: 17px; }
.bank-option-list { display: grid; gap: 10px; }
.bank-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; cursor: pointer; transition: .18s; background: #fff; }
.bank-option:hover { border-color: #ffc18f; background: #fffaf5; }
.bank-option.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 84, 28, .09); background: #fff8f2; }
.bank-option > input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
.bank-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bank-option-main strong { font-size: 14px; }
@media (max-width: 860px) {
    .address-layout { grid-template-columns: 1fr; }
    .address-card-grid { grid-template-columns: 1fr; }
    .payment-method-card { flex-wrap: wrap; }
    .payment-method-card .btn { width: 100%; }
}


/* ---------- 2026-10-21：乾淨、緊湊、按鈕不換行 ---------- */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { letter-spacing: 0; }

.btn {
    white-space: nowrap;
    flex: 0 0 auto;
    min-height: 40px;
    font-weight: 600;
    letter-spacing: .01em;
}
.btn-sm { min-height: 32px; }
.btn-lg { min-height: 48px; }
.btn-block { width: 100%; flex: 1 1 auto; }
.link-button { white-space: nowrap; }
.inline-actions { flex-wrap: nowrap; }
.inline-actions .btn,
.inline-actions .link-button,
.table td .btn,
.table td .link-button,
.admin-card-head .btn,
.panel-head .btn { white-space: nowrap; }

.panel,
.admin-card,
.stat-card,
.product-card,
.payment-method-card,
.address-card { border-radius: 12px; box-shadow: 0 1px 2px rgba(31, 35, 41, .04); }
.panel-pad { padding: 22px; }
.panel-head,
.admin-card-head { flex-wrap: wrap; gap: 10px; }
.page-head { padding: 18px 0 12px; }
.page-head h1 { font-size: 24px; }
.form-actions { flex-wrap: wrap; }
.input, .select, .textarea { border-radius: 8px; }
.table th { background: #f8f9fa; font-weight: 600; letter-spacing: 0; }
.table td { color: var(--ink-2); }
.profile-chip { display: inline-flex; align-items: center; gap: 6px; }

/* 會員選單：把常用地址／匯出行／修改密碼收進下拉，頁首更簡潔 */
.account-menu { position: relative; }
.account-menu > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ink);
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after { content: "▾"; font-size: 11px; color: var(--muted); }
.account-menu[open] > summary { color: var(--brand-deep); }
.account-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    min-width: 168px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(31, 35, 41, .12);
}
.account-menu-panel a {
    display: block;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
}
.account-menu-panel a:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- 後台主題（登入後於頂部切換，存 session） ---------- */
/* 專業版：黑底白字 */
.admin-body[data-theme="dark"] {
    --ab-bg: #12141a; --ab-fg: #e6e8ee; --ab-panel: #1f232b; --ab-border: #2a2f3a;
    --ab-muted: #9aa1ab; --ab-top: #1a1d24; --ab-input: #1a1d24; --ab-th: #1f232b;
    --ab-side-bg: #1a1d24; --ab-side-fg: #b8bec8; --ab-side-strong: #ffffff;
    --ab-side-hover: rgba(255,255,255,.06); --ab-side-active: rgba(255,255,255,.13);
    --ab-side-line: rgba(255,255,255,.08); --ab-side-title: #7d8590;
}
/* 個性版：靛藍夜底 + 暖白字 */
.admin-body[data-theme="vivid"] {
    --ab-bg: #101c2e; --ab-fg: #eef4ff; --ab-panel: #16263f; --ab-border: #2b3f5f;
    --ab-muted: #9db3d0; --ab-top: #14233a; --ab-input: #0f1c2e; --ab-th: #16263f;
    --ab-side-bg: #14233a; --ab-side-fg: #9db3d0; --ab-side-strong: #eef4ff;
    --ab-side-hover: rgba(255,255,255,.06); --ab-side-active: rgba(255,255,255,.13);
    --ab-side-line: rgba(255,255,255,.08); --ab-side-title: #7d8ea8;
}
/* 自定義：調色板自選（內聯 --ab-*-c 由後端注入） */
.admin-body[data-theme="custom"] {
    --ab-bg: var(--ab-bg-c, #f2f3f5); --ab-fg: var(--ab-fg-c, #1f2329);
    --ab-panel: var(--ab-panel-c, #ffffff); --ab-border: var(--ab-border-c, #e8eaef);
    --ab-muted: var(--ab-muted-c, #7a8087); --ab-top: var(--ab-bg-c, #ffffff);
    --ab-input: var(--ab-input-c, #ffffff); --ab-th: var(--ab-panel-c, #f8f9fa);
    --ab-side-bg: var(--ab-bg); --ab-side-fg: var(--ab-muted); --ab-side-strong: var(--ab-fg);
    --ab-side-hover: var(--ab-border); --ab-side-active: var(--ab-border);
    --ab-side-line: var(--ab-border); --ab-side-title: var(--ab-muted);
}

/* 頂部欄 sticky（所有主題統一） */
.admin-top { position: sticky; top: 0; z-index: 20; }

/* 後台內通用組件套用主題變量 */
.admin-body .table { background: var(--ab-panel); color: var(--ab-fg); }
.admin-body .table th { background: var(--ab-th); color: var(--ab-muted); border-bottom-color: var(--ab-border); }
.admin-body .table td { color: var(--ab-fg); border-bottom-color: var(--ab-border); }
.admin-body .table-wrap { border-color: var(--ab-border); }
.admin-body .input, .admin-body .select, .admin-body .textarea { background: var(--ab-input); border-color: var(--ab-border); color: var(--ab-fg); }
.admin-body .input:focus, .admin-body .select:focus, .admin-body .textarea:focus { border-color: var(--brand); }
.admin-body .admin-code { background: var(--ab-border); border-color: var(--ab-border); color: var(--ab-fg); }
.admin-body .notice { background: var(--ab-panel); border-color: var(--ab-border); color: var(--ab-fg); }
.admin-body .empty-state { color: var(--ab-muted); }
.admin-body .empty-state strong { color: var(--ab-fg); }
.admin-body .muted, .admin-body .small, .admin-body .form-hint { color: var(--ab-muted); }
.admin-body .admin-card .muted, .admin-body .admin-card .small { color: var(--ab-muted); }
.admin-body .status-list li { border-bottom-color: var(--ab-border); }
.admin-body .status-list .n { color: var(--ab-fg); }
.admin-body .status-muted { background: var(--ab-border); color: var(--ab-fg); }
.admin-body .purchase-row { border-bottom-color: var(--ab-border); }
.admin-body .purchase-row-head { color: var(--ab-fg); }
.admin-body .purchase-row-head:hover { background: rgba(127,127,127,.08); }
.admin-body .purchase-order { color: var(--ab-fg); }
.admin-body .purchase-user, .admin-body .purchase-time, .admin-body .purchase-caret { color: var(--ab-muted); }
.admin-body .admin-filters .input, .admin-body .admin-filters .select { min-width: 150px; }
.admin-body .stat-grid { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.admin-body .admin-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
/* 後台主題選擇器（頂部下拉） */
.admin-theme { position: relative; }
.admin-theme-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; border: 1px solid var(--ab-border); border-radius: 8px;
    background: var(--ab-panel); color: var(--ab-fg); font-size: 13px; cursor: pointer;
}
.admin-theme-btn:hover { border-color: var(--brand); }
.admin-theme-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
    min-width: 236px; padding: 8px; background: #fff; border: 1px solid #e8eaef;
    border-radius: 10px; box-shadow: 0 14px 34px rgba(31, 35, 41, .16);
}
.admin-theme-presets { display: flex; flex-direction: column; gap: 2px; }
.admin-theme-presets button {
    display: block; width: 100%; text-align: left; padding: 8px 10px;
    border: 0; border-radius: 7px; background: transparent; color: #1f2329;
    font-size: 13px; cursor: pointer;
}
.admin-theme-presets button:hover { background: #f2f3f5; }
.admin-theme-presets button.is-active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.admin-theme-custom {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid #e8eaef;
    display: flex; flex-direction: column; gap: 8px;
}
.admin-theme-custom label {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 13px; color: #1f2329;
}
.admin-theme-custom input[type="color"] {
    width: 44px; height: 28px; padding: 0; border: 1px solid #e8eaef;
    border-radius: 6px; background: #fff; cursor: pointer;
}



/* 登入頁改回深色底 */
.login-admin {
    background-color: #12141a;
    background-image:
        radial-gradient(circle at 50% -10%, rgba(255, 106, 0, .18), transparent 45%),
        linear-gradient(135deg, #12141a, #1f232b 55%, #2a2018);
}
.login-admin .auth-card {
    background: #1f232b;
    border: 1px solid #2a2f3a;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .45);
}
.login-admin .auth-card h1 { color: #fff; }
.login-admin .auth-card .sub { color: #9aa1ab; }
.login-admin .form-row label { color: #c3c8cf; }
.login-admin .auth-foot, .login-admin .notice { color: #9aa1ab; }
.login-admin .auth-foot a { color: var(--brand); }
.auth-card { border-radius: 16px; }

@media (max-width: 820px) {
    .admin-side {
        background: #fff;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .admin-top { position: static; }
    .admin-content { padding: 16px; }
    .account-menu-panel { right: 0; }
    .main-nav { gap: 14px; }
}


@media (max-width: 820px) {
    .hero h1 { font-size: 28px; }
}


/* ---------- 2026-10-23：店鋪 / 規格圖 / 搜尋骨架 / 購物車勾選 ---------- */
.shop-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0 12px;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.shop-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.shop-line-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.shop-line-main strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-line .btn { flex-shrink: 0; }

.skeleton-card { pointer-events: none; }
.skeleton {
    background: linear-gradient(90deg, #eef0f2 25%, #f7f8f9 37%, #eef0f2 63%);
    background-size: 400% 100%;
    animation: jc-skeleton 1.3s ease infinite;
    border-radius: 8px;
}
.skeleton-thumb { aspect-ratio: 4 / 3; border-radius: 0; }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 62%; }
.skeleton-price { height: 26px; width: 46%; margin-top: auto; }
@keyframes jc-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.cart-panel { padding: 0; overflow: hidden; }
.cart-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.check-line { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; margin: 0; }
.check-line input { width: 18px; height: 18px; accent-color: var(--brand); }
.cart-shop + .cart-shop { border-top: 1px solid var(--line); }
.cart-shop-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    background: #fafbfc;
}
.cart-shop-head .muted.small { margin-left: auto; }
.cart-item {
    display: grid;
    grid-template-columns: 24px 86px minmax(0, 1fr) 132px 110px 42px;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-top: 1px solid var(--line);
}
.cart-check { display: flex; align-items: center; justify-content: center; }
.cart-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.cart-item-thumb img {
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--brand-soft);
}
.cart-item-main { min-width: 0; }
.cart-item-title { display: block; font-weight: 600; line-height: 1.45; margin-bottom: 3px; }
.cart-item-title:hover { color: var(--brand-deep); }
.cart-item-spec, .cart-item-unit { color: var(--muted); font-size: 12px; line-height: 1.5; }
.cart-item-qty .inline-actions { flex-wrap: nowrap; }
.cart-item-subtotal { text-align: right; font-weight: 800; color: var(--brand-deep); }
.cart-item-remove { text-align: right; }

/* ---------- 前台左側菜單（大小類） ---------- */
.content-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; padding-top: 22px; padding-bottom: 30px; }
.front-sidebar { position: sticky; top: 20px; }
.front-side-nav { display: flex; flex-direction: column; gap: 16px; }
.front-nav-group { display: flex; flex-direction: column; }
.front-nav-title { font-size: 13px; font-weight: 800; color: var(--brand-deep, #1a3a5c); letter-spacing: .5px; margin-bottom: 6px; padding-left: 10px; border-left: 3px solid var(--brand, #e8541c); }
.front-nav-group a { display: block; padding: 7px 12px 7px 13px; font-size: 13px; color: var(--ink, #333); border-radius: 7px; text-decoration: none; }
.front-nav-group a:hover { background: var(--brand-soft, #fff0e9); color: var(--brand-deep, #1a3a5c); }
.front-nav-group a.is-active { background: var(--brand-soft, #fff0e9); color: var(--brand-deep, #1a3a5c); font-weight: 700; }
.content-main { min-width: 0; }
@media (max-width: 900px) {
    .content-layout { grid-template-columns: 1fr; }
    .front-sidebar { position: static; }
    .front-side-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .front-nav-title { display: none; }
    .front-nav-group { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .front-nav-group a { border: 1px solid var(--line, #e5e7eb); }
}


.warehouse-card {
    background: #f6fbf8;
    border: 1px solid #cfe8d8;
    border-radius: 12px;
    padding: 15px 17px;
}
.warehouse-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warehouse-card p { margin: 8px 0 0; line-height: 1.7; }

@media (max-width: 1080px) {
    .spec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cart-item { grid-template-columns: 24px 76px minmax(0, 1fr) 118px 92px 38px; gap: 10px; }
    .cart-item-thumb img { width: 76px; height: 76px; }
}

@media (max-width: 820px) {
    .spec-list { grid-template-columns: 1fr; }
    .shop-line { align-items: flex-start; }
    .cart-item {
        grid-template-columns: 24px 72px minmax(0, 1fr);
        grid-template-areas:
            "check thumb main"
            ". qty qty"
            ". subtotal remove";
        row-gap: 8px;
        align-items: start;
    }
    .cart-check { grid-area: check; padding-top: 24px; }
    .cart-item-thumb { grid-area: thumb; }
    .cart-item-thumb img { width: 72px; height: 72px; }
    .cart-item-main { grid-area: main; }
    .cart-item-qty { grid-area: qty; }
    .cart-item-subtotal { grid-area: subtotal; text-align: left; }
    .cart-item-remove { grid-area: remove; }
    .cart-shop-head { flex-wrap: wrap; gap: 8px 12px; }
    .cart-shop-head .muted.small { margin-left: 0; }
    .cart-toolbar { gap: 10px; }
}


/* ---------- Admin modal / accordion ---------- */
.admin-modal { position: fixed; inset: 0; z-index: 300; }
.admin-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.admin-modal-dialog { position: relative; margin: 6vh auto; width: min(720px, 94vw); max-height: 88vh; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.admin-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; }
.admin-modal-head h3 { margin: 0; font-size: 17px; }
.admin-modal-close { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; }
.admin-modal-close:hover { color: #111; }
.admin-modal-body { padding: 16px 18px; }
.pkg-detail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 14px; margin-bottom: 12px; }
.pkg-detail-grid > div { padding: 8px 10px; background: #f6f7f9; border-radius: 8px; font-size: 13px; }
.pkg-detail-grid .muted.small { display: block; margin-bottom: 2px; }
@media (max-width: 900px) { .pkg-detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Admin user search results ---------- */
.user-search-results { position: relative; margin-top: 6px; border: 1px solid #e5e7eb; border-radius: 8px; max-height: 220px; overflow: auto; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.user-search-item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f1f3; }
.user-search-item:hover { background: #f3f7ff; }
.user-search-item:last-child { border-bottom: 0; }
.user-search-empty { padding: 10px 12px; color: #6b7280; font-size: 13px; }

/* 前台订单状态筛选 tab */
.order-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.order-tabs .tab {
    display: inline-block; padding: 8px 16px; border: 1px solid var(--line, #e5e7eb);
    border-radius: 999px; color: var(--ink-2, #4a5058); font-size: 13px; text-decoration: none;
}
.order-tabs .tab:hover { border-color: var(--brand, #ff6a00); color: var(--brand-deep, #e05a00); }
.order-tabs .tab.is-active { background: var(--brand, #ff6a00); border-color: var(--brand, #ff6a00); color: #fff; font-weight: 700; }

/* 商品详情 SKU 属性分组（颜色/尺码）：桌面多列并列，手机竖排 */
.sku-group-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 20px; }
.sku-dim-name { font-size: 13px; font-weight: 700; color: var(--ink-2, #4a5058); margin-bottom: 6px; }
.sku-dim-values { display: flex; flex-wrap: wrap; gap: 8px; }
.sku-val {
    padding: 7px 14px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px;
    background: #fff; color: var(--ink, #1f2329); font-size: 13px; cursor: pointer;
}
.sku-val:hover { border-color: var(--brand, #ff6a00); color: var(--brand-deep, #e05a00); }
.sku-val.is-active { border-color: var(--brand, #ff6a00); background: var(--brand-soft, #fff3ea); color: var(--brand-deep, #e05a00); font-weight: 700; }
.spec-list-hidden { display: none; }

/* 手机端主菜单收起 */
.mobile-nav-toggle { display: none; }
@media (max-width: 820px) {
    .mobile-nav-toggle {
        display: inline-flex; align-items: center; gap: 6px;
        border: 1px solid var(--line, #e5e7eb); border-radius: 8px;
        background: #fff; color: var(--ink, #1f2329);
        font-size: 14px; padding: 8px 14px; cursor: pointer;
    }
    .main-nav { display: none; }
    .main-nav.is-open { display: flex; flex-wrap: wrap; order: 4; width: 100%; }
    .nav-mobile-only { display: inline-flex; }
    .nav-desktop-only { display: none; }
    .sku-group-picker { display: flex; flex-direction: column; gap: 12px; }
}

/* ---------- 分類按鈕 + 底部彈層 + 帳戶按鈕 ---------- */
.cat-btn {
    display: none;
    border: 1px solid var(--line);
    background: #f2f3f5;
    color: var(--ink-2);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 16px;
    cursor: pointer;
    white-space: nowrap;
}
.account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #f2f3f5;
    color: var(--ink-2);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
}
.account-btn:hover { background: #e8eaee; color: var(--ink); }

/* 分類頂部下拉 */
.cat-sheet { position: fixed; left: 0; right: 0; top: 0; z-index: 80; }
.cat-sheet-mask { position: fixed; inset: 0; background: rgba(15,18,22,.45); z-index: 79; }
.cat-sheet-body {
    position: relative;
    z-index: 80;
    background: #fff;
    border-radius: 0 0 16px 16px;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
}
.cat-sheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; margin-bottom: 12px; }
.cat-sheet-close { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.cat-sheet-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-sheet-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 13px;
    text-decoration: none;
    text-align: center;
}
.cat-sheet-item:hover { border-color: var(--brand); color: var(--brand-deep); }
.mobile-quick-nav { display: none; }

/* 手機端：第一列 [1688集采][分類][登出]，第二列 [掃碼][搜索][找貨] */
@media (max-width: 820px) {
    .header-inner { flex-wrap: wrap; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
    .brand { order: 1; flex: 0 0 auto; }
    .brand-mark { padding: 3px 7px; border-radius: 6px; }
    .cat-btn { order: 2; display: inline-flex; }
    .header-actions { order: 3; margin-left: auto; flex: 0 0 auto; gap: 4px; }
    .account-btn { padding: 5px 10px; font-size: 12px; line-height: 18px; }
    .header-search { order: 4; display: flex; flex: 1 1 100%; min-width: 0; margin-left: 0; max-width: none; padding: 2px 3px 2px 6px; }
    .header-search input { min-width: 0; width: 100%; padding: 6px 8px; font-size: 13px; }
    .header-scan-btn { width: 26px; height: 26px; }
    .header-search .header-search-submit { width: 28px; height: 28px; }
    .main-nav { display: none; }
    .mobile-quick-nav { order: 5; display: flex; gap: 8px; width: 100%; padding: 4px 0 2px; }
    .mobile-quick-nav a {
        flex: 1;
        text-align: center;
        padding: 7px 8px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        color: var(--ink-2);
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }
    .mobile-quick-nav a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
}

/* ---------- 手機端：表格 → 卡片式列表 ---------- */
@media (max-width: 820px) {
    .table.responsive-card,
    .table.responsive-card tbody,
    .table.responsive-card tr,
    .table.responsive-card td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .table.responsive-card thead { display: none; }
    .table.responsive-card tr {
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        padding: 2px 14px;
        overflow: hidden;
    }
    .table.responsive-card td {
        border: 0;
        padding: 9px 0;
        border-bottom: 1px dashed #f0f2f5;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        text-align: left;
    }
    .table.responsive-card td:last-child { border-bottom: 0; }
    .table.responsive-card td::before {
        content: attr(data-label);
        flex: 0 0 84px;
        font-size: 12px;
        color: var(--muted);
        font-weight: 700;
        padding-top: 2px;
    }
    .table.responsive-card td > .t,
    .table.responsive-card td > .s,
    .table.responsive-card td > div,
    .table.responsive-card td > strong,
    .table.responsive-card td > span,
    .table.responsive-card td > input,
    .table.responsive-card td > a,
    .table.responsive-card td > form {
        flex: 1;
        min-width: 0;
    }
    .table.responsive-card td > input[type="checkbox"] { flex: 0 0 auto; }
}

/* ---------- 480px 以下：小屏精細化 ---------- */
@media (max-width: 480px) {
    .hero h1 { font-size: 24px; margin: 10px 0 20px; line-height: 1.3; }
    .hero-points { gap: 12px 16px; font-size: 13px; margin-top: 32px; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .page-head { padding: 14px 0 10px; }
    .page-head h1 { font-size: 22px; }
    .panel { padding: 14px; }
    .order-card { padding: 14px 16px; }
    .order-items-mini img { width: 46px; height: 46px; }
    .cat-btn { font-size: 13px; padding: 6px 12px; }
    .cat-sheet-item { font-size: 12px; }
}



