/* ============================================================
   Base Styles
   ============================================================ */

* {
    transition: background-color var(--theme-transition),
                border-color var(--theme-transition),
                color var(--theme-transition);
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

[data-theme="dark"] {
    color-scheme: dark;
}


/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6,
.font-display {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--theme-transition);
}

a:hover {
    color: var(--accent-hover);
}


/* ============================================================
   Accessibility
   ============================================================ */

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}


/* ============================================================
   Selection
   ============================================================ */

::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}

[data-theme="dark"] ::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fafafa;
}


/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: var(--overlay0);
    border-radius: var(--radius-xs);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--overlay1);
}


/* ============================================================
   Print Styles
   ============================================================ */

@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .navbar-theme,
    .navbar-adu,
    .theme-toggle,
    .footer-theme,
    .footer-adu {
        display: none !important;
    }
}


/* ============================================================
   Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   焦点态暗色增强 + 容器宽（base 补充 · spec 8）
   ============================================================ */
[data-theme="dark"] :focus-visible {
    outline-color: rgba(96, 165, 250, 0.6);
}

.container,
.content-main > .container {
    max-width: var(--home-shell-width, 1240px);
}
