@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700;900&family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

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

:root {
    --ink: #0f2230;
    --ink-soft: #3c4b57;
    --ink-muted: #69757f;
    --ink-faint: #97a1aa;

    --paper: #f1f6fa;
    --paper-2: #e4eef5;
    --surface: #ffffff;
    --hairline: #d1e2ec;
    --hairline-soft: #e3eef5;

    --brand: #0d7c96;
    --blue: #0a6885;
    --teal: #0d7c96;
    --cyan: #18a0bd;
    --accent: #0d7c96;
    --accent-dark: #0a5c72;
    --accent-soft: #e6f3f8;

    --gradient: linear-gradient(120deg, #0a6680 0%, #0d7c96 55%, #18a0bd 100%);
    --gradient-soft: linear-gradient(120deg, #0d7c96, #42b8d4);

    --hero-1: #062432;
    --hero-2: #094e63;
    --hero-3: #0d7c96;
    --hero-text: #e8f4fa;

    --shadow-xs: 0 1px 2px rgba(15, 34, 48, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 34, 48, 0.05), 0 1px 2px rgba(15, 34, 48, 0.04);
    --shadow-md: 0 12px 32px -8px rgba(15, 34, 48, 0.14), 0 4px 10px -4px rgba(15, 34, 48, 0.08);
    --shadow-lg: 0 24px 56px -16px rgba(8, 32, 48, 0.28);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-pill: 999px;

    --font-ui: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

::selection { background: rgba(13, 124, 150, 0.16); color: var(--accent-dark); }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    width: 100%;
}

.container-narrow { max-width: 880px; }

/* ════════ HERO ════════ */
.site-header {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(120% 120% at 50% -10%, var(--hero-3) 0%, transparent 55%),
        linear-gradient(150deg, var(--hero-1) 0%, var(--hero-2) 56%, var(--hero-3) 100%);
    color: var(--hero-text);
    padding: 48px 0 44px;
    overflow: hidden;
    text-align: center;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 82% 18%, rgba(13, 124, 150, 0.24) 0%, transparent 42%),
        radial-gradient(circle at 12% 88%, rgba(24, 160, 189, 0.18) 0%, transparent 46%);
    pointer-events: none;
}

.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(13, 124, 150, 0.55), rgba(24, 160, 189, 0.45), transparent);
}

.hero-glow {
    position: absolute;
    z-index: -1;
    top: -180px;
    left: 50%;
    width: 760px;
    height: 520px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(13, 124, 150, 0.32) 0%, rgba(24, 160, 189, 0.16) 38%, transparent 70%);
    filter: blur(14px);
    pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.wechat-modal[hidden] { display: none; }

.wechat-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.wechat-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 46, 49, 0.62);
    backdrop-filter: blur(4px);
}

.wechat-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    padding: 24px 24px 20px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.wechat-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.wechat-modal-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 16px;
}

.wechat-modal-qr {
    width: 220px;
    height: 220px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--hairline-soft);
    background: #fff;
}

body.modal-open { overflow: hidden; }

.site-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 16px;
}

.site-kicker span {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(153, 246, 228, 0.9);
}

.site-kicker::before,
.site-kicker::after {
    content: "";
    width: 44px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.6));
}
.site-kicker::after { background: linear-gradient(90deg, rgba(94, 234, 212, 0.6), transparent); }

.vision-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #99f6e4;
    background: rgba(13, 124, 150, 0.14);
    border: 1px solid rgba(94, 234, 212, 0.25);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 18px;
}

.site-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.85rem, 5vw, 2.7rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.site-header h1 .title-zh {
    display: inline-block;
    background: linear-gradient(180deg, #ffffff 0%, #b8e8e0 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-header h1 .title-en { display: none; }

.site-tagline {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 400;
    color: rgba(238, 246, 245, 0.86);
    margin: 12px auto 0;
    max-width: 600px;
    line-height: 1.55;
}

.site-desc {
    color: rgba(238, 246, 245, 0.66);
    font-size: 1rem;
    max-width: 560px;
    margin: 14px auto 0;
    line-height: 1.7;
}

.site-intro {
    max-width: 580px;
    margin: 12px auto 0;
}

.site-intro p {
    font-size: 0.92rem;
    color: rgba(238, 246, 245, 0.6);
    line-height: 1.6;
}

.site-intro p:last-child { color: rgba(238, 246, 245, 0.42); }

.hero-divider {
    width: 52px;
    height: 2px;
    margin: 22px auto 0;
    background: var(--gradient-soft);
    border-radius: 2px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 22px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 26px;
    position: relative;
}

.hero-stat + .hero-stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.hero-stat-value {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(153, 246, 228, 0.7);
}

/* ════════ FEATURES ════════ */
.features {
    margin-top: 0;
    position: relative;
    z-index: 2;
    padding: 28px 0 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.feature-card {
    padding: 20px 22px;
    position: relative;
    transition: background 0.3s var(--ease);
}

.feature-card + .feature-card { border-left: 1px solid var(--hairline-soft); }

.feature-card:hover { background: var(--accent-soft); }

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--gradient);
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 11px;
    box-shadow: 0 5px 14px -5px rgba(2, 132, 199, 0.55);
}

.feature-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.55;
}

/* ════════ PAPER LIBRARY ════════ */
.paper-section {
    flex: 1 0 auto;
    padding: 40px 0 24px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.section-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.section-sub {
    font-size: 0.86rem;
    color: var(--ink-muted);
    margin-top: 6px;
}

.paper-count {
    font-size: 0.82rem;
    color: var(--ink-muted);
    background: var(--surface);
    border: 1px solid var(--hairline);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.paper-count strong {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-dark);
    margin-right: 2px;
}

.paper-list {
    display: grid;
    gap: 14px;
    counter-reset: paper;
}

.paper-card {
    counter-increment: paper;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.4s var(--ease), border-color 0.4s, transform 0.4s var(--ease);
}

.paper-card::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}

.paper-card:hover {
    border-color: rgba(13, 124, 150, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.paper-card:hover::after { opacity: 1; }

.paper-card-body {
    padding: 22px 26px;
    min-width: 0;
    position: relative;
}

.paper-card-body::before {
    content: counter(paper, decimal-leading-zero);
    position: absolute;
    top: 18px;
    right: 24px;
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--paper-2);
    pointer-events: none;
    transition: color 0.4s var(--ease);
}

.paper-card:hover .paper-card-body::before { color: #d7ede9; }

.paper-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 11px;
}

.paper-year {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--gradient);
    padding: 3px 11px;
    border-radius: var(--radius-pill);
}

.paper-stat {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--paper);
    border: 1px solid var(--hairline);
    padding: 3px 11px;
    border-radius: var(--radius-pill);
}

.paper-title-zh {
    font-family: var(--font-serif);
    font-size: 1.22rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.4;
    letter-spacing: 0.01em;
    padding-right: 44px;
}

.paper-title-zh a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s;
}

.paper-title-zh a:hover { color: var(--accent); }

.paper-title-en {
    color: var(--ink-muted);
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.45;
    margin-bottom: 10px;
    padding-right: 44px;
}

.paper-meta {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 10px;
    line-height: 1.55;
}

.paper-meta a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(3, 105, 161, 0.25);
    transition: border-color 0.2s;
}

.paper-meta a:hover { border-bottom-color: var(--blue); }

.paper-desc {
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.62;
    margin-bottom: 12px;
}

.paper-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent-dark);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(13, 124, 150, 0.16);
}

.paper-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 26px;
    border-left: 1px solid var(--hairline-soft);
    background: linear-gradient(180deg, #e6f3f8 0%, #f1f6fa 100%);
}

.paper-card-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    color: #fff;
    background: var(--gradient);
    border: none;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    padding: 13px 14px 13px 22px;
    border-radius: var(--radius-pill);
    box-shadow:
        0 6px 20px rgba(13, 124, 150, 0.38),
        0 2px 6px rgba(13, 124, 150, 0.18);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.paper-card-link:hover {
    color: #fff;
    background: var(--gradient);
    transform: translateY(-2px);
    box-shadow:
        0 12px 28px rgba(13, 124, 150, 0.48),
        0 4px 10px rgba(13, 124, 150, 0.22);
}

.paper-card-link-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.paper-card-link-arrow svg,
.paper-card-link-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.paper-card-link:hover .paper-card-link-arrow {
    background: rgba(255, 255, 255, 0.32);
    transform: translateX(3px);
}

.empty {
    color: var(--ink-muted);
    text-align: center;
    padding: 80px 28px;
    background: var(--surface);
    border: 1px dashed var(--hairline);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

/* ════════ FOOTER ════════ */
.site-footer {
    position: relative;
    flex-shrink: 0;
    margin-top: auto;
    height: 40px;
    padding: 0;
    background: linear-gradient(180deg, #eaf3f8 0%, var(--paper) 100%);
    border-top: 1px solid var(--hairline);
}

.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--teal), transparent);
    opacity: 0.55;
}

.footer-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px 12px;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
}

.footer-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.footer-mark {
    flex-shrink: 0;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(13, 124, 150, 0.18);
}

.footer-brand-zh {
    font-family: var(--font-serif);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}

.footer-brand-en {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--accent-dark);
    line-height: 1;
    white-space: nowrap;
}

.footer-divider { display: none; }

.footer-brand {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-muted);
    letter-spacing: 0.02em;
    margin-top: 2px;
}

.footer-social {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    flex-shrink: 0;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    text-decoration: none;
    border: 1px solid var(--hairline);
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.footer-social-link:visited {
    color: var(--ink-soft);
}

.footer-social-link:hover {
    background: var(--accent-soft);
    border-color: rgba(13, 124, 150, 0.35);
    color: var(--accent-dark);
    box-shadow: var(--shadow-xs);
}

button.footer-social-link {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.footer-social-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
}

.footer-social-link--wechat .footer-social-icon {
    color: #07c160;
}

.footer-social-link--github .footer-social-icon {
    color: var(--ink);
}

.footer-social-link:hover .footer-social-icon {
    color: var(--accent-dark);
}

.footer-social-link--wechat:hover .footer-social-icon {
    color: #059669;
}

.footer-meta {
    font-size: 0.65rem;
    color: var(--ink-faint);
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

/* ════════ RESPONSIVE ════════ */
@media (max-width: 880px) {
    .feature-grid { grid-template-columns: 1fr; }
    .feature-card + .feature-card { border-left: none; border-top: 1px solid var(--hairline-soft); }
    .features { margin-top: 0; padding-top: 22px; }
}

@media (max-width: 720px) {
    .site-header { padding: 40px 0 36px; }
    .paper-card { grid-template-columns: 1fr; }
    .paper-card-action {
        border-left: none;
        border-top: 1px solid var(--hairline-soft);
        padding: 16px 22px 22px;
        justify-content: center;
        background: linear-gradient(180deg, #e6f3f8 0%, transparent 100%);
    }
    .paper-card-link { width: 100%; justify-content: center; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .hero-stat { padding: 0 20px; }
}

@media (max-width: 480px) {
    .container { padding: 0 18px; }
    .paper-card-body { padding: 24px 22px; }
    .paper-card-body::before { font-size: 1.8rem; top: 20px; right: 20px; }
    .paper-title-zh, .paper-title-en { padding-right: 40px; }
    .hero-stats { gap: 0; }
    .hero-stat { padding: 8px 16px; }
    .hero-stat + .hero-stat::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .feature-card, .paper-card, .paper-card-link, .paper-card::after { transition: none; }
}
