/* ============================================================
 * PRIMSEED — 机构站样式体系
 *
 * CSS 变量驱动：每个机构通过 <style> 覆盖 :root 变量。
 * 静态文件可被浏览器缓存，仅变量由 PHP 动态输出。
 * ============================================================ */

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

/* ── Custom Properties ── */
:root {
    --primary: #090909;
    --secondary: #111114;
    --accent: #c8a855;
    --text: #e8e8ed;
    --text-muted: #8b8b96;
    --border: #1e1e24;
    --surface: #111114;
    --heading-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --body-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --heading-weight: 700;
    --body-weight: 400;
    --radius: 0px;
}

/* ── Base ── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}
body {
    font-family: var(--body-font);
    font-weight: var(--body-weight);
    background: var(--primary);
    color: var(--text);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection {
    background: var(--accent);
    color: var(--primary);
}
a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
a:hover { opacity: 0.8; }

/* ── Accent Line ── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    z-index: 200;
}

/* ── Layout ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 3rem);
}
.section {
    padding: 5rem 0;
}
.section + .section {
    border-top: 1px solid var(--border);
}

/* ── Header (Institution) ── */
.site-header {
    position: sticky;
    top: 2px;
    z-index: 100;
    background: rgba(9, 9, 9, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.site-name {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: var(--heading-weight);
    color: var(--text);
    letter-spacing: 0.04em;
}
.site-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    letter-spacing: 0.03em;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.header-nav {
    display: flex;
    gap: 1.25rem;
}
.header-nav a {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    opacity: 1;
}
.header-nav a:hover,
.header-nav a.active {
    color: var(--accent);
    opacity: 1;
}

/* ── Hero ── */
.hero {
    padding: 6rem 0 5rem;
    border-bottom: 1px solid var(--border);
}
.hero-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-family: var(--heading-font);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: var(--heading-weight);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    max-width: 800px;
}
.hero-mission {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.8;
}

/* ── Prose / Content ── */
.prose {
    max-width: 720px;
}
.prose h1 {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: var(--heading-weight);
    margin: 3rem 0 1rem;
    color: var(--text);
}
.prose h2 {
    font-family: var(--heading-font);
    font-size: 1.35rem;
    font-weight: var(--heading-weight);
    margin: 3rem 0 1rem;
    color: var(--text);
    letter-spacing: -0.01em;
}
.prose h2:first-child,
.prose h1:first-child {
    margin-top: 0;
}
.prose h3 {
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}
.prose p {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.prose li {
    margin-bottom: 0.4rem;
}
.prose strong {
    color: var(--text);
    font-weight: 600;
}
.prose em {
    font-style: italic;
}
.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}
.prose blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 1.25rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.prose code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.88em;
}

/* ── Section Label ── */
.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ── Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}
.card {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    background: var(--surface);
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
a.card {
    color: inherit;
    opacity: 1;
}
.card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    opacity: 1;
}
.card-title {
    font-family: var(--heading-font);
    font-size: 1rem;
    font-weight: var(--heading-weight);
    margin-bottom: 0.35rem;
    color: var(--text);
}
.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}
.card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.card-domain {
    font-size: 0.7rem;
    color: #555;
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    text-align: center;
}
.footer-text {
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 0.02em;
}
.footer-text a {
    color: #666;
    transition: color 0.2s ease;
    opacity: 1;
}
.footer-text a:hover {
    color: var(--accent);
    opacity: 1;
}

/* ── Language Switcher ── */
.lang-switcher {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}
.lang-switcher a {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
    opacity: 1;
}
.lang-switcher a:hover {
    color: var(--text);
    opacity: 1;
}
.lang-switcher a.active {
    color: var(--accent);
    font-weight: 600;
}
.lang-divider {
    color: #333;
    font-size: 0.65rem;
    user-select: none;
}

/* ── Hub Page ── */
.hub-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}
.hub-logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent);
}
.hub-hero {
    padding: clamp(5rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(200, 168, 85, 0.05) 0%, transparent 60%);
    position: relative;
    overflow: hidden;
}
.hub-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.hub-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hub-hero p {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ── Slogan Component ── */
.ps-slogan {
    min-height: 5rem;
    transition: opacity 0.6s ease, transform 0.3s ease;
}
.ps-slogan-main {
    font-family: var(--heading-font);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ps-slogan-char {
    display: inline;
    transition: opacity 0.15s ease;
}
.ps-slogan-cursor {
    display: inline;
    -webkit-text-fill-color: var(--accent);
    animation: ps-cursor-blink 1s step-end infinite;
    margin-left: 2px;
    font-weight: 300;
}
@keyframes ps-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.ps-slogan-sub {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.8;
    transition: opacity 0.6s ease;
}
.ps-slogan-sub .ps-slogan-char {
    color: var(--text-muted);
}
/* SEO：JS 加载前显示静态标题，加载后隐藏 */
.hub-hero-static {
    transition: opacity 0.3s ease;
}
.hub-hero-static.hidden {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* ── Scroll Reveal ── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ── 404 ── */
.not-found {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}
.not-found h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.5rem;
}
.not-found p {
    color: #555;
    margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}
@media (max-width: 768px) {
    .hero {
        padding: 4.5rem 0 3.5rem;
    }
    .section {
        padding: 4rem 0;
    }
    .header-inner {
        flex-wrap: wrap;
    }
}
@media (max-width: 640px) {
    .hero {
        padding: 3.5rem 0 2.5rem;
    }
    .hub-hero {
        padding: 4rem 0 3rem;
    }
    .ps-slogan {
        min-height: 4rem;
    }
    .section {
        padding: 3rem 0;
    }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
}
