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

html {
    scroll-behavior: smooth;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    caret-color: transparent;
}

html::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

:root {
    --bg: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #ebebeb;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);
    --accent: #2a2a2a;
    --accent-light: rgba(42, 42, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --header-bg: rgba(250, 250, 250, 0.75);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --font-serif: "Noto Serif SC", Georgia, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0d;
        --bg-secondary: #141414;
        --bg-tertiary: #1f1f1f;
        --bg-card: rgba(20, 20, 20, 0.7);
        --text: #f0f0f0;
        --text-secondary: #a0a0a0;
        --text-muted: #666666;
        --border: rgba(255, 255, 255, 0.08);
        --border-light: rgba(255, 255, 255, 0.04);
        --accent: #e8e8e8;
        --accent-light: rgba(232, 232, 232, 0.08);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
        --header-bg: rgba(13, 13, 13, 0.75);
        --glass-bg: rgba(20, 20, 20, 0.65);
        --glass-border: rgba(255, 255, 255, 0.06);
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

:root[data-theme="light"] {
    --bg: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #ebebeb;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);
    --accent: #2a2a2a;
    --accent-light: rgba(42, 42, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --header-bg: rgba(250, 250, 250, 0.75);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
    --bg: #0d0d0d;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: rgba(20, 20, 20, 0.7);
    --text: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --accent: #e8e8e8;
    --accent-light: rgba(232, 232, 232, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(13, 13, 13, 0.75);
    --glass-bg: rgba(20, 20, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s ease;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    left: 24px;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-svg {
    width: 28px;
    height: 28px;
    color: var(--text);
    transition: transform 0.3s ease;
}

.logo:hover .logo-svg {
    transform: scale(1.05);
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text);
}

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

.nav a {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.25s ease;
    position: relative;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.nav-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.nav-icon-small {
    width: 15px;
    height: 15px;
}

.nav a:hover {
    color: var(--text);
}

.nav a:hover .nav-icon {
    color: var(--text);
}

.nav a.active {
    color: var(--text);
}

.nav a.active .nav-icon {
    color: var(--text);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

.nav a:hover::after {
    width: 100%;
}

.nav a.active::after {
    width: 100%;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: absolute;
    right: 24px;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.25s ease;
}

.theme-toggle:hover svg {
    color: var(--text);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg);
    transition: filter 0.35s ease;
}

.footer a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--text);
}

.footer-beian {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-beian img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
    opacity: 0.7;
}

.footer-beian a {
    display: inline-flex;
    align-items: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease forwards;
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        height: 56px;
    }

    .logo {
        left: 16px;
    }

    .theme-toggle {
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .logo-text {
        display: none;
    }

    .nav {
        gap: 24px;
    }

    .nav a {
        font-size: 13px;
    }

    .footer {
        padding: 32px 16px;
    }

    .footer-beian {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .nav {
        gap: 20px;
    }

    .nav a {
        font-size: 12px;
    }

    .nav-icon {
        width: 14px;
        height: 14px;
    }

    .nav-icon-small {
        width: 13px;
        height: 13px;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-text:last-child {
    width: 60%;
    margin-bottom: 0;
}

.skeleton-title {
    height: 20px;
    width: 40%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--glass-shadow);
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
}

.modal-blur .header,
.modal-blur .hero,
.modal-blur .message-entry,
.modal-blur .main,
.modal-blur .footer {
    filter: blur(8px);
}

.modal-blur-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}
