/* Custom Fonts */
@font-face {
    font-family: 'ZhongWen';
    src: url('/font/zhongwen.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'RiYu';
    src: url('/font/riyu.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
/* ===================================================
   怪谈手记 - Kaidan Shuki
   Design System: Vercel Web Interface Guidelines
   Motion: LottieFiles Motion Design Skill (Premium)
   =================================================== */

/* === CSS Custom Properties === */
:root {
    /* Color System - Dark Horror Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #0d0d0d;
    --bg-elevated: #161616;
    
    --text-primary: #c5b8a0;
    --text-secondary: #8a7e6b;
    --text-dim: #4a4540;
    --text-inverse: #0a0a0a;
    
    --accent-red: #8b0000;
    --accent-red-light: #a52a2a;
    --accent-gold: #b89a5a;
    --accent-gold-light: #d4b86a;
    --accent-purple: #4a0080;
    --accent-purple-light: #6b3fa0;
    --accent-green: #2d5a27;
    --accent-green-light: #3d7a37;
    
    --border-dark: #1a1a1a;
    --border-light: #2a2520;
    --border-focus: #b89a5a;
    
    /* Motion Design - Premium Personality */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Duration Palette */
    --duration-quick: 150ms;
    --duration-standard: 300ms;
    --duration-slow: 500ms;
    --duration-dramatic: 800ms;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-serif: 'ZhongWen', 'RiYu', 'Noto Serif SC', 'Noto Serif JP', serif;
    --font-mono: 'Source Code Pro', 'Fira Code', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.6);
    
    /* Safe areas for notches */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* === Dark Mode Support === */
html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-serif);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* === Skip Link (Accessibility) === */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-gold);
    color: var(--text-inverse);
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 4px;
    transition: top var(--duration-quick) var(--ease-out);
}

.skip-link:focus {
    top: 0;
}

/* === Screen Reader Only === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === Focus States (Vercel Guidelines) === */
*:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* === Noise Overlay === */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* === Glitch Character Effect === */
.glitch-char {
    position: relative;
    display: inline-block;
    animation: glitch-flicker 8s var(--ease-in-out) infinite;
}

.glitch-char::before {
    content: attr(data-alt);
    position: absolute;
    inset: 0;
    color: var(--accent-red);
    opacity: 0;
    animation: glitch-alt 8s var(--ease-in-out) infinite;
}

@keyframes glitch-flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.8; }
    97% { opacity: 1; }
    98% { opacity: 0.6; }
    99% { opacity: 1; }
}

@keyframes glitch-alt {
    0%, 94%, 100% { 
        opacity: 0; 
        transform: none;
    }
    95% { 
        opacity: 0.8; 
        transform: translate(-1px, 1px); 
    }
    96% { 
        opacity: 0; 
        transform: none;
    }
    97% { 
        opacity: 1; 
        transform: translate(1px, -1px); 
    }
    98% { 
        opacity: 0; 
        transform: none;
    }
    99% { 
        opacity: 0.6; 
        transform: translate(-1px, 0); 
    }
}

/* === Header === */
.site-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-dark);
    padding: var(--space-xl) 0;
    padding-top: calc(var(--space-xl) + var(--safe-area-top));
    /* Entrance animation */
    animation: header-enter var(--duration-slow) var(--ease-out) backwards;
}

.site-header.compact {
    padding: var(--space-lg) 0;
}

@keyframes header-enter {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.site-title {
    text-align: left;
}

.title-main {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    display: block;
    text-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
    /* Text balance for better typography */
    text-wrap: balance;
}

.title-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    display: block;
    margin-top: var(--space-xs);
}

.site-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--space-sm);
}

.site-title.small {
    font-size: 1.2rem;
}

.site-title.small a {
    color: var(--text-primary);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

/* === Language Switcher === */
.lang-switcher {
    display: flex;
    gap: var(--space-xs);
}

.lang-btn {
    color: var(--text-dim);
    text-decoration: none;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    border: 1px solid var(--border-dark);
    transition: all var(--duration-quick) var(--ease-out);
    white-space: nowrap;
}

.lang-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-secondary);
}

.lang-btn.active {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(184, 154, 90, 0.1);
}

.lang-btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* === Header Stats === */
.header-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat-item {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    /* Staggered entrance */
    animation: stat-enter var(--duration-standard) var(--ease-out) backwards;
}

.stat-item:nth-child(2) {
    animation-delay: 100ms;
}

@keyframes stat-enter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
}

.stat-item.danger .stat-num {
    color: var(--accent-red);
}

.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    /* Tabular numbers for alignment */
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

/* === Back Link === */
.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--duration-quick) var(--ease-out);
}

.back-link:hover {
    color: var(--text-primary);
}

/* === Filter Navigation === */
.filter-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-dark);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    /* Entrance animation */
    animation: nav-enter var(--duration-standard) var(--ease-out) backwards;
    animation-delay: 150ms;
    /* Prevent double-tap zoom on mobile */
    touch-action: manipulation;
}

@keyframes nav-enter {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
    transition: all var(--duration-quick) var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
    /* Hover state increases contrast */
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--text-dim);
    transform: translateY(-1px);
}

.nav-item.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--accent-gold);
}

.nav-icon {
    font-size: 0.7rem;
}

.nav-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

/* Classification colors */
.nav-item.class-safe.active { border-color: var(--accent-green); }
.nav-item.class-caution.active { border-color: #8b7355; }
.nav-item.class-danger.active { border-color: var(--accent-red); }
.nav-item.class-forbidden.active { border-color: var(--accent-purple); }

/* === Search Form === */
.search-form {
    margin-left: auto;
    display: flex;
}

.search-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    font-family: inherit;
    font-size: 0.85rem;
    width: 180px;
    transition: all var(--duration-quick) var(--ease-out);
    /* Placeholder ends with ellipsis */
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    width: 220px;
    box-shadow: 0 0 0 3px rgba(184, 154, 90, 0.1);
}

.search-btn {
    background: var(--border-light);
    border: 1px solid var(--border-light);
    border-left: none;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all var(--duration-quick) var(--ease-out);
}

.search-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* === Main Content === */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
    min-height: 60vh;
}

/* === Archive Grid === */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* === Archive Card === */
.archive-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    padding: var(--space-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--duration-standard) var(--ease-out);
    position: relative;
    overflow: hidden;
    display: block;
    /* Staggered entrance animation */
    animation: card-enter var(--duration-standard) var(--ease-out) backwards;
}

/* Staggered delay for cards */
.archive-card:nth-child(1) { animation-delay: 100ms; }
.archive-card:nth-child(2) { animation-delay: 150ms; }
.archive-card:nth-child(3) { animation-delay: 200ms; }
.archive-card:nth-child(4) { animation-delay: 250ms; }
.archive-card:nth-child(5) { animation-delay: 300ms; }
.archive-card:nth-child(6) { animation-delay: 350ms; }
.archive-card:nth-child(7) { animation-delay: 400ms; }
.archive-card:nth-child(8) { animation-delay: 450ms; }

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
}

/* Classification indicator */
.archive-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    opacity: 0.8;
    transition: opacity var(--duration-quick) var(--ease-out);
}

.archive-card.class-safe::before { background: var(--accent-green); }
.archive-card.class-caution::before { background: #8b7355; }
.archive-card.class-danger::before { background: var(--accent-red); }
.archive-card.class-forbidden::before { background: var(--accent-purple); }

/* Hover state - increases contrast */
.archive-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.archive-card:hover::before {
    opacity: 1;
}

.archive-card:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.card-class {
    font-size: 0.7rem;
    padding: var(--space-xs) var(--space-sm);
    color: #fff;
    font-weight: 600;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.4;
    /* Text balance for better typography */
    text-wrap: balance;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    /* Handle long content */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-dark);
}

.card-obj {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-dark);
}

.card-views {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.view-count {
    font-variant-numeric: tabular-nums;
}

/* === Archive Detail === */
.archive-detail {
    max-width: 900px;
}

.archive-article {
    /* Entrance animation */
    animation: article-enter var(--duration-slow) var(--ease-out) backwards;
}

@keyframes article-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.archive-header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

.archive-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.archive-code {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-dim);
}

.archive-class {
    font-size: 0.8rem;
    padding: var(--space-xs) var(--space-md);
    color: #fff;
    font-weight: 600;
}

.archive-obj {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border-light);
}

.archive-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    text-wrap: balance;
}

.archive-viewcount {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* === Tags === */
.archive-tags {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all var(--duration-quick) var(--ease-out);
}

.tag:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* === Archive Sections === */
.archive-section {
    margin-bottom: var(--space-3xl);
    /* Staggered entrance */
    animation: section-enter var(--duration-standard) var(--ease-out) backwards;
}

.archive-section:nth-child(1) { animation-delay: 200ms; }
.archive-section:nth-child(2) { animation-delay: 300ms; }
.archive-section:nth-child(3) { animation-delay: 400ms; }

@keyframes section-enter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: 0.1em;
}

.section-icon {
    color: var(--accent-red);
    font-size: 0.6rem;
}

.section-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dark);
    padding: var(--space-xl);
    line-height: 1.8;
    font-size: 0.95rem;
    transition: border-color var(--duration-quick) var(--ease-out);
}

.section-content:hover {
    border-color: var(--border-light);
}

.section-content.containment {
    border-left: 3px solid var(--accent-gold);
}

.section-content.incident {
    border-left: 3px solid var(--accent-red);
}

/* === Archive Footer === */
.archive-footer {
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Entrance animation */
    animation: footer-enter var(--duration-slow) var(--ease-out) backwards;
    animation-delay: 500ms;
}

@keyframes footer-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.footer-stamp {
    width: 80px;
    height: 80px;
    border: 3px solid var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-15deg);
    opacity: 0.7;
    transition: all var(--duration-standard) var(--ease-out);
}

.footer-stamp:hover {
    opacity: 1;
    transform: rotate(-15deg) scale(1.05);
}

.stamp-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-red);
    letter-spacing: 0.2em;
}

.footer-info {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.footer-info p {
    margin-bottom: var(--space-xs);
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-dark);
}

.page-btn {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
    transition: all var(--duration-quick) var(--ease-out);
}

.page-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
}

.page-info {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    animation: empty-enter var(--duration-slow) var(--ease-out) backwards;
}

@keyframes empty-enter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-dim);
    margin-bottom: var(--space-md);
}

/* === Footer === */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-dark);
    padding: var(--space-2xl) 0;
    padding-bottom: calc(var(--space-2xl) + var(--safe-area-bottom));
    margin-top: var(--space-3xl);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    text-align: center;
}

.footer-warning {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    letter-spacing: 0.1em;
    /* Breathing animation for ambient motion */
    animation: warning-breathe 4s var(--ease-in-out) infinite;
}

@keyframes warning-breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* === Error Page === */
.error-page {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    animation: error-enter var(--duration-slow) var(--ease-out) backwards;
}

@keyframes error-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

.error-page h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    color: var(--accent-red);
}

.error-page a {
    color: var(--accent-gold);
    margin-top: var(--space-md);
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--accent-gold);
    text-decoration: none;
    transition: all var(--duration-quick) var(--ease-out);
}

.error-page a:hover {
    background: var(--accent-gold);
    color: var(--text-inverse);
}

/* === Scanline Effect (Ambient Layer) === */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: scanline-move 0.1s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* === Reduced Motion (Accessibility) === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::after {
        animation: none;
    }
    
    .glitch-char::before {
        animation: none;
        opacity: 0;
    }
    
    .footer-warning {
        animation: none;
    }
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }
    
    .site-title {
        text-align: center;
    }
    
    .title-main {
        font-size: 1.8rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .lang-switcher {
        order: -1;
    }
    
    .header-stats {
        width: 100%;
        justify-content: center;
    }
    
    .nav-inner {
        justify-content: center;
    }
    
    .search-form {
        margin-left: 0;
        width: 100%;
        margin-top: var(--space-sm);
    }
    
    .search-input {
        width: 100%;
        flex: 1;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .archive-grid {
        grid-template-columns: 1fr;
    }
    
    .archive-title {
        font-size: 1.5rem;
    }
    
    .archive-footer {
        flex-direction: column;
        gap: var(--space-lg);
        align-items: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

/* === Scroll Margin for Anchors (Vercel Guidelines) === */
h2[id], h3[id], h4[id] {
    scroll-margin-top: calc(var(--space-xl) + var(--safe-area-top));
}

/* === Selection Style === */
::selection {
    background: rgba(184, 154, 90, 0.3);
    color: var(--text-primary);
}

/* === Scrollbar Style === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* === Print Styles === */
@media print {
    .noise-overlay,
    body::after,
    .lang-switcher,
    .filter-nav,
    .skip-link {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .archive-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

