:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #232636;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #00d4aa;
    --accent-hover: #00e6b8;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --info: #3b82f6;
    --product-glow-color: #67e8f9;
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    height: 32px;
    border-radius: 6px;
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    gap: 6px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

.announcement {
    background: var(--accent-dim);
    border: 1px solid rgba(0, 212, 170, 0.15);
    border-radius: var(--radius);
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--accent);
    animation: fadeDown 0.4s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.announce-icon { font-size: 18px; flex-shrink: 0; }

.announce-text {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
}

.search-bar {
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.search-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid rgba(125, 211, 252, .14);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .72), rgba(8, 12, 24, .58)),
        rgba(15, 23, 42, .45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.cat-tab {
    position: relative;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(148, 163, 184, .16);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: all var(--transition);
    overflow: hidden;
}

.cat-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(103, 232, 249, .16), transparent);
    opacity: 0;
    transition: opacity .25s ease;
}

.cat-tab:hover {
    border-color: rgba(103, 232, 249, .42);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(34, 211, 238, .12);
}

.cat-tab:hover::before { opacity: 1; }

.cat-tab.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, .92), rgba(99, 102, 241, .88));
    color: #041018;
    border-color: transparent;
    box-shadow: 0 10px 28px rgba(34, 211, 238, .28), 0 0 18px rgba(99, 102, 241, .18);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent);
}

.product-img-wrap {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img { transform: scale(1.05); }

.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    opacity: 0.3;
    color: var(--text-dim);
}

.product-img-wrap.has-image .image-fallback,
.pd-img-wrap.has-image .image-fallback {
    display: none;
}

.product-img-wrap.image-missing .image-fallback,
.pd-img-wrap.image-missing .image-fallback {
    display: flex;
}

.stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.stock-badge.out { background: var(--danger); color: #fff; }
.stock-badge.low { background: var(--warning); color: #000; }

.product-info {
    padding: 14px 16px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 8px var(--product-glow-color), 0 0 18px var(--product-glow-color);
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.product-sales {
    font-size: 12px;
    color: var(--text-dim);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.site-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-dim);
}

.site-footer p {
    color: rgba(226, 232, 240, .68);
    text-shadow: 0 0 10px var(--product-glow-color), 0 0 24px var(--product-glow-color);
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.pd-img-wrap {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.pd-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    opacity: 0.3;
    color: var(--text-dim);
}

.pd-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--product-glow-color), 0 0 26px var(--product-glow-color);
}

.pd-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pd-price-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pd-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.pd-stock {
    font-size: 13px;
    color: var(--text-muted);
}

.sku-select-section {
    margin-bottom: 16px;
}

.sku-section-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.sku-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sku-option-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sku-option-btn:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 4px 8px rgba(0,212,170,0.15);
    transform: translateY(-1px);
}

.sku-option-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.sku-option-btn.soldout {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.sku-opt-name {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sku-opt-price {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.buy-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 8px;
}

.wholesale-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.wholesale-box h4 {
    font-size: 13px;
    color: var(--warning);
    margin-bottom: 10px;
}

.wholesale-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wholesale-item {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.ws-price { color: var(--accent); font-weight: 600; }

.pd-desc {
    margin-bottom: 20px;
}

.pd-desc h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.pd-desc p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.pd-desc-rich {
    display: grid;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    word-break: break-word;
}

.pd-desc-rich p {
    margin: 0;
}

.pd-desc-rich .rich-gap {
    height: 2px;
}

.pd-desc-rich img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.pd-buy-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.buy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.buy-row label {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 70px;
    flex-shrink: 0;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-control button {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: background var(--transition);
}

.qty-control button:hover { background: var(--border); }

.qty-control input {
    width: 60px;
    height: 36px;
    text-align: center;
    background: var(--bg-primary);
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.buy-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}

.buy-input:focus { border-color: var(--accent); }

.pay-type-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pay-type-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.pay-type-item:hover { border-color: var(--accent); }

.pay-type-item input[type="radio"] { accent-color: var(--accent); }

.pay-type-label { font-size: 13px; color: var(--text-secondary); }

.send-email-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.send-email-option:hover { border-color: var(--accent); }
.send-email-option input { accent-color: var(--accent); }

.buy-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.total-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.btn-buy {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    margin-top: 8px;
}

.pd-soldout {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 14px;
}

/* Query Page */
.query-page {
    max-width: 600px;
    margin: 0 auto 40px;
}

.query-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.query-box h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.query-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.query-form {
    text-align: left;
}

.query-form .form-group {
    margin-bottom: 14px;
}

.query-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.query-form .form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}

.query-form .form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.query-form .btn { width: 100%; margin-top: 8px; padding: 11px; }

.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.result-header h3 { font-size: 15px; color: var(--text-primary); }

.result-body {
    padding: 16px 20px;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
}

.result-row + .result-row { border-top: 1px solid var(--border); }

.result-label { color: var(--text-muted); }

.result-row code {
    color: var(--accent);
    font-size: 12px;
}

.result-cards {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.result-cards h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 12px;
}

.cards-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: left;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Result page (pay return) */
.result-container {
    max-width: 500px;
    margin: 40px auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.result-icon.success { background: var(--accent-dim); color: var(--accent); }
.result-icon.pending { background: var(--warning); color: #000; }
.result-icon.error { background: var(--danger-dim); color: var(--danger); }
.result-icon.info { background: var(--info); color: #fff; }

.result-container h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.result-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.result-order-info {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row code { color: var(--accent); font-size: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,212,170,.25); }
.btn-ghost { background: var(--bg-tertiary); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-0 { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-1 { background: var(--accent-dim); color: var(--accent); }
.badge-2 { background: rgba(59,130,246,.12); color: var(--info); }
.badge-3 { background: var(--danger-dim); color: var(--danger); }
.badge-4 { background: rgba(168,85,247,.12); color: #a855f7; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px) scale(.95);
    transition: transform .25s ease;
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.modal-body { padding: 20px; }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: toastIn .3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,.3);
}

.toast-success { background: var(--accent); color: var(--bg-primary); }
.toast-error { background: var(--danger); color: #fff; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 隐藏数字输入框的上下箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-detail { grid-template-columns: 1fr; gap: 20px; }
    .pd-name { font-size: 20px; }
    .pd-price { font-size: 24px; }
    .buy-row { flex-direction: column; align-items: stretch; gap: 6px; }
    .buy-row label { min-width: auto; }
    .pay-type-list { flex-direction: column; }
    .header-nav { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .product-name { font-size: 13px; }
    .product-price { font-size: 16px; }
    .page-wrap { padding: 0 12px; }
}

/* NFA CLI动画样式 */
.nfa-pickup-container {
    margin-top: 16px;
}

.nfa-cli-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    animation: cliFadeIn 0.3s ease;
}

@keyframes cliFadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.nfa-cli-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nfa-cli-icon.loading {
    animation: cliSpin 1s linear infinite;
}

@keyframes cliSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nfa-cli-text {
    color: var(--text-secondary);
}

/* NFA结果卡片 */
.nfa-result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    animation: cliFadeIn 0.3s ease;
}

.nfa-result-card h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 12px;
}

.nfa-input-group {
    margin-bottom: 12px;
}

.nfa-input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.nfa-result-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 12px;
    resize: none;
}

.nfa-token-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nfa-token-row .nfa-result-input {
    flex: 1;
}

.nfa-token-row input.nfa-result-input {
    height: 38px;
    resize: none;
}

.nfa-copy-btn {
    flex-shrink: 0;
}

/* NFA已取账号列表 */
.nfa-cards-result {
    margin-top: 20px;
}

.nfa-cards-result h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.nfa-card-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.nfa-card-item h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 12px;
}

.nfa-pickup-actions {
    text-align: center;
    margin: 16px 0;
}

/* NFA结果容器在result-container内 */
.result-container .nfa-pickup-container {
    text-align: left;
    max-width: 500px;
    margin: 16px auto;
}

.result-container .nfa-cards-result {
    text-align: left;
}

.delivery-message-section {
    margin-top: 16px;
}

.delivery-message-box {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.delivery-message-box a {
    color: var(--accent);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

body.store-home {
    position: relative;
    background: var(--bg-primary);
}

body.store-home::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(rgba(15,17,23,.78), rgba(15,17,23,.92)), var(--site-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.store-home::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 18% 8%, rgba(0,212,170,.08), transparent 30%), radial-gradient(circle at 85% 18%, rgba(59,130,246,.06), transparent 28%);
}

body.theme-sakura {
    --accent: #ff77b7;
    --accent-hover: #ff9aca;
    --accent-dim: rgba(255, 119, 183, 0.14);
    --border-hover: rgba(255, 119, 183, 0.38);
}

body.theme-sakura.store-home::before {
    background-image: linear-gradient(rgba(15,17,23,.72), rgba(15,17,23,.9)), var(--site-bg-image, none);
}

body.theme-sakura.store-home::after {
    background: radial-gradient(circle at 18% 8%, rgba(255,119,183,.18), transparent 32%), radial-gradient(circle at 86% 22%, rgba(255,188,214,.12), transparent 30%);
}

.site-header, .product-card, .announcement, .cat-tab, .query-box, .result-card, .pd-buy-box, .pd-price-box, .music-player {
    backdrop-filter: blur(12px);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover, .theme-toggle.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.aero-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(249, 115, 22, .9);
    backdrop-filter: blur(28px) saturate(130%);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
    isolation: isolate;
    transition: opacity .68s ease, visibility .68s ease;
    animation: aeroGlassClear 3s cubic-bezier(.16, 1, .3, 1) forwards;
}

.aero-splash::before,
.aero-splash::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.aero-splash::before {
    z-index: 1;
    background: linear-gradient(90deg, #ea580c 0%, #f97316 44%, rgba(251, 146, 60, .9) 72%, rgba(251, 146, 60, 0) 100%);
    box-shadow: 42px 0 80px rgba(124, 45, 18, .28);
    transform: translateX(0);
    animation: aeroOrangeCurtain 2.72s cubic-bezier(.22, 1, .36, 1) forwards;
}

.aero-splash::after {
    z-index: 2;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 247, 237, .18) 24%, rgba(255, 247, 237, .05) 58%, transparent 82%);
    opacity: .88;
    transform: translateX(-62%);
    animation: aeroGlassSheen 2.5s cubic-bezier(.16, 1, .3, 1) forwards;
}

.aero-splash.hide {
    opacity: 0;
    visibility: hidden;
}

.aero-splash-logo {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    gap: 22px;
    transform: translateX(-76px) scale(.96);
    opacity: 0;
    animation: aeroLogoEnter 1.36s cubic-bezier(.16, 1, .3, 1) .12s forwards;
}

.aero-orbit {
    position: relative;
    width: 136px;
    height: 136px;
    display: grid;
    place-items: center;
}

.aero-orbit-ring {
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 247, 237, .58);
    border-left-color: rgba(255, 255, 255, 0);
    border-bottom-color: rgba(255, 255, 255, 0);
    border-radius: 50%;
    transform: rotateX(62deg) rotateZ(-28deg);
    animation: aeroOrbitSpin 2.5s cubic-bezier(.16, 1, .3, 1) forwards;
}

.aero-orbit-ring:nth-child(2) {
    inset: 24px;
    border-color: rgba(255, 237, 213, .38);
    border-right-color: rgba(255, 255, 255, 0);
    transform: rotateX(58deg) rotateZ(38deg);
    animation-delay: .12s;
}

.aero-globe-core {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 32% 26%, #fff7ed 0 10%, #fdba74 24%, #f97316 52%, #9a3412 100%);
    box-shadow: inset -18px -14px 30px rgba(124, 45, 18, .32), 0 0 0 1px rgba(255, 247, 237, .28), 0 18px 54px rgba(124, 45, 18, .35);
    transform: scale(.55) rotate(-18deg);
    opacity: 0;
    animation: aeroGlobePop 1.16s cubic-bezier(.16, 1, .3, 1) .22s forwards;
}

.aero-globe-core::before,
.aero-globe-core::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 247, 237, .36);
}

.aero-globe-core::before {
    width: 94px;
    height: 16px;
    left: -11px;
    top: 28px;
    transform: rotate(-16deg);
}

.aero-globe-core::after {
    width: 18px;
    height: 92px;
    left: 27px;
    top: -10px;
    transform: rotate(12deg);
}

.aero-splash-word {
    display: flex;
    gap: 12px;
    color: #fff7ed;
    font-size: 76px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 18px 45px rgba(124, 45, 18, .38);
}

.aero-splash-word span {
    opacity: 0;
    filter: blur(10px);
    transform: translateX(-126px) scale(.9);
    animation: aeroLetterReveal 1.08s cubic-bezier(.16, 1, .3, 1) forwards;
}

.aero-splash-word span:nth-child(2) { animation-delay: .16s; }
.aero-splash-word span:nth-child(3) { animation-delay: .32s; }
.aero-splash-word span:nth-child(4) { animation-delay: .48s; }

@keyframes aeroGlassClear {
    0% {
        background: rgba(249, 115, 22, .92);
        backdrop-filter: blur(28px) saturate(130%);
        -webkit-backdrop-filter: blur(28px) saturate(130%);
    }
    58% {
        background: rgba(249, 115, 22, .3);
        backdrop-filter: blur(10px) saturate(112%);
        -webkit-backdrop-filter: blur(10px) saturate(112%);
    }
    100% {
        background: rgba(249, 115, 22, 0);
        backdrop-filter: blur(0) saturate(100%);
        -webkit-backdrop-filter: blur(0) saturate(100%);
    }
}

@keyframes aeroOrangeCurtain {
    0% { opacity: 1; transform: translateX(0); }
    38% { opacity: .98; transform: translateX(10%); }
    100% { opacity: 0; transform: translateX(116%); }
}

@keyframes aeroGlassSheen {
    0% { opacity: .88; transform: translateX(-62%); }
    100% { opacity: 0; transform: translateX(80%); }
}

@keyframes aeroLogoEnter {
    0% { opacity: 0; transform: translateX(-76px) scale(.96); }
    72% { opacity: 1; transform: translateX(10px) scale(1); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes aeroGlobePop {
    0% { opacity: 0; transform: scale(.55) rotate(-18deg); }
    72% { opacity: 1; transform: scale(1.06) rotate(8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes aeroOrbitSpin {
    0% { opacity: 0; transform: rotateX(62deg) rotateZ(-116deg); }
    24% { opacity: 1; }
    100% { opacity: .72; transform: rotateX(62deg) rotateZ(244deg); }
}

@keyframes aeroLetterReveal {
    0% { opacity: 0; filter: blur(10px); transform: translateX(-126px) scale(.9); }
    68% { opacity: 1; filter: blur(0); transform: translateX(10px) scale(1.03); }
    100% { opacity: 1; filter: blur(0); transform: translateX(0) scale(1); }
}

.sakura-layer {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.sakura-petal {
    position: absolute;
    top: -32px;
    width: var(--petal-size, 14px);
    height: var(--petal-size, 14px);
    border-radius: 70% 20% 70% 30%;
    background: linear-gradient(135deg, #ffd7e7 0%, #ff8fc3 70%);
    opacity: .82;
    transform: rotate(24deg);
    animation: sakuraFall var(--fall-duration, 12s) linear var(--fall-delay, 0s) infinite;
    box-shadow: 0 0 10px rgba(255, 143, 195, .22);
}

@keyframes sakuraFall {
    0% { transform: translate3d(0, -40px, 0) rotate(0deg); }
    50% { transform: translate3d(var(--drift, 70px), 50vh, 0) rotate(180deg); }
    100% { transform: translate3d(calc(var(--drift, 70px) * -1), calc(100vh + 60px), 0) rotate(360deg); }
}

.music-player {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    width: min(320px, calc(100vw - 32px));
    background: rgba(26, 29, 39, .9);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.music-player-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.music-player-head button {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
}

.music-player.collapsed .music-player-body { display: none; }
.music-player.collapsed .music-player-head { border-bottom: 0; }

.music-player-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.music-select {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    outline: none;
}

.music-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-controls button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.music-track {
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-info { background: var(--info); color: #fff; }

@media (max-width: 768px) {
    .aero-splash-word { font-size: 54px; gap: 8px; }
    .aero-splash-logo { gap: 16px; }
    .aero-orbit { width: 112px; height: 112px; }
    .aero-globe-core { width: 62px; height: 62px; }
    .music-player { right: 12px; bottom: 12px; }
    .theme-toggle { padding: 6px 9px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .aero-splash-word span, .aero-splash-logo, .aero-orbit-ring, .aero-globe-core, .sakura-petal { animation: none; }
    .aero-splash { display: none; }
}

/* Support center */
.support-shell { max-width: 1120px; margin: 0 auto; }
.support-hero { margin: 10px 0 22px; }
.support-hero h1 { color: var(--text-primary); font-size: 28px; margin-bottom: 8px; }
.support-hero p { color: var(--text-muted); font-size: 14px; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.support-card, .support-thread {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.support-card h2, .support-thread h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 16px;
}
.support-divider { height: 1px; background: var(--border); margin: 22px 0; }
.support-thread { margin-top: 18px; }
.support-thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.support-thread-head p { margin-top: 4px; color: var(--text-dim); font-size: 12px; }
.support-status {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.support-messages {
    max-height: 420px;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding: 14px;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, .08), transparent 42%),
        rgba(0, 0, 0, .18);
    border: 1px solid rgba(125, 211, 252, .12);
    border-radius: 16px;
}
.support-message { max-width: min(78%, 680px); }
.support-message.admin { justify-self: end; }
.support-message-meta { color: var(--text-dim); font-size: 11px; margin-bottom: 6px; }
.support-message.admin .support-message-meta { text-align: right; }
.support-message-body {
    padding: 12px 14px;
    border-radius: 16px 16px 16px 6px;
    background: linear-gradient(180deg, rgba(30, 41, 59, .92), rgba(15, 23, 42, .9));
    border: 1px solid rgba(148, 163, 184, .14);
    color: #e2e8f0;
    word-break: break-word;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.support-message.admin .support-message-body {
    background: linear-gradient(135deg, rgba(34, 211, 238, .92), rgba(99, 102, 241, .88));
    color: #041018;
    border-color: transparent;
    border-radius: 16px 16px 6px 16px;
    box-shadow: 0 12px 28px rgba(34, 211, 238, .18);
}
.support-reply {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}
.support-reply-main { display: grid; gap: 8px; min-width: 0; }
.support-reply .btn { height: 44px; min-width: 92px; }

.support-live-panel {
    position: relative;
    overflow: hidden;
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 18px;
    background: rgba(17, 24, 39, .62);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.support-live-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, rgba(0, 212, 170, .14), transparent 38%, rgba(59, 130, 246, .12));
}

body.theme-sakura .support-live-panel::before {
    background: linear-gradient(110deg, rgba(255, 119, 183, .18), transparent 38%, rgba(125, 211, 252, .1));
}

.support-live-head,
.support-live-grid {
    position: relative;
    z-index: 1;
}

.support-live-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    color: var(--text-primary);
}

.support-live-head strong {
    font-size: 14px;
}

.support-live-head em {
    margin-left: auto;
    padding: 3px 8px;
    border: 1px solid rgba(16, 185, 129, .32);
    border-radius: 999px;
    color: #6ee7b7;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.support-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, .78);
    animation: supportLivePulse 1.5s ease-in-out infinite;
}

@keyframes supportLivePulse {
    0%, 100% { opacity: .35; transform: scale(.86); }
    50% { opacity: 1; transform: scale(1); }
}

.support-live-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.support-live-item {
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(15, 23, 42, .52);
}

.support-live-item span,
.support-live-item small {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
}

.support-live-item strong {
    display: block;
    margin: 4px 0 2px;
    color: var(--text-primary);
    font-size: clamp(22px, 4vw, 32px);
    line-height: 1.1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.support-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 14px;
    background: rgba(15, 23, 42, .44);
}

.support-rating[hidden] {
    display: none;
}

.support-rating strong {
    display: block;
    color: var(--text-primary);
    font-size: 13px;
}

.support-rating span {
    color: var(--text-dim);
    font-size: 12px;
}

.support-stars {
    display: inline-flex;
    gap: 4px;
}

.support-star {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: rgba(148, 163, 184, .55);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
}

.support-star:hover,
.support-star.active {
    border-color: #facc15;
    background: rgba(250, 204, 21, .16);
    color: #facc15;
    box-shadow: 0 0 18px rgba(250, 204, 21, .22);
}

@media (max-width: 768px) {
    .support-grid { grid-template-columns: 1fr; }
    .support-thread-head { display: block; }
    .support-status { display: inline-block; margin-top: 10px; }
    .support-reply { grid-template-columns: 1fr; }
    .support-message { max-width: 92%; }
    .support-live-grid { grid-template-columns: 1fr 1fr; }
    .support-rating { align-items: flex-start; flex-direction: column; }
}

/* Final responsive polish */
.site-header {
    margin: 18px auto 24px;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 28px;
    background: rgba(17, 24, 39, .58);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.header-inner {
    gap: 14px;
    min-width: 0;
}

.site-brand,
.header-nav {
    min-width: 0;
}

.header-nav {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.header-nav::-webkit-scrollbar { display: none; }

.nav-link,
.theme-toggle {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
}

.theme-toggle {
    background: rgba(35, 38, 54, .72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast-container {
    width: min(320px, calc(100vw - 32px));
}

.toast {
    width: 100%;
    word-break: break-word;
}

body.support-page {
    background-image: linear-gradient(rgba(15, 17, 23, .74), rgba(15, 17, 23, .92)), var(--site-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.support-page .support-card,
.support-page .support-thread {
    background: rgba(17, 24, 39, .58);
    border-color: rgba(148, 163, 184, .18);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.support-thread-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.support-reply textarea:disabled {
    opacity: .65;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .page-wrap {
        width: 100%;
        padding: 0 14px;
    }

    .site-header {
        margin-top: 10px;
        padding: 10px;
        border-radius: 22px;
    }

    .header-inner {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }

    .site-brand {
        justify-content: center;
    }

    .brand-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 18px;
    }

    .header-nav {
        justify-content: flex-start;
        padding: 4px;
        border: 1px solid rgba(148, 163, 184, .14);
        border-radius: 999px;
        background: rgba(15, 17, 23, .36);
    }

    .nav-link,
    .theme-toggle {
        min-height: 34px;
        padding: 6px 11px;
        font-size: 12px;
        flex: 0 0 auto;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pd-img-wrap {
        aspect-ratio: 16 / 10;
        max-height: 360px;
    }

    .pd-price-box {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 14px;
    }

    .pd-buy-box {
        padding: 16px;
    }

    .buy-row {
        align-items: stretch;
        gap: 8px;
    }

    .buy-row label {
        min-width: 0;
    }

    .buy-row > .buy-input,
    .buy-row > div {
        width: 100%;
    }

    .qty-control {
        width: fit-content;
        max-width: 100%;
    }

    .pay-type-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .pay-type-item,
    .send-email-option {
        min-height: 40px;
        justify-content: center;
    }

    .support-hero h1 {
        font-size: 24px;
    }

    .support-thread-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .support-thread-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-img-wrap {
        aspect-ratio: 1 / .78;
    }

    .product-info {
        padding: 11px 12px;
    }

    .product-meta {
        align-items: flex-start;
        gap: 6px;
    }

    .product-sales {
        font-size: 11px;
    }

    .pd-name {
        font-size: 21px;
        line-height: 1.25;
    }

    .pd-price {
        font-size: 25px;
    }

    .pd-img-placeholder {
        font-size: 64px;
    }

    .pay-type-list {
        grid-template-columns: 1fr;
    }

    .support-live-grid {
        grid-template-columns: 1fr;
    }

    .support-live-item {
        padding: 12px;
    }

    .toast-container {
        top: auto;
        right: 12px;
        left: 12px;
        bottom: 14px;
        width: auto;
    }

    .toast {
        animation-name: toastUp;
    }

    @keyframes toastUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}


/* ---------- Chat images / attach ---------- */
.chat-rich { display: grid; gap: 8px; }
.chat-text { line-height: 1.55; white-space: normal; }
.chat-image-link {
    display: inline-block;
    max-width: min(100%, 280px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.chat-image {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    background: rgba(0,0,0,.2);
}
.chat-attach-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.chat-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(103, 232, 249, .24);
    background: rgba(34, 211, 238, .08);
    color: #a5f3fc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: .18s ease;
}
.chat-attach-btn:hover {
    border-color: rgba(103, 232, 249, .5);
    background: rgba(34, 211, 238, .16);
    transform: translateY(-1px);
}
.chat-attach-hint {
    color: #64748b;
    font-size: 12px;
}
.chat-attach-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chat-attach-item {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .8);
}
.chat-attach-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-attach-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    cursor: pointer;
}
.support-admin-message-body.chat-rich,
.ai-support-message-body.chat-rich {
    overflow: hidden;
}
