/* Hi6381 橘色系主題 */
:root {
    --brand: #f97316;
    --brand-dark: #ea580c;
    --brand-darker: #c2410c;
    --brand-soft: #ffedd5;
    --bg: #fffaf5;
    --surface: #ffffff;
    --ink: #3f3f46;
    --ink-strong: #27272a;
    --ink-muted: #a1a1aa;
    --line: #f1e5d8;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(194, 65, 12, 0.08);
}

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }

body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand-darker); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; display: block; }
.brand-name { font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); letter-spacing: 0.5px; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); font-weight: 500; }
.main-nav a:hover { color: var(--brand-dark); }
.nav-user { color: var(--ink-muted); font-size: 0.95rem; }
.nav-logout {
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0;
}
.nav-logout:hover { color: var(--brand-dark); }
.cart-link { position: relative; padding-right: 6px; }
.cart-badge {
    position: absolute;
    top: -10px;
    right: -12px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* ── Buttons ────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-primary:disabled { background: var(--ink-muted); cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-darker); }
.btn-lg { padding: 13px 32px; font-size: 1.05rem; }
.btn-sm { padding: 5px 14px; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }

/* ── Hero / 首頁 ─────────────────────── */
.hero {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 55%, #fed7aa 100%);
    padding: 72px 0;
    text-align: center;
}
.hero h1 { font-size: 2.2rem; color: var(--ink-strong); margin: 0 0 14px; }
.hero p { font-size: 1.1rem; color: var(--ink); margin: 0 0 28px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.trust-strip { background: var(--surface); border-top: 1px solid var(--line); padding: 48px 0; }
.trust-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; text-align: center; }
.trust-icon { font-size: 2rem; }
.trust-item h3 { margin: 10px 0 6px; color: var(--ink-strong); }
.trust-item p { margin: 0; font-size: 0.95rem; color: var(--ink); }

/* ── Layout blocks ──────────────────── */
.site-main { min-height: 60vh; }
.section { padding: 44px 0 56px; }
.section-narrow { max-width: 820px; }
.section-auth { max-width: 460px; }
.section-title { font-size: 1.5rem; color: var(--ink-strong); margin: 0 0 24px; }
.page-title { font-size: 1.6rem; color: var(--ink-strong); margin: 0 0 10px; }
.page-subtitle { color: var(--ink); margin: 0 0 26px; }
.block-title { font-size: 1.15rem; color: var(--ink-strong); margin: 30px 0 12px; }
.muted { color: var(--ink-muted); }
.notice {
    background: var(--brand-soft);
    border: 1px solid #fdba74;
    border-radius: var(--radius);
    padding: 10px 16px;
    color: var(--brand-darker);
}

/* ── Product cards ──────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.product-card { display: flex; flex-direction: column; }
.product-days {
    align-self: flex-start;
    background: var(--brand-soft);
    color: var(--brand-darker);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 12px;
}
.product-name { margin: 12px 0 8px; font-size: 1.1rem; color: var(--ink-strong); }
.product-desc { flex: 1; margin: 0 0 16px; font-size: 0.92rem; color: var(--ink); }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); }

/* ── 刊登列表與詳細 ─────────────────── */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.listing-card { display: block; color: inherit; }
.listing-card:hover { border-color: var(--brand); color: inherit; }
.listing-title { margin: 0 0 8px; font-size: 1.05rem; color: var(--ink-strong); }
.listing-excerpt { margin: 0 0 12px; font-size: 0.92rem; color: var(--ink); }
.listing-meta { margin: 0; font-size: 0.82rem; color: var(--ink-muted); }
.listing-detail { padding: 28px; }
.listing-detail .listing-meta { margin: 0 0 18px; }
.listing-content { white-space: normal; color: var(--ink-strong); }
.listing-disclaimer { font-size: 0.85rem; color: var(--ink-muted); margin-top: 16px; }
.breadcrumb { margin: 0 0 14px; font-size: 0.95rem; }

/* ── Toast ──────────────────────────── */
.toast {
    position: fixed;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    background: var(--ink-strong);
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 200;
}
.fade-enter-active, .fade-leave-active { transition: opacity 0.25s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ── Tables ─────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.table thead th { background: #fff3e6; color: var(--ink-strong); font-size: 0.9rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table tfoot td { border-top: 2px solid var(--line); border-bottom: none; }
.items-cell { font-size: 0.9rem; }
.total-label { font-weight: 600; }
.total-value { font-size: 1.15rem; font-weight: 700; color: var(--brand-dark); }

.qty-group { display: inline-flex; align-items: center; gap: 8px; }
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-strong);
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
}
.qty-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.qty-value { min-width: 24px; text-align: center; font-weight: 600; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.9rem; padding: 0; }

.cart-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.cart-total { font-size: 1.1rem; }
.cart-total strong { font-size: 1.4rem; color: var(--brand-dark); }

.empty-state {
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 48px 20px;
}
.empty-state p { margin: 0 0 18px; color: var(--ink-muted); }

/* ── Forms ──────────────────────────── */
.form { max-width: 560px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; color: var(--ink-strong); margin-bottom: 6px; font-size: 0.95rem; }
.form-row input,
.form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--ink-strong);
    background: var(--surface);
    font-family: inherit;
}
.form-row textarea { resize: vertical; }
.form-row input:focus,
.form-row textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { color: var(--danger); font-size: 0.95rem; }
.form-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ── Auth ───────────────────────────── */
.auth-card { padding: 32px; }
.auth-card .form { max-width: none; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: 0.95rem; }

/* ── Badges ─────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-paid { background: #dcfce7; color: #15803d; }
.badge-cancelled { background: #f4f4f5; color: #71717a; }

/* ── 訂單明細 ────────────────────────── */
.detail-list { margin: 0 0 8px; }
.detail-list > div { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.detail-list dt { width: 110px; flex-shrink: 0; color: var(--ink-muted); }
.detail-list dd { margin: 0; color: var(--ink-strong); }

.complete-head { text-align: center; margin-bottom: 30px; }
.complete-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 2.4rem;
    line-height: 72px;
}

/* ── 模擬付款頁（銀行閘道風格，刻意與全站區隔）── */
.gateway-wrap {
    min-height: 70vh;
    background: #eef2f7;
    padding: 48px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.gateway-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(30, 41, 59, 0.12);
    padding: 0 28px 28px;
    overflow: hidden;
}
.gateway-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e3a5f;
    color: #fff;
    margin: 0 -28px 20px;
    padding: 14px 28px;
    font-weight: 600;
}
.gateway-ssl { font-size: 0.8rem; opacity: 0.85; }
.gateway-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.92rem;
    margin-bottom: 18px;
}
.gateway-info { margin: 0 0 20px; }
.gateway-info > div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #e2e8f0; }
.gateway-info dt { color: #64748b; }
.gateway-info dd { margin: 0; font-weight: 600; color: #1e293b; }
.gateway-amount { font-size: 1.2rem; color: var(--brand-dark) !important; }
.gateway-card .form { max-width: none; }
.gateway-actions { justify-content: space-between; }
.gateway-note { font-size: 0.82rem; color: #94a3b8; margin: 14px 0 0; }

/* ── 靜態頁 ─────────────────────────── */
.static-page h2 { font-size: 1.15rem; color: var(--ink-strong); margin: 28px 0 10px; }
.static-page ul { padding-left: 22px; }
.static-page li { margin-bottom: 6px; }

/* ── Footer ─────────────────────────── */
.site-footer {
    background: #2b2018;
    color: #d6c9bd;
    padding: 34px 0;
    margin-top: 40px;
    text-align: center;
}
.footer-nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-nav a { color: #f5e8dc; font-size: 0.95rem; }
.footer-nav a:hover { color: var(--brand); }
.footer-note { font-size: 0.85rem; margin: 0 0 6px; opacity: 0.8; }
.footer-copy { font-size: 0.85rem; margin: 0; opacity: 0.6; }

/* ── RWD ────────────────────────────── */
@media (max-width: 640px) {
    .hero { padding: 48px 0; }
    .hero h1 { font-size: 1.6rem; }
    .trust-inner { grid-template-columns: 1fr; gap: 20px; }
    .form-cols { grid-template-columns: 1fr; }

    /* 表格改卡片式呈現 */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td, .table tfoot { display: block; width: 100%; }
    .table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
    .table td { border: none; padding: 6px 14px; text-align: right; }
    .table td[data-label]::before {
        content: attr(data-label);
        float: left;
        color: var(--ink-muted);
        font-size: 0.85rem;
    }
    .table .num { text-align: right; }
    .table tfoot tr { border-bottom: none; }
    .cart-summary { justify-content: center; }
}
