@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0e1a;
    --bg-elevated: #111827;
    --bg-card: #161f32;
    --border: #1e293b;
    --border-hover: #334155;
    --text: #e2e8f0;
    --text-dim: #64748b;
    --text-muted: #475569;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --price: #f97316;
    --price-glow: rgba(249, 115, 22, 0.2);
    --tag: #0ea5e9;
    --success: #22c55e;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --bg-elevated: #f8fafc;
        --bg-card: #ffffff;
        --border: #e2e8f0;
        --border-hover: #cbd5e1;
        --text: #1e293b;
        --text-dim: #64748b;
        --text-muted: #94a3b8;
        --accent: #2563eb;
        --accent-glow: rgba(37, 99, 235, 0.1);
        --price: #ea580c;
        --price-glow: rgba(234, 88, 12, 0.15);
        --tag: #0284c7;
        --success: #16a34a;
    }

    body {
        background: var(--bg);
        color: var(--text);
    }

    .header-badge {
        color: #fff;
    }

    .header h1 {
        color: #1e293b !important;
    }

    .card-config {
        color: #1e293b !important;
    }

    .spec-key {
        color: #64748b;
    }

    .modal-close {
        color: #64748b;
    }

    .modal-box h3 {
        color: #1e293b !important;
    }

    .modal-product-name {
        color: #1e293b !important;
    }

    .buy-btn {
        color: #fff;
    }

    .modal-warning {
        background: rgba(251, 191, 36, 0.1);
        border-color: rgba(251, 191, 36, 0.3);
    }

    .product-card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .product-card:hover {
        background: #f8fafc;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .modal-overlay {
        background: rgba(0, 0, 0, 0.5);
    }

    .modal-box {
        background: #fff;
        border-color: #e2e8f0;
    }

    .modal-close {
        background: #f8fafc;
        border-color: #e2e8f0;
        color: #64748b;
    }

    .modal-close:hover {
        border-color: #cbd5e1;
        color: #1e293b;
    }

    .modal-box h3 {
        color: #1e293b !important;
    }

    .modal-warning {
        color: #92400e;
        background: #fef3c7;
        border-color: #fcd34d;
    }

    .modal-product {
        background: #f8fafc;
        border-color: #e2e8f0;
    }

    .modal-product-name {
        color: #1e293b !important;
    }

    .modal-product-price {
        color: #ea580c;
    }

    .modal-product-price span {
        color: #94a3b8;
    }

    .modal-product-region {
        color: #64748b;
    }

    .modal-hint {
        color: #2563eb;
    }

    .top-notice {
        color: #fff;
    }

    .footer {
        color: #64748b;
    }

    .footer-icp a,
    .footer-police a {
        color: #64748b;
    }

    .header h1 {
        color: #1e293b !important;
    }

    .section-header h2 {
        color: #1e293b !important;
    }

    .product-card:hover {
        background: #f8fafc !important;
    }

    .region-tab:not(.active) {
        background: #fff;
        color: #64748b;
    }

    .price-tag {
        background: #f8fafc;
    }
}

body {
    font-family: "JetBrains Mono", "SF Mono", "Cascadia Code", "Fira Code", monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.top-notice {
    background: #dc2626;
    color: #fff;
    text-align: center;
    padding: 10px 24px;
    font-size: 0.78rem;
    font-weight: 500;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.header-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.header-meta {
    display: flex;
    gap: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.header-meta span::before {
    content: "›";
    color: var(--accent);
    margin-right: 6px;
}

/* ===== REGION SELECTOR ===== */
.region-selector {
    margin-bottom: 32px;
}

.region-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    font-weight: 600;
}

.region-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.region-tab {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    position: relative;
}

.region-tab:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.region-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.region-tab.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--accent);
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.product-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px;
    position: relative;
    transition: all 0.15s ease;
}

.product-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--border);
    transition: background 0.15s ease;
}

.product-card:hover {
    border-color: var(--border-hover);
    background: #1a2438;
}

.product-card:hover::before {
    background: var(--accent);
}

.card-config {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.4;
}

.card-note {
    display: inline-block;
    background: rgba(249, 115, 22, 0.15);
    color: var(--price);
    font-size: 0.65rem;
    padding: 1px 6px;
    margin-left: 6px;
    font-weight: 600;
}

.card-region {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.card-divider {
    height: 1px;
    background: var(--border);
    margin: 0 0 16px 0;
}

.card-specs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.spec-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.spec-key {
    color: var(--text-muted);
    min-width: 40px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec-val {
    color: var(--text);
    font-weight: 500;
}

.spec-val.defense {
    color: var(--tag);
}

.card-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.price-symbol {
    font-size: 0.9rem;
    color: var(--price);
    font-weight: 600;
}

.price-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--price);
    line-height: 1;
}

.price-unit {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.price-tag {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border: 1px solid var(--border);
}

/* ===== BUY BUTTON ===== */
.buy-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.buy-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.buy-btn:active {
    transform: translateY(0);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 32px 40px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    position: relative;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
}

.modal-close:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.modal-box h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 700;
}

.modal-warning {
    font-size: 0.78rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 10px 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-product {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.modal-product-name {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--price);
}

.modal-product-price span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
}

.modal-product-region {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.modal-qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: #fff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-qrcode img {
    max-width: 100%;
    max-height: 100%;
}

.modal-hint {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 500;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px 0 40px;
    color: var(--text-muted);
    font-size: 0.7rem;
    border-top: 1px solid var(--border);
}

.footer-brand {
    margin-bottom: 8px;
}

.footer-icp,
.footer-police {
    margin-bottom: 6px;
    opacity: 0.7;
}

.footer-icp a:hover,
.footer-police a:hover {
    opacity: 0.8;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    .header {
        padding: 32px 0 24px;
    }
    .header h1 {
        font-size: 1.4rem;
    }
    .header-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
    .products-grid {
        grid-template-columns: 1fr;
    }
    .product-card {
        padding: 20px;
    }
    .payment-box {
        padding: 24px 32px;
    }
}
