/* =========================================================
   CAPST Newsroom v2 — Premium 3D Tech Aesthetic
   Layered depth · volumetric light · scientific precision
   ========================================================= */

:root {
    --bg: #05080f;
    --bg2: #0a0f1a;
    --surface: rgba(12, 18, 32, 0.72);
    --surface-hi: rgba(16, 24, 42, 0.85);
    --border: rgba(80, 130, 200, 0.10);
    --border-hot: rgba(90, 160, 255, 0.35);
    --txt: #e4e9f0;
    --txt2: #7a8ba0;
    --txt-dim: #4a5568;
    --accent: #5B8DEF;
    --accent2: #00D4AA;
    --accent3: #F0A050;
    --glow: rgba(91, 141, 239, 0.15);
    --glow2: rgba(0, 212, 170, 0.10);
    --radius: 16px;
    --radius-sm: 10px;
    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--txt);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ============================================================
   BACKGROUND LAYERS — volumetric depth
   ============================================================ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Grid */
.bg-grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(91,141,239,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,141,239,0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
    animation: gridDrift 30s ease-in-out infinite;
}
@keyframes gridDrift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 15px); }
}

/* Noise texture */
.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* Volumetric orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orbFloat 12s ease-in-out infinite;
}
.bg-orb-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(91,141,239,0.18), transparent 70%);
    top: -15%; left: -10%;
}
.bg-orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0,212,170,0.12), transparent 70%);
    bottom: -10%; right: -8%;
    animation-delay: -4s;
}
.bg-orb-3 {
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(100,100,240,0.10), transparent 70%);
    top: 40%; left: 50%;
    animation-delay: -8s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* Scan lines */
.bg-lines { position: absolute; inset: 0; overflow: hidden; }
.bg-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91,141,239,0.06), transparent);
    animation: scanDown 8s linear infinite;
}
.bg-line:nth-child(1) { top: 10%; animation-delay: 0s; }
.bg-line:nth-child(2) { top: 30%; animation-delay: -2s; }
.bg-line:nth-child(3) { top: 50%; animation-delay: -4s; }
.bg-line:nth-child(4) { top: 70%; animation-delay: -6s; }
.bg-line:nth-child(5) { top: 90%; animation-delay: -1s; }
@keyframes scanDown {
    0% { transform: translateY(-100vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Particle canvas */
.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
.app {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    padding: 22px 0;
    animation: slideDown 0.7s var(--ease) both;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
    width: 40px; height: 40px;
    animation: brandSpin 40s linear infinite;
    filter: drop-shadow(0 0 8px rgba(91,141,239,0.3));
}
@keyframes brandSpin {
    to { transform: rotate(360deg); }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-en {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand-cn {
    font-size: 0.68rem;
    color: var(--txt-dim);
    font-weight: 400;
    letter-spacing: 0.05em;
}

.nav { display: flex; align-items: center; gap: 2px; }

.nav-a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--txt2);
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.25s var(--ease);
    position: relative;
}
.nav-a:hover {
    color: var(--txt);
    background: rgba(91,141,239,0.06);
}
.nav-a.active {
    color: var(--accent);
    background: rgba(91,141,239,0.10);
}
.nav-a.rss { color: var(--accent3); }
.nav-a.rss:hover { background: rgba(240,160,80,0.08); }

/* ============================================================
   SERVER ERROR BANNER
   ============================================================ */
.server-error {
    margin-top: 12px;
    padding: 18px 24px;
    background: rgba(240, 160, 80, 0.08);
    border: 1px solid rgba(240, 160, 80, 0.25);
    border-radius: var(--radius);
    animation: fadeIn 0.5s var(--ease) both;
}

.server-error-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 600px;
    margin: 0 auto;
}

.server-error-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 160, 80, 0.12);
    border: 1px solid rgba(240, 160, 80, 0.2);
    border-radius: 50%;
    color: var(--accent3);
}

.server-error-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.84rem;
    color: var(--txt2);
    line-height: 1.5;
}

.server-error-text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent3);
}

.server-error-text code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    background: rgba(91, 141, 239, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 5px;
    display: inline-block;
    margin: 4px 0;
    border: 1px solid rgba(91, 141, 239, 0.15);
}

.server-error-text a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(91, 141, 239, 0.3);
}

.server-error-text a:hover {
    border-color: var(--accent);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    padding: 80px 0 50px;
    perspective: 800px;
}

.hero-float {
    animation: heroIn 1s var(--ease) 0.15s both;
}
@keyframes heroIn {
    from { opacity: 0; transform: translateY(30px) rotateX(5deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(91,141,239,0.08);
    border: 1px solid rgba(91,141,239,0.18);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 28px;
}
.hero-badge-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent);
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.8); }
}

.hero-h1 {
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 22px;
}
.hero-line {
    display: block;
    overflow: hidden;
}
.hero-line span, .hero-line {
    animation: lineUp 0.7s var(--ease) both;
}
.hero-line:nth-child(1) { animation-delay: 0.3s; }
.hero-line:nth-child(2) { animation-delay: 0.45s; }
.hero-line:nth-child(3) { animation-delay: 0.6s; }
@keyframes lineUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

.grad-text {
    background: linear-gradient(135deg, var(--accent) 30%, var(--accent2) 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1rem;
    color: var(--txt2);
    max-width: 520px;
    margin-bottom: 36px;
    animation: fadeIn 0.8s var(--ease) 0.8s both;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    animation: fadeIn 0.8s var(--ease) 1s both;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--txt), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--txt-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.stat-divider {
    width: 1px; height: 32px;
    background: var(--border);
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap {
    padding: 0 0 36px;
    animation: fadeIn 0.6s var(--ease) 0.5s both;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 18px;
    transition: all 0.35s var(--ease);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 4px 24px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
.search:focus-within {
    border-color: var(--border-hot);
    box-shadow:
        0 0 0 4px rgba(91,141,239,0.08),
        0 8px 32px rgba(91,141,239,0.10),
        inset 0 1px 0 rgba(255,255,255,0.04);
}
.search-ic {
    color: var(--txt-dim);
    flex-shrink: 0;
    transition: color 0.3s;
}
.search:focus-within .search-ic { color: var(--accent); }

#searchInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 15px 12px;
    font-size: 0.92rem;
    color: var(--txt);
    font-family: inherit;
}
#searchInput::placeholder { color: var(--txt-dim); }

.search-kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--txt-dim);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 5px;
}

/* ============================================================
   MAIN / POSTS GRID
   ============================================================ */
.main { padding: 0 0 80px; }

.main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}
.main-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--txt2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--txt2);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    font-family: inherit;
}
.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(91,141,239,0.05);
}
.tag.active {
    background: rgba(91,141,239,0.10);
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- 3D Card Grid ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 18px;
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    cursor: pointer;
    transition: all 0.4s var(--ease);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: cardIn 0.5s var(--ease) both;
    overflow: hidden;
    transform-style: preserve-3d;
    transform: perspective(800px) rotateX(0deg);

    box-shadow:
        0 2px 8px rgba(0,0,0,0.15),
        0 8px 32px rgba(0,0,0,0.10),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
@keyframes cardIn {
    from { opacity: 0; transform: perspective(800px) rotateX(3deg) translateY(24px); }
    to { opacity: 1; transform: perspective(800px) rotateX(0deg) translateY(0); }
}

/* Top gradient line */
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
    transform: scaleX(0);
    transition: transform 0.5s var(--ease);
}
.card:hover::before { transform: scaleX(1); }

/* Glow on hover */
.card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(91,141,239,0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: -1;
}
.card:hover::after { opacity: 1; }

.card:hover {
    border-color: var(--border-hot);
    background: var(--surface-hi);
    transform: perspective(800px) rotateX(-1deg) translateY(-4px);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.2),
        0 16px 64px rgba(91,141,239,0.08),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.72rem;
    color: var(--txt-dim);
}
.card-meta svg { flex-shrink: 0; }

.card-tag {
    padding: 2px 10px;
    font-size: 0.66rem;
    font-weight: 500;
    border-radius: 100px;
    background: rgba(91,141,239,0.08);
    color: var(--accent);
    border: 1px solid rgba(91,141,239,0.12);
}

.card-h {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
    transition: color 0.3s;
}
.card:hover .card-h { color: var(--accent); }

.card-p {
    font-size: 0.85rem;
    color: var(--txt2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 0.74rem;
    color: var(--txt-dim);
}
.card-foot svg { flex-shrink: 0; }

.card-more {
    margin-left: auto;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.3s;
}
.card:hover .card-more { gap: 8px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--txt-dim);
    grid-column: 1 / -1;
    justify-self: stretch;
}
.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border: 1px solid var(--border);
    border-radius: 50%;
    margin-bottom: 16px;
}
.empty-text { font-size: 0.9rem; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-bg {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    background: rgba(3, 5, 10, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease);
    overflow-y: auto;
}
.modal-bg.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 760px;
    background: linear-gradient(180deg, var(--bg2), var(--bg));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 52px 44px;
    transform: translateY(40px) scale(0.96);
    transition: transform 0.4s var(--ease-bounce);
    box-shadow:
        0 24px 80px rgba(0,0,0,0.5),
        0 0 0 1px rgba(91,141,239,0.05),
        inset 0 1px 0 rgba(255,255,255,0.03);
}
.modal-bg.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-x {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--txt2);
    cursor: pointer;
    transition: all 0.3s;
}
.modal-x:hover {
    background: rgba(255,255,255,0.08);
    color: var(--txt);
    border-color: var(--txt-dim);
}

/* Modal content typography */
.modal-body { line-height: 1.85; }
.modal-body h1 {
    font-size: 1.9rem;
    font-weight: 900;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.modal-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--accent);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.modal-body h3 { font-size: 1.05rem; font-weight: 700; margin: 28px 0 12px; }
.modal-body p { margin-bottom: 16px; color: var(--txt2); font-size: 0.94rem; }
.modal-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(91,141,239,0.25);
    transition: border-color 0.25s;
}
.modal-body a:hover { border-color: var(--accent); }
.modal-body strong { color: var(--txt); font-weight: 600; }
.modal-body ul, .modal-body ol { margin: 12px 0 18px 22px; color: var(--txt2); }
.modal-body li { margin-bottom: 6px; font-size: 0.9rem; }
.modal-body blockquote {
    margin: 20px 0;
    padding: 18px 22px;
    border-left: 3px solid var(--accent);
    background: rgba(91,141,239,0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--txt2);
    font-style: italic;
}
.modal-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84em;
    background: rgba(91,141,239,0.08);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--accent);
}
.modal-body pre {
    margin: 18px 0;
    padding: 18px 22px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.modal-body pre code { background: none; padding: 0; color: var(--txt); font-size: 0.84rem; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.modal-body img { max-width: 100%; border-radius: var(--radius-sm); margin: 18px 0; border: 1px solid var(--border); }
.modal-body table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.modal-body th, .modal-body td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; font-size: 0.86rem; }
.modal-body th { background: rgba(91,141,239,0.06); color: var(--txt); font-weight: 600; }

.modal-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.76rem;
    color: var(--txt-dim);
    flex-wrap: wrap;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #4a7ee0);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(91,141,239,0.3);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--txt2);
    border-color: var(--border);
}
.btn-ghost:hover {
    border-color: var(--txt-dim);
    color: var(--txt);
    background: rgba(255,255,255,0.03);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    padding: 44px 0;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.6s var(--ease) 1.2s both;
}
.footer-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.76rem;
    color: var(--txt-dim);
    flex-wrap: wrap;
}
.footer-brand {
    font-weight: 700;
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-sep { opacity: 0.3; }

/* ============================================================
   LOADER
   ============================================================ */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s, visibility 0.6s;
}
.loader.hidden { opacity: 0; visibility: hidden; }

.loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-ring {
    width: 48px; height: 48px;
    border: 2px solid rgba(91,141,239,0.15);
    border-top-color: var(--accent);
    border-right-color: var(--accent2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

::selection { background: rgba(91,141,239,0.2); color: var(--txt); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    .grid { grid-template-columns: 1fr; }
    .hero { padding: 50px 0 36px; }
    .hero-stats { gap: 16px; }
    .modal-card { padding: 36px 22px; }
    .brand-cn { display: none; }
    .search-kbd { display: none; }
    .nav-a { padding: 6px 12px; font-size: 0.78rem; }
    .app { padding: 0 16px; }
}

@media (max-width: 420px) {
    .hero-h1 { font-size: 1.8rem; }
    .card { padding: 22px; }
}
