/* =========================================================
   拾光二手 — 全站樣式
   ========================================================= */

:root {
    --bg: #f6f3ec;
    --surface: #ffffff;
    --surface-2: #fbfaf6;
    --ink: #182a24;
    --ink-soft: #34463f;
    --muted: #6b7a73;
    --line: #e6e1d5;
    --primary: #146b5a;
    --primary-dark: #0b4b40;
    --primary-soft: #e3f1ec;
    --accent: #d97742;
    --accent-dark: #b45309;
    --accent-soft: #fbeadb;
    --danger: #b83a2e;
    --danger-soft: #fbe9e7;
    --warn-soft: #fdf3dd;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(24, 42, 36, .05);
    --shadow: 0 12px 32px rgba(24, 42, 36, .08);
    --shadow-lg: 0 24px 60px rgba(24, 42, 36, .12);
    --font: "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(217, 119, 66, .08), transparent 60%),
        radial-gradient(800px 500px at 0% 5%, rgba(20, 107, 90, .07), transparent 55%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
code {
    font-family: "Cascadia Code", Consolas, monospace;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: .1em .4em;
    border-radius: 6px;
    font-size: .88em;
}
::selection { background: #cfe7df; }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.text-link { font-weight: 700; font-size: .92rem; color: var(--primary); white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.site-main { min-height: 55vh; padding-bottom: 20px; }

/* ---------- 按鈕 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45em;
    padding: .72rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, border-color .16s ease;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(20, 107, 90, .22); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f1cfca; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .5rem .95rem; font-size: .86rem; }
.btn-xs { padding: .34rem .68rem; font-size: .78rem; }
.btn-block { width: 100%; }
.linklike {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: .9rem;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
}
.linklike:hover { color: var(--primary); text-decoration: underline; }
.linklike.danger { color: var(--danger); }
.inline-form { display: inline-flex; align-items: center; margin: 0; }

:focus-visible { outline: 3px solid rgba(20, 107, 90, .32); outline-offset: 2px; }

/* ---------- 頁首 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 243, 236, .86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(230, 225, 213, .9);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #1c7f6b, #0b4b40);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(11, 75, 64, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.12rem; letter-spacing: .02em; }
.brand-text small { font-size: .7rem; color: var(--muted); letter-spacing: .04em; }

.main-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.main-nav > a {
    padding: .48rem .82rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s ease, color .15s ease;
}
.main-nav > a:hover, .main-nav > a.active { background: var(--primary-soft); color: var(--primary-dark); }
.main-nav > a.nav-sell { color: var(--accent-dark); font-weight: 700; }
.main-nav > a.nav-sell:hover { background: var(--accent-soft); color: var(--accent-dark); }
.main-nav .inline-form .linklike { padding: .45rem .6rem; }
.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--ink);
}

/* ---------- 閃爍訊息 ---------- */
.flash-wrap { margin-top: 16px; }
.flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: .92rem;
    border: 1px solid transparent;
    margin-bottom: 12px;
}
.flash-success { background: #e8f5ee; border-color: #bfe3cf; color: #14603f; }
.flash-error { background: var(--danger-soft); border-color: #f0c8c3; color: #8f2c22; }
.flash-info { background: #eaf2fb; border-color: #c8ddf3; color: #1f4f7f; }
.flash-close { border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; opacity: .65; padding: 0 2px; }
.flash-close:hover { opacity: 1; }
.error-list { margin: 0; padding-left: 1.2em; }
.error-list li + li { margin-top: .25em; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 62px 0 54px; }
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 48px;
    align-items: center;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
    padding: .35rem .8rem;
    border-radius: 999px;
    margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.04em; margin-bottom: 18px; }
.hero h1 em {
    font-style: normal;
    color: var(--primary);
    position: relative;
    white-space: nowrap;
}
.hero h1 em::after {
    content: "";
    position: absolute;
    left: 2%;
    right: 2%;
    bottom: .06em;
    height: .16em;
    background: rgba(217, 119, 66, .35);
    border-radius: 999px;
    z-index: -1;
}
.hero-lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 28px; }

.hero-search {
    display: flex;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 6px 6px 20px;
    max-width: 540px;
    box-shadow: var(--shadow-sm);
}
.hero-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(20, 107, 90, .12); }
.hero-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ink);
    outline: none;
    padding: .55rem 0;
}
.hero-search .btn { flex-shrink: 0; }

.hero-stats { display: flex; gap: 30px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.55rem; line-height: 1.1; letter-spacing: -.02em; }
.hero-stats span { font-size: .78rem; color: var(--muted); margin-top: 4px; }

.hero-art { position: relative; height: 430px; }
.hero-blob {
    position: absolute;
    inset: 8% 2% 6% 6%;
    border-radius: 48% 52% 44% 56% / 54% 42% 58% 46%;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 45%),
        linear-gradient(145deg, #d8ece4, #f4e4d4 60%, #e9d9c8);
    box-shadow: inset 0 0 60px rgba(255, 255, 255, .5);
}
.hero-blob::after {
    content: "";
    position: absolute;
    inset: 40px;
    border: 1px dashed rgba(20, 107, 90, .25);
    border-radius: inherit;
}
.float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 18px;
    padding: 13px 18px 13px 14px;
    box-shadow: var(--shadow-lg);
    animation: floaty 6s ease-in-out infinite;
}
.float-card strong { display: block; font-size: .9rem; }
.float-card small { display: block; font-size: .78rem; color: var(--accent-dark); font-weight: 700; }
.float-emoji {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: var(--surface-2);
    border-radius: 14px;
}
.float-1 { top: 12%; left: 2%; transform: rotate(-4deg); animation-delay: -.5s; }
.float-2 { top: 44%; right: 0; transform: rotate(3deg); animation-delay: -2s; }
.float-3 { bottom: 9%; left: 12%; transform: rotate(-2deg); animation-delay: -4s; }
.hero-badge {
    position: absolute;
    bottom: -2%;
    right: 4%;
    background: var(--ink);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .55rem 1rem;
    border-radius: 999px;
    box-shadow: var(--shadow);
}
@keyframes floaty {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

/* ---------- 市集列表 ---------- */
.market-section { padding: 26px 0 30px; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.section-head.centered { justify-content: center; text-align: center; }
.section-kicker {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .2em;
    color: var(--accent-dark);
    margin-bottom: 6px;
}
.section-sub { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.sort-form { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.sort-form select {
    font: inherit;
    font-size: .86rem;
    padding: .45rem 2rem .45rem .75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7a73' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    color: var(--ink-soft);
    cursor: pointer;
}
.category-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .48rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .7);
    font-size: .86rem;
    font-weight: 600;
    color: var(--ink-soft);
    transition: all .15s ease;
}
.chip span {
    font-size: .72rem;
    color: var(--muted);
    background: var(--bg);
    border-radius: 999px;
    padding: .05rem .45rem;
    min-width: 1.5em;
    text-align: center;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.active span { background: rgba(255, 255, 255, .18); color: #fff; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 22px;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #d6d0c2; }
.product-card.is-sold { opacity: .82; }
.card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .card-media img { transform: scale(1.045); }
.media-emoji {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 4.2rem;
    filter: drop-shadow(0 10px 16px rgba(24, 42, 36, .12));
}
.media-emoji-xl { font-size: 8rem; filter: drop-shadow(0 16px 24px rgba(24, 42, 36, .15)); }

/* 分類色調 */
.tone-1 { background: linear-gradient(140deg, #dcefe9, #bfe0d5 60%, #d6ebe4); }
.tone-2 { background: linear-gradient(140deg, #f6e7d8, #eecfb5 60%, #f7e3d1); }
.tone-3 { background: linear-gradient(140deg, #e7e3f2, #d2cae8 60%, #ece7f7); }
.tone-4 { background: linear-gradient(140deg, #e6eddc, #cfdfbd 60%, #eaf1e2); }
.tone-5 { background: linear-gradient(140deg, #fbe6e2, #f3cbc4 60%, #fcebe7); }
.tone-6 { background: linear-gradient(140deg, #e2edf3, #c6dce9 60%, #e8f1f7); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .25rem .62rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink-soft);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(24, 42, 36, .08);
}
.badge-sold {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(24, 42, 36, .9);
    color: #fff;
}
.badge-soft { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-available { background: var(--primary-soft); color: var(--primary-dark); }
.badge-sold:not(.badge) { position: static; }
.product-tags .badge-sold { position: static; background: var(--ink); }
.badge-secure { background: #e3f3e9; color: #1d6b44; }
.badge-warn { background: var(--warn-soft); color: #8a6100; }
.badge-muted { background: #eef0ee; color: var(--muted); }
.badge-admin {
    display: inline-flex;
    align-items: center;
    padding: .08rem .42rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: middle;
}

.card-body { padding: 16px 17px 15px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: .98rem; margin-bottom: 6px; line-height: 1.45; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--primary); }
.card-price { color: var(--accent-dark); font-weight: 800; font-size: 1.16rem; letter-spacing: -.01em; margin-bottom: 6px; }
.card-meta { display: flex; gap: 5px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 12px; }
.card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 11px;
    border-top: 1px dashed var(--line);
    font-size: .78rem;
    color: var(--muted);
}
.mini-user { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 800;
    color: #234;
    flex-shrink: 0;
    font-size: 1rem;
}
.avatar-xs { width: 24px; height: 24px; font-size: .72rem; }
.avatar-lg { width: 74px; height: 74px; font-size: 1.7rem; border: 3px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow-sm); }
.avatar.tone-1, .avatar-xs.tone-1 { background: #cfe8de; color: #145c4a; }
.avatar.tone-2 { background: #f5dcc4; color: #8a4b1e; }
.avatar.tone-3 { background: #ddd5ef; color: #514087; }
.avatar.tone-4 { background: #dbe7c8; color: #456021; }
.avatar.tone-5 { background: #f7d5cf; color: #8f362b; }
.avatar.tone-6 { background: #cfe2ee; color: #265b7a; }
.comment-count { white-space: nowrap; }

.empty-state {
    background: var(--surface);
    border: 1px dashed #d7d0c1;
    border-radius: var(--radius-lg);
    padding: 64px 24px;
    text-align: center;
}
.empty-emoji { font-size: 3rem; margin-bottom: 10px; }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 38px 0 10px; flex-wrap: wrap; }
.page-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: .86rem;
    font-weight: 600;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { color: var(--muted); padding: 0 4px; }

/* ---------- 如何運作 ---------- */
.how-section {
    margin-top: 66px;
    padding: 64px 0 70px;
    background: var(--ink);
    color: #eaf1ed;
}
.how-section .section-kicker { color: #e9a06b; }
.how-section h2 { color: #fff; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.how-card {
    position: relative;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-lg);
    padding: 30px 26px 26px;
    overflow: hidden;
}
.how-num {
    position: absolute;
    top: 14px;
    right: 20px;
    font-size: 2.6rem;
    font-weight: 800;
    color: rgba(255, 255, 255, .07);
    letter-spacing: -.04em;
}
.how-icon { font-size: 1.9rem; display: block; margin-bottom: 14px; }
.how-card h3 { color: #fff; }
.how-card p { color: #b9c9c1; font-size: .9rem; margin: 0; }

/* ---------- 頁尾 ---------- */
.site-footer { background: #12211c; color: #c8d6d0; padding: 52px 0 0; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.1fr;
    gap: 34px;
    padding-bottom: 40px;
}
.brand-footer { color: #fff; margin-bottom: 16px; }
.brand-footer:hover { color: #fff; }
.brand-footer small { color: #93a79e; }
.footer-note { font-size: .84rem; color: #93a79e; line-height: 1.8; margin: 0; }
.site-footer h4 { font-size: .82rem; letter-spacing: .08em; color: #fff; margin-bottom: 12px; }
.site-footer a { display: block; color: #a9bbb4; font-size: .86rem; padding: .18rem 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 18px 0;
    font-size: .76rem;
    color: #7d9188;
}

/* ---------- 麵包屑 ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .82rem;
    color: var(--muted);
    padding: 22px 0 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--ink-soft); font-weight: 600; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 商品詳情 ---------- */
.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: 26px 34px;
    align-items: start;
}
.product-media {
    position: relative;
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 0, 0, .04);
    box-shadow: var(--shadow-sm);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media.is-sold img { filter: saturate(.7); }
.sold-ribbon {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(24, 42, 36, .9);
    color: #fff;
    padding: .35rem .9rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
}
.product-media-wrap { min-width: 0; }
.product-thumbs {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 10px 2px 2px;
    scrollbar-width: thin;
}
.product-thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--surface-2);
    cursor: pointer;
    opacity: .72;
    transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-thumb:hover { opacity: 1; transform: translateY(-1px); }
.product-thumb.active { opacity: 1; border-color: var(--primary); }
.product-thumb:focus-visible { outline: 3px solid rgba(20, 107, 90, .25); outline-offset: 2px; }
.product-info { padding-top: 4px; }
.product-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.product-tags .badge-cat {
    position: static;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: none;
    backdrop-filter: none;
}
.product-info h1 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); margin-bottom: 10px; }
.product-price { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; color: var(--accent-dark); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 16px; }
.product-meta-list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 16px; }
.product-meta-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: .87rem; }
.product-meta-list span { color: var(--muted); }
.product-meta-list strong { font-weight: 600; text-align: right; }

.seller-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 16px;
}
.seller-info strong { display: block; font-size: .92rem; }
.seller-info span { font-size: .76rem; color: var(--muted); }
.owner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.owner-actions form { margin: 0; }

.safety-note {
    background: var(--warn-soft);
    border: 1px solid #f0e0b8;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: .8rem;
    color: #6f5511;
}
.safety-note strong { display: block; margin-bottom: 2px; }
.safety-note p { margin: 0; line-height: 1.65; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
}
.product-desc { grid-column: 1 / -1; margin-top: 4px; }
.product-desc h2 { font-size: 1.2rem; margin-bottom: 14px; }
.desc-text { color: var(--ink-soft); font-size: .94rem; line-height: 1.9; }

.comments { grid-column: 1 / -1; scroll-margin-top: 90px; }
.comments-head { margin-bottom: 18px; }
.comments-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin-bottom: 4px; }
.comments-head p { margin: 0; color: var(--muted); font-size: .84rem; }
.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 1.8em;
    height: 1.6em;
    padding: 0 .45em;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .66em;
    font-weight: 800;
    vertical-align: middle;
}
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.comment-form-main { flex: 1; }
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    font-size: .9rem;
    resize: vertical;
    min-height: 78px;
    color: var(--ink);
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(20, 107, 90, .1); background: #fff; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.char-count { font-size: .74rem; color: var(--muted); }
.field-error { color: var(--danger); font-size: .8rem; margin: 6px 0 0; }
.login-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--surface-2);
    border: 1px dashed #d9d2c3;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: .88rem;
    color: var(--muted);
}
.login-prompt span { margin-right: auto; }

.comment-list { display: flex; flex-direction: column; gap: 2px; }
.comment { display: flex; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.comment-head strong { font-size: .88rem; }
.comment-head time { font-size: .72rem; color: var(--muted); }
.comment-delete { margin-left: auto; }
.comment-delete button {
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: .72rem;
    cursor: pointer;
    padding: 0;
    opacity: .75;
}
.comment-delete button:hover { color: var(--danger); opacity: 1; text-decoration: underline; }
.comment-main p { margin: 0; font-size: .9rem; color: var(--ink-soft); line-height: 1.75; word-break: break-word; }
.comment-empty { padding: 12px 0 4px; font-size: .88rem; }

.related-section { margin-top: 44px; }
.related-section .section-head { margin-bottom: 20px; }

/* ---------- 表單 ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.field > span { display: flex; align-items: center; gap: 4px; }
.field em { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea {
    width: 100%;
    font: inherit;
    font-size: .92rem;
    font-weight: 400;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .68rem .85rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(20, 107, 90, .1);
}
.field small { font-size: .74rem; font-weight: 400; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-field { display: flex; align-items: flex-start; gap: 9px; font-size: .8rem; color: var(--muted); line-height: 1.6; }
.check-field input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.otp-input { letter-spacing: .55em; text-align: center; font-size: 1.45rem !important; font-weight: 700 !important; font-family: "Cascadia Code", Consolas, monospace !important; padding-left: 1em !important; }

/* ---------- 登入 / 註冊 ---------- */
.auth-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 44px;
    margin-bottom: 60px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 1060px;
}
.auth-aside {
    background:
        radial-gradient(500px 300px at 80% 10%, rgba(217, 119, 66, .25), transparent 60%),
        linear-gradient(155deg, #17493e, #0c2f28);
    color: #dfeae5;
    padding: 46px 42px;
    display: flex;
    flex-direction: column;
}
.auth-aside .eyebrow { background: rgba(255, 255, 255, .12); color: #f3c9a8; align-self: flex-start; }
.auth-aside h2 { color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 6px 0 16px; line-height: 1.35; }
.auth-aside > p { color: #afc4bb; font-size: .9rem; line-height: 1.85; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: #d3e1db; }
.auth-points span { width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border-radius: 9px; font-size: .9rem; }
.auth-quote { margin-top: auto; padding-top: 36px; border-top: 1px solid rgba(255, 255, 255, .12); }
.auth-quote p { font-size: .9rem; color: #e8f0ec; margin-bottom: 6px; }
.auth-quote span { font-size: .76rem; color: #93aca2; }

.auth-card { padding: 46px 44px; align-self: center; width: 100%; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: .86rem; margin-bottom: 22px; }
.auth-card .flash { margin-bottom: 18px; }
.auth-switch { font-size: .84rem; color: var(--muted); text-align: center; margin: 20px 0 0; }
.auth-switch a { font-weight: 700; }
.demo-hint {
    margin-top: 22px;
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .76rem;
    color: var(--muted);
}
.demo-hint strong { color: var(--ink-soft); font-size: .78rem; }
.demo-hint code { font-size: .76rem; }

/* Google OAuth */
.btn-google {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(60, 64, 67, .14);
}
.btn-google:hover { background: #f8faff; border-color: #c8d7ef; color: #1a73e8; }
.google-icon { flex-shrink: 0; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--muted);
    font-size: .74rem;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-divider span { white-space: nowrap; }
.oauth-setup {
    background: var(--surface-2);
    border: 1px dashed #d8d1c2;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: .78rem;
    color: var(--muted);
}
.oauth-setup strong { display: block; color: var(--ink-soft); font-size: .84rem; margin-bottom: 5px; }
.oauth-setup p { margin: 5px 0; line-height: 1.65; }
.oauth-setup code { word-break: break-all; }
.admin-oauth { margin-bottom: 18px; }
.oauth-redirect { margin-top: 6px !important; font-size: .78rem; word-break: break-all; }
.google-linked {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #eef8f2;
    border: 1px solid #cfe8da;
    border-radius: 14px;
    padding: 14px;
}
.google-linked-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.google-linked strong { display: block; color: #1d6b44; font-size: .9rem; }
.google-linked p { margin: 3px 0 0; font-size: .78rem; color: #3d6a55; line-height: 1.6; }
.field-note { font-size: .76rem; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.avatar-img { object-fit: cover; border-radius: 50%; }

/* ---------- 刊登商品 ---------- */
.sell-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; padding-bottom: 30px; }
.sell-panel { padding: 30px 32px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.panel-head h1 { margin-bottom: 4px; }
.panel-head p { margin: 0; font-size: .88rem; }
.upload-box { display: flex; flex-direction: column; gap: 12px; }
.current-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.current-image { display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.current-image img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; }
.current-image .check-field { padding: 0 2px 2px; }
.image-missing { display: grid; place-items: center; height: 110px; border-radius: 10px; background: var(--warn-soft); color: #7a5a0d; font-size: .78rem; }
.file-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 26px 18px;
    border: 1.5px dashed #cfc8b8;
    border-radius: 14px;
    background: var(--surface-2);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
    font-weight: 400;
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop-icon { font-size: 1.9rem; }
.file-drop strong { font-size: .88rem; color: var(--ink-soft); font-weight: 700; }
.file-drop small { font-size: .74rem; color: var(--muted); font-weight: 400; }
.image-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); padding: 10px; }
.image-preview img { max-height: 260px; width: auto; margin: 0 auto; border-radius: 10px; }
.image-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.image-preview-grid img { width: 100%; height: 100px; max-height: none; object-fit: cover; margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.sell-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 96px; }
.tip-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.tip-card h3 { font-size: .94rem; margin-bottom: 10px; }
.tip-card ul { margin: 0; padding-left: 1.15em; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.tip-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.tip-warn { background: var(--warn-soft); border-color: #f0e0b8; }
.tip-warn h3 { color: #7a5a0d; }
.tip-warn p { color: #7a5a0d; }

/* ---------- 帳號頁 ---------- */
.account-page { padding-bottom: 30px; }
.profile-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
    margin: 30px 0 24px;
    padding: 28px 30px;
    border-radius: 26px;
    background:
        radial-gradient(600px 260px at 90% 0%, rgba(217, 119, 66, .18), transparent 60%),
        linear-gradient(135deg, #17493e, #0d352d);
    color: #eaf1ed;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.profile-banner::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -70px;
    bottom: -140px;
    border: 1px dashed rgba(255, 255, 255, .18);
    border-radius: 50%;
}
.profile-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name h1 { color: #fff; font-size: 1.6rem; margin: 0; }
.profile-sub { margin: 3px 0 0; color: #a9c0b7; font-size: .8rem; }
.profile-stats { display: flex; gap: 26px; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats strong { display: block; font-size: 1.4rem; color: #fff; line-height: 1.2; }
.profile-stats span { font-size: .72rem; color: #a9c0b7; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-actions .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.profile-actions .btn-ghost:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.account-main { display: flex; flex-direction: column; gap: 22px; }
.account-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 96px; }
.account-main .panel { padding: 24px 26px; }
.account-side .panel { padding: 22px 24px; }
.account-main .panel-head { margin-bottom: 16px; }
.account-main .panel-head h2 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 8px; }

.listing-list { display: flex; flex-direction: column; }
.listing-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.listing-row:first-child { border-top: 0; padding-top: 0; }
.listing-thumb {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 1.6rem;
}
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { flex: 1; min-width: 150px; }
.listing-title { display: block; font-weight: 700; font-size: .93rem; color: var(--ink); margin-bottom: 3px; }
.listing-title:hover { color: var(--primary); }
.listing-meta { display: flex; gap: 5px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.listing-meta strong { color: var(--accent-dark); }
.listing-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.listing-actions form { margin: 0; }

.mini-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 10px; text-align: center; color: var(--muted); font-size: .88rem; }
.mini-empty > span { font-size: 2rem; }
.mini-empty p { margin: 0; }

.my-comments { display: flex; flex-direction: column; }
.my-comment { padding: 14px 0; border-top: 1px solid var(--line); }
.my-comment:first-child { border-top: 0; padding-top: 0; }
.my-comment > p { margin: 0 0 6px; font-size: .88rem; color: var(--ink-soft); line-height: 1.75; }
.my-comment-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.my-comment-foot form { margin: 0; }

.security-panel { border-color: #cfe2da; }
.status-dot { display: inline-flex; align-items: center; gap: .35em; font-size: .72rem; font-weight: 700; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b7c2bc; }
.status-dot.on { color: #1d6b44; }
.status-dot.on::before { background: #25a06a; box-shadow: 0 0 0 4px rgba(37, 160, 106, .15); }
.status-dot.off { color: #8a6100; }
.status-dot.off::before { background: #d99a1e; }
.security-panel > p.muted { font-size: .82rem; line-height: 1.7; }
.google-unlink { text-align: center; margin-top: 12px; }
.side-title { font-size: 1rem; margin-bottom: 12px; }
.info-list { margin: 0; font-size: .82rem; }
.info-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px dashed var(--line); }
.info-list > div:first-child { border-top: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.side-tip p { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.75; }

/* ---------- 管理後台 ---------- */
.admin-page { padding-bottom: 40px; }
.admin-hero { padding: 34px 0 22px; display: flex; justify-content: space-between; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.admin-hero h1 { margin-bottom: 4px; }
.admin-hero p { color: var(--muted); font-size: .88rem; margin: 0; max-width: 560px; }
.admin-stat-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 76px; text-align: center; box-shadow: var(--shadow-sm); }
.admin-stat strong { display: block; font-size: 1.2rem; line-height: 1.2; }
.admin-stat span { font-size: .68rem; color: var(--muted); }
.admin-tabs { display: flex; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
.admin-tabs a { padding: .5rem 1.05rem; border-radius: 999px; font-size: .86rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.admin-tabs a:hover { color: var(--primary); }
.admin-tabs a.active { background: var(--ink); color: #fff; }
.admin-tabs a span { font-size: .7rem; opacity: .7; margin-left: 2px; }
.admin-page .panel { padding: 24px; }
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 860px; }
.data-table th {
    text-align: left;
    font-size: .7rem;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface-2);
}
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfaf6; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table a { font-weight: 600; color: var(--ink); }
.data-table a:hover { color: var(--primary); }
.table-user { display: flex; gap: 8px; align-items: center; }
.table-user > div { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.self-tag { font-size: .64rem; background: var(--primary-soft); color: var(--primary-dark); border-radius: 5px; padding: .05rem .35rem; font-weight: 700; }
.table-product { display: flex; gap: 10px; align-items: center; }
.table-thumb { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font-size: 1.15rem; }
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.table-actions { display: flex; gap: 5px; align-items: center; }
.table-actions form { margin: 0; }
.comment-cell { max-width: 340px; color: var(--ink-soft); }

.switch { position: relative; display: inline-block; width: 44px; height: 25px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: #d8d4c9; border-radius: 999px; transition: background .18s ease; }
.switch-slider::before { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(19px); }
.switch input:disabled + .switch-slider { opacity: .55; cursor: not-allowed; }
.switch input:focus-visible + .switch-slider { outline: 3px solid rgba(20, 107, 90, .3); outline-offset: 2px; }

/* ---------- 安裝頁 ---------- */
.install-body { display: grid; place-items: center; min-height: 100vh; padding: 40px 20px; }
.install-page { width: min(760px, 100%); }
.install-page > .brand { margin-bottom: 22px; }
.install-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 34px 36px; box-shadow: var(--shadow); }
.install-card h1 { font-size: 1.6rem; margin-bottom: 18px; }
.install-list { margin: 0 0 20px; padding-left: 1.2em; color: var(--ink-soft); font-size: .9rem; line-height: 1.9; }
.install-stats { display: flex; gap: 12px; margin: 20px 0; }
.install-stats > div { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.install-stats strong { display: block; font-size: 1.5rem; }
.install-stats span { font-size: .74rem; color: var(--muted); }
.install-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 20px 0; }
.install-note h3 { font-size: .95rem; margin-bottom: 10px; }
.install-note p { font-size: .8rem; margin: 10px 0 0; line-height: 1.7; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mini-table th, .mini-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini-table th { font-size: .7rem; color: var(--muted); letter-spacing: .05em; }
.install-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.install-foot { text-align: center; color: var(--muted); font-size: .74rem; margin-top: 18px; }

/* ---------- 響應式 ---------- */
@media (max-width: 1024px) {
    .hero-inner { gap: 30px; }
    .hero-art { height: 360px; }
    .account-grid { grid-template-columns: minmax(0, 1fr) 320px; }
    .sell-layout { grid-template-columns: minmax(0, 1fr) 280px; }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .footer-grid > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 76px;
        left: 20px;
        right: 20px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 12px;
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        z-index: 60;
    }
    .main-nav.open { display: flex; }
    .main-nav > a, .main-nav .inline-form .linklike { padding: .65rem .9rem; width: 100%; text-align: left; }
    .main-nav .inline-form { width: 100%; }
    .nav-toggle { display: inline-grid; place-items: center; }
    .site-header { position: sticky; }

    .hero { padding: 42px 0 30px; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .hero h1 em { white-space: normal; }
    .hero-stats { gap: 22px; }

    .product-layout { grid-template-columns: 1fr; }
    .product-media { aspect-ratio: 16 / 11; }
    .product-desc, .comments { grid-column: auto; }

    .auth-wrap { grid-template-columns: 1fr; margin-top: 26px; }
    .auth-aside { padding: 30px 30px 26px; }
    .auth-aside h2 { font-size: 1.5rem; }
    .auth-quote { display: none; }
    .auth-card { padding: 32px 28px; }

    .sell-layout { grid-template-columns: 1fr; }
    .sell-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .sell-side .tip-card { flex: 1; min-width: 220px; }

    .account-grid { grid-template-columns: 1fr; }
    .account-side { position: static; }
    .profile-stats { margin-left: 0; }
    .profile-actions { margin-left: auto; }

    .how-grid { grid-template-columns: 1fr; }
    .how-card { padding: 22px; }

    .admin-hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
    .container { width: calc(100% - 28px); }
    h1 { font-size: 1.75rem; }
    .header-inner { min-height: 68px; }
    .brand-mark { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 12px; }
    .brand-text strong { font-size: 1rem; }
    .brand-text small { display: none; }
    .main-nav { top: 68px; left: 14px; right: 14px; }

    .hero { padding: 34px 0 24px; }
    .hero-lead br { display: none; }
    .hero-search { padding-left: 16px; }
    .hero-stats { gap: 18px; justify-content: space-between; }
    .hero-stats strong { font-size: 1.25rem; }
    .hero-stats span { font-size: .7rem; }

    .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .section-head.centered { align-items: center; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .card-body { padding: 12px 12px 12px; }
    .card-body h3 { font-size: .88rem; }
    .card-price { font-size: 1rem; }
    .media-emoji { font-size: 3rem; }
    .badge-cat, .badge-sold { font-size: .64rem; padding: .2rem .5rem; }
    .card-meta { display: none; }
    .card-foot { padding-top: 9px; }

    .product-info h1 { font-size: 1.4rem; }
    .panel { padding: 20px 18px; border-radius: 18px; }
    .comments { scroll-margin-top: 80px; }
    .comment { gap: 9px; }
    .comment .avatar { width: 34px; height: 34px; font-size: .85rem; }
    .comment-form .avatar { display: none; }
    .comment-head { gap: 5px; }

    .auth-card { padding: 26px 20px; }
    .auth-aside { padding: 24px 20px; }
    .field-row { grid-template-columns: 1fr; }

    .sell-panel { padding: 22px 18px; }
    .panel-head { flex-direction: column; }

    .profile-banner { padding: 22px 18px; gap: 18px; }
    .profile-main { width: 100%; }
    .avatar-lg { width: 58px; height: 58px; font-size: 1.35rem; }
    .profile-name h1 { font-size: 1.3rem; }
    .profile-stats { width: 100%; justify-content: space-between; }
    .profile-actions { width: 100%; }
    .profile-actions .btn { flex: 1; }

    .account-main .panel, .account-side .panel { padding: 20px 18px; }
    .listing-actions { width: 100%; padding-left: 76px; }

    .admin-stat { flex: 1; min-width: 70px; padding: 8px 10px; }
    .admin-page .panel { padding: 18px 14px; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
    .footer-grid > div:last-child { grid-column: 1 / -1; }

    .install-card { padding: 24px 20px; }
    .install-stats { flex-wrap: wrap; }
    .install-stats > div { min-width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
