/* ==========================================================================
   格林塔罗学派官方网站 · 全站样式（单文件）
   Grimm Tarot System — Global Stylesheet
   --------------------------------------------------------------------------
   配色（网站说明 § 11.3 · 19 世纪学术刊物调性）:
     墨夜蓝 #1A1F2E / 古书褐 #3D2817 / 葡萄酒红 #8B1E3F
     羊皮纸 #F5F1E8 / 雪白 #FAFAFA / 墨黑 #2C2C2C / 灰岩 #6B6B6B
   字体: Playfair Display + Crimson Text（西文衬线）
         Noto Serif SC 思源宋体（中文标题）/ Noto Sans SC（正文）
   布局: 5 区制 — Header 64px / Hero 80vh / Main 680px / Convert / Footer
   断点: 1200 / 992 / 768
   禁用: 紫色 · 黑金 · 星空 · 神秘学符号 · 视差 · 3D · 粒子
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
    --ink:        #1A1F2E;   /* 墨夜蓝 —— 头部、标题、主文字 */
    --umber:      #3D2817;   /* 古书褐 —— 章节标题、边框 */
    --wine:       #8B1E3F;   /* 葡萄酒红 —— CTA、链接、强调 */
    --paper:      #F5F1E8;   /* 羊皮纸 —— 主背景 */
    --snow:       #FAFAFA;   /* 雪白 —— 卡片背景 */
    --text:       #2C2C2C;   /* 墨黑 —— 正文 */
    --stone:      #6B6B6B;   /* 灰岩 —— 副文、说明 */
    --line:       #E3DCCC;   /* 细分隔线（羊皮纸加深）*/
    --line-hard:  #C9BFAC;   /* 强分隔线 */
    --wine-soft:  #F0E2E7;   /* 葡萄酒红的极淡底（hover 面）*/

    --serif-en:   'Playfair Display', 'Crimson Text', Georgia, 'Times New Roman', serif;
    --serif-cn:   'Noto Serif SC', 'Source Han Serif SC', '思源宋体', 'Songti SC', serif;
    --sans:       'Noto Sans SC', 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;

    --w-max:      1200px;
    --w-read:     680px;     /* Main 区最佳阅读宽度 */
    --h-header:   64px;
    --ease:       cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--paper);
    min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
    font-family: var(--serif-cn), var(--serif-en);
    color: var(--ink);
    line-height: 1.28;
    font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.8rem); margin: 0 0 .9rem; }
h3 { font-size: 1.22rem; margin: 0 0 .6rem; }

p  { margin: 0 0 1.15rem; }
strong { color: var(--ink); }
em { font-style: italic; }

a { color: var(--wine); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--umber); text-decoration: underline; text-underline-offset: 3px; }

ul, ol { padding-left: 1.5em; margin: 0 0 1.15rem; }
li { margin-bottom: .35rem; }

/* ---------- 3. Primitives ---------- */
.container { max-width: var(--w-max); margin: 0 auto; padding: 0 24px; }

.reading-container { max-width: var(--w-read); margin: 0 auto; padding: 0 24px; }

.muted { color: var(--stone); }

.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0;
}

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 999;
    background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 0 0 6px 6px;
    transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* 章节 Tag —— 学术风装饰：小型序号/标签 */
.sec-tag {
    display: inline-block;
    font-family: var(--serif-en);
    font-size: .78rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--wine);
    border: 1px solid var(--wine);
    padding: 3px 12px;
    margin-bottom: 14px;
}

/* ---------- 4. Header（5 区制之一 · 64px）---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(245, 241, 232, .96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--h-header); gap: 24px;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    font-family: var(--serif-cn), var(--serif-en);
    font-weight: 700; font-size: 1.08rem; color: var(--ink);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--umber); }
.brand img { width: 32px; height: 32px; }
.brand-name { letter-spacing: .04em; }

.main-nav ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    color: var(--ink); font-size: .95rem; font-weight: 500;
    padding: 6px 2px; border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--wine); text-decoration: none; border-bottom-color: var(--wine); }
.main-nav a.active { color: var(--wine); border-bottom-color: var(--wine); }

.lang-switch { display: flex; gap: 6px; font-size: .85rem; }
.lang-switch a {
    color: var(--stone); padding: 3px 10px; border: 1px solid var(--line-hard);
    border-radius: 3px; letter-spacing: .05em;
}
.lang-switch a:hover { color: var(--wine); border-color: var(--wine); text-decoration: none; }
.lang-switch a.active { color: #fff; background: var(--ink); border-color: var(--ink); }

.menu-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 9px;
    background: none; border: 1px solid var(--line-hard); border-radius: 4px; cursor: pointer;
}
.menu-toggle span {
    display: block; height: 2px; width: 100%;
    background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 5. Hero（5 区制之二 · 80vh）---------- */
.hero {
    min-height: 80vh;
    display: flex; align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--line);
    position: relative;
}
/* 边角小标识装饰（学术风）*/
.hero::before, .hero::after {
    content: ""; position: absolute; width: 26px; height: 26px;
    border: 2px solid var(--line-hard); opacity: .8;
}
.hero::before { top: 34px; left: 34px; border-right: 0; border-bottom: 0; }
.hero::after  { bottom: 34px; right: 34px; border-left: 0; border-top: 0; }

.hero-inner { padding: 96px 24px; }
.hero h1 { max-width: 860px; margin: 0 auto 1.4rem; letter-spacing: .01em; }
.hero-sub {
    max-width: 720px; margin: 0 auto 2.6rem;
    font-size: 1.08rem; color: var(--stone);
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- 6. Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--sans); font-size: .98rem; font-weight: 600;
    border: 2px solid transparent; border-radius: 4px;
    cursor: pointer; transition: all .25s var(--ease);
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 16px; font-size: .86rem; font-weight: 500; }

.btn-primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--umber); border-color: var(--umber); color: #fff; }
.btn-primary:disabled { background: var(--stone); border-color: var(--stone); cursor: not-allowed; opacity: .65; }

.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }

.btn-outline { background: transparent; border-color: var(--wine); color: var(--wine); }
.btn-outline:hover { background: var(--wine); color: #fff; }

/* ---------- 7. Content sections（5 区制之三 · Main）---------- */
.content-section { padding: 80px 0; }
.content-section.alt { background: var(--snow); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: 1.6rem; }
.section-head h2 { margin-bottom: .3rem; }
.section-desc { color: var(--stone); max-width: 640px; }

main { min-height: 40vh; }
.page-pad { padding: 48px 0 80px; }

/* 面包屑 */
.breadcrumb { padding: 26px 0 0; }
.breadcrumb ol {
    list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px;
    max-width: var(--w-read); margin: 0 auto; padding: 0 24px;
    font-size: .86rem; color: var(--stone);
}
.breadcrumb li + li::before { content: "›"; margin-right: 10px; color: var(--line-hard); }
.breadcrumb a { color: var(--stone); }
.breadcrumb a:hover { color: var(--wine); }
.breadcrumb li:last-child { color: var(--ink); }

/* 文章头部 */
.article { padding-bottom: 88px; }
.article-header { padding: 34px 0 26px; border-bottom: 3px double var(--line-hard); margin-bottom: 34px; }
.article-header h1 { margin-bottom: .8rem; }
.lead {
    font-size: 1.06rem; color: var(--text);
    background: var(--snow); border-left: 4px solid var(--wine);
    padding: 16px 20px; border-radius: 0 6px 6px 0;
    margin-bottom: 1.4rem;
}
.article-meta {
    display: flex; flex-wrap: wrap; gap: 6px 22px;
    font-size: .84rem; color: var(--stone);
}

/* 学术风编号标题 */
.article h2, .faq-section h2, .refs-section h2 {
    position: relative; padding-top: 34px; margin-top: 26px;
}
.article h2::before {
    counter-increment: secnum;
    content: "§";
    position: absolute; top: 26px; left: -1.6em;
    font-family: var(--serif-en); font-size: 1rem; color: var(--line-hard);
}
@media (max-width: 767px) {
    .article h2::before { position: static; display: block; content: "§ ———"; letter-spacing: 2px; }
}

.numbered li { margin-bottom: .55rem; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 1.4rem 0 1.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--snow); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
thead th {
    background: var(--ink); color: var(--paper);
    text-align: left; padding: 12px 16px; font-weight: 600;
    font-family: var(--serif-cn), var(--serif-en);
    white-space: nowrap;
}
tbody td { padding: 11px 16px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr.hl td { background: var(--wine-soft); font-weight: 600; }
.data-table tbody tr:hover td { background: var(--paper); }
.cell-desc { min-width: 220px; color: var(--stone); font-size: .88rem; }

/* 徽章 */
.badge {
    display: inline-block; font-size: .74rem; font-weight: 600;
    padding: 2px 10px; border-radius: 12px; letter-spacing: .04em;
    vertical-align: middle; margin-left: 8px;
}
.badge-approved, .badge-available { background: #E8EEE3; color: #2E5B2E; border: 1px solid #BCD0B2; }
.badge-pending, .badge-planned { background: var(--wine-soft); color: var(--wine); border: 1px solid #DDB9C6; }

/* ---------- 8. Cards ---------- */
.card-grid {
    display: grid; gap: 22px; margin-top: 8px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.card-grid.four { grid-template-columns: repeat(4, 1fr); }

.card {
    position: relative;
    background: var(--snow);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 26px 24px 22px;
    display: flex; flex-direction: column;
    transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover {
    border-color: var(--wine);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(26, 31, 46, .07);
}
.card h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--wine); text-decoration: none; }
.card p { color: var(--stone); font-size: .93rem; flex: 1; }

.card-link {
    margin-top: 14px; font-size: .88rem; font-weight: 600;
    color: var(--wine); letter-spacing: .02em;
}
.card-link:hover { color: var(--umber); }

.card-no {
    position: absolute; top: 14px; right: 18px;
    font-family: var(--serif-en); font-size: 1.9rem; font-weight: 700;
    color: var(--line); line-height: 1;
}
.knowledge-card { min-height: 190px; }

.collection-grid { margin: 6px 0 30px; }

.community-meta { font-size: .86rem; color: var(--stone); margin-bottom: .4rem; }
.community-topics { font-size: .92rem; margin-bottom: .6rem; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.count-chip {
    display: inline-block; font-size: .78rem; color: var(--stone);
    border: 1px dashed var(--line-hard); border-radius: 12px;
    padding: 1px 10px; margin-bottom: 10px; align-self: flex-start;
}

.cta-line { margin: 26px 0 6px; }

/* 模块间翻页 */
.module-pager {
    display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    border-top: 1px solid var(--line); margin-top: 44px; padding-top: 22px;
}
.pager-link { font-size: .92rem; font-weight: 600; }

/* ---------- 9. FAQ ---------- */
.faq-section { margin-top: 40px; }
.faq-head { margin-bottom: 16px; }
.faq-head h2 { padding-top: 0 !important; margin-top: 0; }
.faq-head h2::before { display: none; }

.faq-list { border: 1px solid var(--line); border-radius: 8px; background: var(--snow); overflow: hidden; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 0; }

.faq-list summary {
    cursor: pointer; list-style: none;
    padding: 15px 20px 15px 44px;
    font-weight: 600; color: var(--ink);
    position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
    content: "+"; position: absolute; left: 18px; top: 50%;
    transform: translateY(-50%);
    font-family: var(--serif-en); font-size: 1.3rem; color: var(--wine);
    transition: transform .2s var(--ease);
}
.faq-list details[open] summary::before { content: "−"; }
.faq-list summary:hover { background: var(--paper); }

.faq-body { padding: 2px 20px 16px 44px; }
.faq-body p { color: var(--stone); font-size: .95rem; margin: 0; }

/* ---------- 10. References / 引用区 ---------- */
.refs-section { margin-top: 44px; }
.ref-list { font-size: .88rem; color: var(--stone); }
.ref-list li { margin-bottom: .45rem; }

/* ---------- 11. Tables in forms / notice ---------- */
.notice-box {
    background: var(--snow); border: 1px solid var(--line);
    border-left: 4px solid var(--umber);
    border-radius: 0 8px 8px 0; padding: 20px 24px; margin: 6px 0 26px;
}
.notice-box h2 { padding-top: 0 !important; margin-top: 0; font-size: 1.1rem; }
.notice-box ul { margin-bottom: 0; font-size: .92rem; color: var(--stone); }

/* ---------- 12. Forms ---------- */
.apply-form fieldset {
    border: 1px solid var(--line); border-radius: 8px;
    padding: 20px 22px; margin: 0 0 22px; background: var(--snow);
}
.apply-form legend {
    font-family: var(--serif-cn), var(--serif-en);
    font-weight: 700; color: var(--umber);
    padding: 0 10px; font-size: 1.02rem;
}
.form-group, .apply-form label {
    display: block; font-weight: 600; color: var(--ink);
    font-size: .92rem; margin: 14px 0 6px;
}
.apply-form label:first-child { margin-top: 0; }

.apply-form input[type="text"],
.apply-form input[type="email"],
.apply-form input[type="url"],
.apply-form input[type="tel"],
.apply-form select,
.apply-form textarea,
.subscribe-form input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--line-hard); border-radius: 4px;
    background: #fff; font-family: var(--sans); font-size: .96rem;
    transition: border-color .2s var(--ease);
}
.apply-form input:focus, .apply-form select:focus,
.apply-form textarea:focus, .subscribe-form input:focus {
    outline: none; border-color: var(--wine);
    box-shadow: 0 0 0 3px var(--wine-soft);
}
.apply-form textarea { min-height: 110px; resize: vertical; }
.apply-form .radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 22px; font-weight: 500; }
.apply-form .radio input { width: auto; accent-color: var(--wine); }
.form-note { font-size: .84rem; margin-top: 12px; }

/* ---------- 13. Convert band（5 区制之四）---------- */
.convert-band {
    background: var(--ink); color: var(--paper);
    padding: 64px 0;
}
.convert-inner {
    display: grid; grid-template-columns: 1.2fr .8fr;
    gap: 40px; align-items: center;
}
.convert-band h2 { color: #fff; margin-bottom: .6rem; }
.convert-band p { color: #CFC9BB; margin-bottom: .4rem; }
.convert-fine { font-size: .8rem; color: #9BA0AB; }

.subscribe-form { display: flex; gap: 10px; }
.subscribe-form input { flex: 1; background: #fff; border: none; }
.subscribe-form .btn { white-space: nowrap; }

/* ---------- 14. Footer（5 区制之五）---------- */
.site-footer {
    background: var(--paper);
    border-top: 3px double var(--line-hard);
    padding: 56px 0 0;
}
.footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px; padding-bottom: 40px;
}
.footer-brand img { width: 40px; height: 40px; margin-bottom: 12px; }
.footer-name { font-family: var(--serif-cn), var(--serif-en); font-weight: 700; color: var(--ink); margin-bottom: .3rem; }
.footer-brand p { font-size: .9rem; max-width: 300px; }

.site-footer h3 {
    font-size: .95rem; color: var(--umber);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px; margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; font-size: .9rem; }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding: 20px 24px 26px;
    text-align: center; font-size: .84rem; color: var(--stone);
}

/* ---------- 15. Utilities ---------- */
.home-strip { background: var(--snow); border-top: 1px solid var(--line); }
.strip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.eyebrow {
    font-family: var(--serif-en); font-size: .8rem;
    letter-spacing: .22em; text-transform: uppercase;
    color: var(--wine); margin-bottom: 8px;
}
.wrap { max-width: var(--w-max); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--w-read); margin: 0 auto; padding: 0 24px; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 1199px) {
    .card-grid.four { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .footer-grid > div:nth-child(4) { display: none; }
}

@media (max-width: 991px) {
    .hero { min-height: 66vh; }
    .hero-inner { padding: 72px 24px; }
    .convert-inner { grid-template-columns: 1fr; gap: 22px; }
    .strip-grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav ul { gap: 18px; }
    .brand-name { display: none; }
}

@media (max-width: 767px) {
    body { font-size: 15px; }
    .content-section { padding: 56px 0; }

    .header-inner { position: relative; }
    .lang-switch { display: none; }
    .menu-toggle { display: flex; }

    .main-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgba(26, 31, 46, .08);
        max-height: 0; overflow: hidden;
        transition: max-height .3s var(--ease);
    }
    .main-nav.open { max-height: 320px; }
    .main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav li:last-child { border-bottom: 0; }
    .main-nav a { display: block; padding: 13px 24px; border-bottom: 0; }

    .hero { min-height: auto; }
    .hero-inner { padding: 64px 24px; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero .btn { text-align: center; }

    .card-grid, .card-grid.four, .strip-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-grid > div:nth-child(4) { display: block; }

    .subscribe-form { flex-direction: column; }

    .breadcrumb ol { padding-top: 4px; }
    .module-pager { flex-direction: column; }
}

/* ---------- 17. Print ---------- */
@media print {
    .site-header, .convert-band, .site-footer, .menu-toggle, .hero-cta { display: none !important; }
    body { background: #fff; color: #000; }
    .article { max-width: 100%; }
}

/* ---------- 18. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
