/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light dark;
    --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-display: 'Fraunces', 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', serif;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --text: #0b0b0c;
    --muted: rgba(11, 11, 12, 0.64);
    --border: rgba(11, 11, 12, 0.16);
    --primary: #0b0b0c;
    --primary-2: rgba(11, 11, 12, 0.70);
    --shadow: none;
    --shadow-soft: none;
    --radius: 0px;
    --radius-sm: 0px;
    --container: 1040px;
}

html[data-theme="dark"] {
    --bg: #0b0b0c;
    --surface: #0b0b0c;
    --surface-solid: #0b0b0c;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.64);
    --border: rgba(255, 255, 255, 0.20);
    --primary: #ffffff;
    --primary-2: rgba(255, 255, 255, 0.72);
    --shadow: none;
    --shadow-soft: none;
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: auto;
}

.intro {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 3000;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms ease;
}

.intro-inner {
    text-align: center;
    padding: 24px;
}

.intro-word {
    font-family: 'Playfair Display', var(--font-display);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    font-size: clamp(4.4rem, 12.5vw, 9.6rem);
}

.intro-hint {
    margin-top: 18px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

body.pre-enter {
    overflow: hidden;
}

body.pre-enter .intro {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.pre-enter .site {
    opacity: 0;
    pointer-events: none;
}

body.entered .intro {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site {
    opacity: 1;
    transition: opacity 280ms ease;
}

body.entered .site {
    opacity: 1;
}

.navbar,
main,
.footer,
.back-to-top {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms ease, transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

h1, h2, h3 {
    font-family: var(--font-display);
}

.logo,
.nav-links a,
.contact-form button {
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: none;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    gap: 18px;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
}

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

.theme-toggle,
.mobile-menu-btn {
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .mobile-menu-btn {
    background: transparent;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle {
    display: inline-flex;
}

.mobile-menu-btn {
    display: none;
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
    transform: translateY(-1px);
    background: rgba(11, 11, 12, 0.04);
    border-color: var(--text);
}

.theme-toggle:active,
.mobile-menu-btn:active {
    transform: translateY(0);
}

.theme-toggle-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: -0.02em;
}

.logo:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    opacity: 0.9;
    letter-spacing: 0.01em;
}

.nav-nas {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.01em;
}

.nav-nas:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.nav-links a:hover {
    color: var(--primary);
    opacity: 1;
}

/* 英雄区 */
.hero {
    background: none;
    color: var(--text);
    padding: 128px 0 72px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: none;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.8rem, 6.6vw, 5.6rem);
    font-weight: 700;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero p {
    font-size: 1.05rem;
    margin-bottom: 30px;
    opacity: 1;
    animation: fadeInUp 1s ease-out 0.2s both;
    letter-spacing: 0.01em;
    max-width: 56ch;
}

.hero .lede {
    background: #c9f7c1;
    border: 2px solid #0f5a1e;
    padding: 10px 12px;
}

html[data-theme="dark"] .hero .lede {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.65);
}

.btn-container {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    animation: fadeInUp 1s ease-out 0.4s both;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.btn.btn-ghost {
    opacity: 0.9;
}

.btn:hover {
    background-color: rgba(11, 11, 12, 0.04);
    transform: translateY(-2px);
    box-shadow: none;
}

html[data-theme="dark"] .btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 博客文章 */
/* Section */
.section {
    padding: 64px 0;
    border-top: 1px solid var(--border);
}

.section:first-of-type {
    border-top: none;
}

.section-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 22px;
}

.list {
    border-top: 1px solid var(--border);
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--border);
}

.list-item {
    background-color: var(--surface-solid);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease;
    border: none;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    padding: 20px 0;
    text-decoration: none;
    color: inherit;
}

.list-item:hover {
    transform: none;
    background: rgba(11, 11, 12, 0.06);
}

html[data-theme="dark"] .list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.list-media img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    filter: saturate(0.95) contrast(1.05);
}

.list-body {
    padding: 0;
}

.meta {
    font-family: var(--font-sans);
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.item-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.2vw, 2.15rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.item-desc {
    color: var(--muted);
    margin-bottom: 15px;
    max-width: 80ch;
}

.item-cta {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.news-list {
    border-top: 1px solid var(--border);
}

.news-item {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    gap: 16px;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.news-source {
    font-family: var(--font-sans);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.news-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.news-cta {
    justify-self: end;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.caps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.cap {
    padding: 18px 16px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}

.contact-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
}

.contact-form {
    max-width: none;
    margin: 0;
    background-color: var(--surface-solid);
    padding: 22px 0 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
}

/* NAS 弹层 */
.nas-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
}

body.nas-open .nas-modal {
    display: block;
}

.nas-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.nas-dialog {
    position: absolute;
    inset: 18px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.nas-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.nas-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nas-close {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.nas-close:hover {
    background: rgba(11, 11, 12, 0.06);
}

html[data-theme="dark"] .nas-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nas-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

html[data-theme="dark"] .nas-frame {
    background: #0b0b0c;
}

@media (max-width: 860px) {
    .nas-dialog {
        inset: 10px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: transparent;
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: none;
}

/* 页脚 */
.footer {
    background: var(--surface-solid);
    color: var(--text);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.visit-counter {
    margin: 10px 0;
}

.visit-counter p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
    opacity: 0.85;
}

.social-links a:hover {
    color: var(--primary);
    opacity: 1;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .about-image {
        max-width: 200px;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    cursor: pointer;
    box-shadow: none;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 手机导航 */
@media (max-width: 860px) {
    .mobile-menu-btn {
        display: inline-flex;
        z-index: 1001;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 10px);
        right: 20px;
        width: min(320px, calc(100vw - 40px));
        background: var(--surface-solid);
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        box-shadow: none;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.2s ease;
        z-index: 1000;
        border-radius: 0;
        border: 1px solid var(--border);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links a {
        padding: 10px 12px;
        width: 100%;
        text-align: left;
        font-size: 1.05rem;
        border-radius: 0;
    }

    .nav-links a:hover {
        background-color: rgba(11, 11, 12, 0.06);
    }

    .nav-nas {
        padding: 10px 12px;
        width: 100%;
        text-align: left;
        font-size: 1.05rem;
    }

    .nav-nas:hover {
        background-color: rgba(11, 11, 12, 0.06);
        text-decoration: none;
    }

    .list-item {
        grid-template-columns: 1fr;
        padding: 16px 0;
    }

    .list-media img {
        height: 190px;
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .news-cta {
        justify-self: start;
    }

    .caps-grid {
        grid-template-columns: 1fr;
    }

    .contact-split {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(11, 11, 12, 0.06);
}

::-webkit-scrollbar-thumb {
    background: rgba(11, 11, 12, 0.24);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(11, 11, 12, 0.36);
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}