/* ============================================================
   镜渊认知科学研究中心 · 官网原型
   阶段一视觉（§13-1）：纯白 + 浅灰蓝 + 冷蓝光
   富界面：真实科研机构官网信息密度
   ============================================================ */

:root {
  --bg: #FFFFFF;
  --bg-soft: #E8F0FA;
  --card: #FFFFFF;
  --accent: #4A90D9;
  --accent-deep: #3A78B8;
  --text: #233140;
  --text-sub: #5B6B7C;
  --border: #DCE6F2;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(35, 49, 64, .06);
  --shadow-hover: 0 8px 24px rgba(35, 49, 64, .12);
}

/* ---------- 主题切换（T12，§13 三阶段视觉） ---------- */
body.theme-g3 {   /* 第3章：冷色过渡 */
  --bg: #F3F5F8;
  --bg-soft: #D8E2EC;
  --card: #FFFFFF;
  --accent: #3A6EA8;
  --accent-deep: #2F5C8E;
  --text: #1C2834;
  --text-sub: #52627A;
  --border: #BFCEDD;
}
body.theme-g4 {   /* 第4-5章：黑红 */
  --bg: #12161C;
  --bg-soft: #1C232C;
  --card: #181E26;
  --accent: #8B0000;
  --accent-deep: #A31212;
  --text: #C9D6E4;
  --text-sub: #8A9BAE;
  --border: #2A3340;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, .5);
}
body.theme-g3 .hero, body.theme-g3 .page-head,
body.theme-g4 .hero, body.theme-g4 .page-head { background: linear-gradient(135deg, var(--bg-soft), var(--card)); }
body.theme-g4 footer { background: #0C0F13; }
body.theme-g4 .dl-btn:disabled, body.theme-g4 .dl-btn:disabled:hover { background: var(--accent); }

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "思源黑体", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- 导航搜索框 ---------- */
.nav-search { display: flex; align-items: center; gap: 6px; }
.nav-search input {
  width: 160px; height: 30px; border: 1px solid var(--border);
  border-radius: 15px; padding: 0 12px; font-size: 13px; outline: none;
  background: var(--bg-soft); transition: background .2s;
}
.nav-search input:focus { border-color: var(--accent); background: var(--card); }
.nav-search button {
  border: none; background: var(--accent); color: #fff; font-size: 13px;
  height: 30px; padding: 0 14px; border-radius: 15px; cursor: pointer;
}

/* ---------- 主导航 ---------- */
.nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.logo img { width: 40px; height: 40px; }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a {
  color: var(--text); font-size: 15px; padding: 26px 0;
  display: block;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

/* ---------- 页头（内页） ---------- */
.page-head { background: linear-gradient(135deg, var(--bg-soft), var(--card)); border-bottom: 1px solid var(--border); padding: 34px 0 30px; }
.breadcrumb { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--accent); }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--text-sub); margin-top: 6px; max-width: 760px; }

/* ---------- Hero 轮播（淡入淡出过渡） ---------- */
.hero { background: linear-gradient(135deg, var(--bg-soft), var(--card)); border-bottom: 1px solid var(--border); }
.hero .container { position: relative; min-height: 450px; }
.slide {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 48px;
  padding: 64px 0 56px;
  opacity: 0; visibility: hidden;
  position: absolute; top: 0; left: 0; right: 0;
  transition: opacity .65s ease, visibility 0s linear .65s;
}
.slide.active {
  opacity: 1; visibility: visible;
  transition: opacity .65s ease, visibility 0s;
}
.hero-tag { color: var(--accent); font-size: 13px; letter-spacing: 2px; margin-bottom: 12px; }
.hero h1 { font-size: 40px; line-height: 1.3; margin-bottom: 14px; }
.hero-sub { color: var(--text-sub); font-size: 16px; margin-bottom: 26px; max-width: 520px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 11px 26px; border-radius: 8px; font-size: 15px; margin-right: 12px;
  transition: background .2s;
}
.btn:hover { background: var(--accent-deep); }
.btn.ghost { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
.btn.ghost:hover { background: var(--bg-soft); }
.hero-img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.slide:nth-child(2) .hero-img { transform: translateY(-36px); }   /* 第二张脑影像图：视觉上移（用户调整） */
/* 终局接管（2026-08-14）：轮播图——文字列恢复原布局，眼睛放大且不溢出，两张位置一致 */
body.taken-over .hero .container { min-height: 640px; }
body.taken-over .hero-img { width: min(90%, 560px); height: auto; transform: none; }
body.taken-over .slide:nth-child(2) .hero-img { transform: none; }   /* 抵消基础样式 -36px 上移，两张位置一致 */
.dots {
  position: absolute; bottom: 6px; left: 0; right: 0;
  text-align: center; z-index: 3;
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #C3D6EA; margin: 0 5px; cursor: pointer; }
.dot.active { background: var(--accent); }

/* ---------- 数据条 ---------- */
.stats {
  display: flex; justify-content: space-around; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  margin-top: 40px; position: relative; z-index: 2; box-shadow: var(--shadow);
}
.stat { text-align: center; padding: 26px 10px; flex: 1; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { display: block; font-size: 32px; color: var(--accent); font-weight: 700; }
.stat span { font-size: 13px; color: var(--text-sub); }

/* ---------- 区块 ---------- */
.section { padding: 60px 0; }
.section.bg-soft { background: var(--bg-soft); }
.section-title { font-size: 26px; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-sub); margin-bottom: 40px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { color: var(--text-sub); font-size: 14px; }

/* 研究方向图标 */
.icon-badge {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  color: var(--accent);
}
.icon-badge svg { width: 24px; height: 24px; }

/* ---------- 公告 + 新闻 ---------- */
.notice {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 18px; font-size: 14px; color: var(--text-sub); margin-bottom: 22px;
}
.news { list-style: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.news li { display: flex; justify-content: space-between; align-items: center; padding: 15px 22px; border-bottom: 1px solid var(--border); }
.news li:last-child { border-bottom: none; }
.news a { color: var(--text); font-size: 15px; }
.news a:hover { color: var(--accent); }
.news .date { color: var(--text-sub); font-size: 13px; flex-shrink: 0; margin-left: 20px; }

/* ---------- 论文 / 脑图 ---------- */
.paper { display: flex; justify-content: space-between; gap: 16px; }
.paper .tag { color: var(--accent); font-size: 12px; border: 1px solid var(--accent); border-radius: 4px; padding: 1px 8px; flex-shrink: 0; height: fit-content; }
.brain-block { display: flex; align-items: center; gap: 26px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.brain-block img { width: 240px; border-radius: 8px; }
.brain-block p { color: var(--text-sub); font-size: 14px; }

/* ---------- 病友之声 ---------- */
.quote { position: relative; padding: 46px 24px 20px; }
.quote::before { content: "“"; position: absolute; top: 4px; left: 20px; font-size: 38px; color: #C3D6EA; font-family: Georgia, serif; line-height: 1; }
.quote p { position: relative; z-index: 1; font-size: 14px; color: var(--text); margin-bottom: 10px; }
.quote .who { font-size: 12px; color: var(--text-sub); text-align: right; }
.quote .who em { font-style: normal; color: var(--accent); }

/* ---------- 合作墙 ---------- */
.partners { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.partner {
  height: 72px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--text-sub); font-size: 13px; padding: 8px; text-align: center; line-height: 1.5;
}

/* ---------- 团队成员 ---------- */
.member-card { text-align: center; padding: 28px 20px 24px; }
.avatar {
  width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  object-fit: cover; object-position: center 20%;
}
.member-card h3 { font-size: 17px; margin-bottom: 2px; }
.member-card .title { color: var(--accent); font-size: 13px; margin-bottom: 10px; }
.member-card p { font-size: 13px; color: var(--text-sub); }
.member-card .sns { margin-top: 12px; font-size: 13px; }
.member-card .sns a { color: var(--text-sub); }
.member-card .sns a:hover { color: var(--accent); }

/* ---------- 新闻详情 ---------- */
.article {
  max-width: 780px; margin: 0 auto; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 38px 44px; box-shadow: var(--shadow);
}
.article h2 { font-size: 22px; line-height: 1.5; margin-bottom: 8px; }
.article .meta { font-size: 13px; color: var(--text-sub); padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.article p { font-size: 15px; margin-bottom: 14px; line-height: 2; }
.article h3 { font-size: 16px; margin: 20px 0 8px; }
.article .tip { background: var(--bg-soft); border-left: 4px solid var(--accent); border-radius: 6px; padding: 12px 16px; font-size: 14px; color: var(--text-sub); margin: 18px 0; }
.article .back { display: inline-block; margin-top: 10px; font-size: 14px; }

/* ---------- 问卷 ---------- */
.quiz-box { max-width: 720px; margin: 0 auto; }
.q-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.q-item h4 { font-size: 15px; margin-bottom: 12px; }
.q-item .num { color: var(--accent); font-weight: 700; margin-right: 6px; }
.q-opts { display: grid; gap: 8px; }
.q-opts label {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.q-opts label:hover { border-color: var(--accent); background: var(--bg-soft); }
.q-opts input { accent-color: var(--accent); }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-sub); }
.form-field input {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; font-size: 15px; outline: none;
}
.form-field input:focus { border-color: var(--accent); }
.quiz-result { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 44px 32px; box-shadow: var(--shadow); }
.match-num { font-size: 60px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.match-label { font-size: 15px; color: var(--text-sub); margin-bottom: 18px; }
.code-box { display: inline-block; background: var(--bg-soft); border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 22px; font-size: 22px; letter-spacing: 4px; font-weight: 700; color: var(--accent-deep); margin: 14px 0; }

/* ---------- 下载列表 ---------- */
.dl-list { max-width: 860px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dl-btn:disabled, .dl-btn:disabled:hover { opacity: 1; background: var(--accent); color: #fff; cursor: default; }   /* 占位文件：外观与可下载一致，点击无反应 */
.dl-item { display: flex; align-items: center; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.dl-item:last-child { border-bottom: none; }
.dl-item .meta { flex: 1; }
.dl-item h4 { font-size: 15px; }
.dl-item .meta p { font-size: 13px; color: var(--text-sub); }
.dl-item .badge { font-size: 12px; color: var(--text-sub); border: 1px solid var(--border); border-radius: 4px; padding: 1px 8px; flex-shrink: 0; }
.dl-btn { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 9px 18px; font-size: 14px; cursor: pointer; flex-shrink: 0; display: inline-block; text-decoration: none; line-height: 1.4; }
.dl-btn:hover { background: var(--accent-deep); color: #fff; }

/* ---------- 页脚 ---------- */
footer { background: #1F2D3D; color: #B8C6D4; margin-top: 40px; }
.footer-main { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 46px 0 36px; }
.footer-main h4 { color: #fff; font-size: 15px; margin-bottom: 14px; font-weight: 600; }
.footer-main ul { list-style: none; }
.footer-main li { margin-bottom: 8px; font-size: 13px; }
.footer-main a { color: #B8C6D4; }
.footer-main a:hover { color: #fff; }
.footer-brand { font-size: 19px; font-weight: 700; color: #fff; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-brand small { font-weight: 400; font-size: 12px; color: #7E93A8; margin-left: 6px; }
.footer-bottom { border-top: 1px solid #31404F; padding: 14px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #7E93A8; }
.forum-entry { font-size: 12px; color: #6A7F94; }
.forum-entry a { color: #6A7F94; }
.forum-entry a:hover { color: #B8C6D4; }

/* ---------- 返回顶部 ---------- */
#backTop {
  position: fixed; right: 26px; bottom: 40px; width: 40px; height: 40px;
  background: var(--accent); color: #fff; border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: none; box-shadow: var(--shadow-hover); z-index: 99;
}

/* ============================================================
   治疗者论坛（第2章）· 淡蓝后台讨论区风格（§13-1 阶段一）
   ============================================================ */

/* 论坛页头 */
.f-top { background: var(--card); border-bottom: 1px solid var(--border); }
.f-top .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.f-logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.f-logo img { width: 32px; height: 32px; }
.f-nav { display: flex; gap: 24px; list-style: none; }
.f-nav a { color: var(--text); font-size: 14px; padding: 20px 0; border-bottom: 2px solid transparent; }
.f-nav a:hover, .f-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.f-online { font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #4CAF50; display: inline-block; }

/* 论坛主体布局 */
.f-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; padding: 26px 0 50px; }
.f-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.f-card + .f-card { margin-top: 20px; }

/* 公告条 */
.f-notice { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 18px; font-size: 14px; color: var(--text-sub); margin-bottom: 20px; }

/* 分类筛选标签 */
.f-tab { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--text-sub); }
.f-tab:hover { border-color: var(--accent); color: var(--accent); }
.f-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 档案页（G5 多版本） */
.ver-tabs { display: flex; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.ver-tab { border: 1px solid var(--border); background: var(--card); border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text-sub); }
.ver-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ver-panel { display: none; padding: 24px 28px; }
.ver-panel.active { display: block; }
.ver-table { width: 100%; font-size: 14px; border-collapse: collapse; margin: 12px 0 18px; }
.ver-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ver-table td:first-child { width: 90px; color: var(--text-sub); font-size: 13px; }
.sig { font-size: 19px; color: #3A4A5A; }
.sig-kai { font-family: "KaiTi", "STKaiti", serif; }
.sig-fang { font-family: "FangSong", "STFangsong", serif; }
.sig-li { font-family: "LiSu", "STLiti", serif; }
.ver-note { font-size: 12px; color: #9AA8B6; border-top: 1px dashed var(--border); padding-top: 10px; }

/* 帖子列表 */
.f-post { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.f-post:last-child { border-bottom: none; }
.f-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-soft); border: 1px solid #D9E2EC;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--accent); font-weight: 700;
}
.f-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.f-body { flex: 1; min-width: 0; }
.f-author { font-size: 13px; color: var(--text-sub); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.badge { font-size: 11px; border-radius: 4px; padding: 1px 7px; }
.badge.res { color: #fff; background: var(--accent); }
.badge.pat { color: var(--accent); background: var(--bg-soft); }
.f-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.f-title a { color: var(--text); }
.f-title a:hover { color: var(--accent); }
.f-snippet { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.f-meta { font-size: 12px; color: #9AA8B6; display: flex; gap: 14px; }
.f-pin { color: #E8A54B; font-weight: 600; }
.f-dead { opacity: .55; }
.f-dead .f-avatar { border-style: dashed; }

/* 侧栏 */
.f-side .f-card { padding: 18px 20px; }
.f-side h4 { font-size: 14px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.f-user { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--text); }
.f-user .f-avatar { width: 32px; height: 32px; font-size: 12px; }
.f-topic { display: block; font-size: 13px; color: var(--text); padding: 7px 0; border-bottom: 1px dashed var(--border); }
.f-topic:last-child { border-bottom: none; }
.f-topic:hover { color: var(--accent); }
.f-topic .cnt { color: #9AA8B6; font-size: 12px; margin-left: 6px; }

/* 登录页（P1） */
.login-card { max-width: 430px; margin: 56px auto 70px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 38px 34px; text-align: center; }
.login-card .f-avatar { width: 56px; height: 56px; font-size: 20px; margin: 0 auto 14px; }
.login-card h2 { font-size: 20px; margin-bottom: 6px; }
.login-card .sub { font-size: 13px; color: var(--text-sub); margin-bottom: 24px; }
.login-card input {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; font-size: 15px; text-align: center; letter-spacing: 3px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card .btn { width: 100%; margin: 14px 0 0; text-align: center; border: none; cursor: pointer; }
.login-hint { font-size: 13px; margin-top: 10px; min-height: 20px; }
.login-hint.err { color: #D9534F; }
/* G3'：已注销账号矛盾留言 */
.g3 { max-width: 430px; margin: 0 auto 80px; }
.g3-title { font-size: 13px; color: #9AA8B6; margin-bottom: 10px; text-align: center; }
.g3-item { background: #F7FAFD; border: 1px dashed #C9D8E8; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; font-size: 13px; color: var(--text-sub); }
.g3-item .who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.g3-tag { font-size: 11px; color: #9AA8B6; border: 1px solid #C9D8E8; border-radius: 4px; padding: 0 6px; }
.g3-item.good { color: var(--text); }
.g3-item.bad { color: #8C6A6A; }
.g3-item .word { margin-top: 4px; }

/* 帖子详情 */
.post-main { max-width: 760px; margin: 26px auto 60px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; }
.post-main h1 { font-size: 21px; margin: 12px 0 8px; }
.post-body { font-size: 15px; line-height: 2; color: var(--text); margin: 16px 0 22px; }
.gif-ph {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 0; text-align: center;
}
.post-replies { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 22px; }
.post-replies h4 { font-size: 14px; margin-bottom: 14px; }
.reply { display: flex; gap: 12px; margin-bottom: 16px; }
.reply .f-avatar { width: 36px; height: 36px; font-size: 12px; }
.reply .body { font-size: 14px; }
.reply .who { font-size: 12px; color: var(--text-sub); margin-bottom: 2px; }

/* 私信（G7） */
.pm-box { max-width: 640px; margin: 26px auto 60px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; }
.pm-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.pm-head b { font-size: 15px; }
.pm-head .online-dot { width: 7px; height: 7px; }
.pm-log { min-height: 260px; max-height: 420px; overflow-y: auto; }
.pm-msg { display: flex; gap: 10px; margin-bottom: 14px; }
.pm-msg.me { flex-direction: row-reverse; }
.pm-bubble { max-width: 72%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; font-size: 14px; line-height: 1.7; }
.pm-msg.me .pm-bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-recall { color: #9AA8B6; font-size: 12px; font-style: italic; }
/* 撤回灰条：整行居中（微信风格），头像隐藏 */
.pm-msg:has(.pm-recall) { justify-content: center; }
.pm-msg:has(.pm-recall) .f-avatar { display: none; }
.pm-typing { color: var(--text-sub); font-size: 12px; margin-bottom: 10px; }
.pm-input { display: flex; gap: 10px; margin-top: 8px; }
.pm-input input { flex: 1; height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; }
.pm-input input:focus { border-color: var(--accent); }
.pm-input button { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 0 22px; cursor: pointer; font-size: 14px; }

/* ============================================================
   日记第一层（T8.1）· /forum/diary
   冷色过渡视觉（阶段二起）：米白纸 + 灰蓝墨 + 楷体手写感
   ============================================================ */
.diary-top { background: #2B3A4A; }
.diary-top .container { display: flex; justify-content: space-between; align-items: center; height: 48px; font-size: 13px; color: #C9D6E4; }
.diary-top a { color: #9FB2C6; }
.diary-top a:hover { color: #fff; }
.diary-wrap { background: linear-gradient(180deg, #E9EEF5, #DCE6F2); padding: 46px 0 40px; min-height: 78vh; }
/* 日记页布局：社区框贴底，内容区不留多余空白 */
.diary-body-layout { display: flex; flex-direction: column; min-height: 100vh; }
.diary-body-layout .diary-wrap { flex: 1; padding: 46px 0 24px; }
.diary-body-layout footer { margin-top: 0; }
.diary-card {
  max-width: 660px; margin: 0 auto; background: #FAF6EC;
  border: 1px solid #D8CFBC; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(43, 58, 74, .18);
  padding: 40px 48px; position: relative; min-height: 520px;
  background-image: repeating-linear-gradient(transparent 0 27px, #EDE7D8 27px 28px);
  display: grid;
}
/* 所有页叠在同一网格单元格：行高自动取最高页 → 卡片高度恒定，翻页时导航按钮不动。
   隐藏页仅 visibility:hidden（仍在流内撑高），无 JS 测量，不会因字体/宽度算错而溢出。 */
.diary-page { grid-area: 1 / 1; visibility: hidden; padding-bottom: 48px; }  /* 底部预留：页脚（绝对定位贴底）不与内容挤在一起 */
.diary-page.active { visibility: visible; }
/* 封面拉伸铺满单元格 + flex 居中：标题垂直水平都居中（封面无页脚，取消页面的底部预留，避免内容偏上） */
.diary-cover { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 0; }
.diary-cover-img { width: 150px; height: 200px; border: 2px solid #C9B89A; margin: 0 auto 22px; border-radius: 4px; background: #F7F3EA; overflow: hidden; }
.diary-cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.diary-cover h1 { font-family: "KaiTi", "STKaiti", serif; font-size: 56px; color: #3E3A33; letter-spacing: 18px; margin-bottom: 20px; text-indent: 18px; }  /* text-indent 抵消 letter-spacing 的视觉偏移，标题真正居中 */
.diary-cover p { font-family: "KaiTi", serif; font-size: 15px; color: #8A7B5E; letter-spacing: 3px; }
.diary-date { font-family: "KaiTi", "STKaiti", serif; color: #8A7B5E; font-size: 15px; letter-spacing: 2px; margin-bottom: 14px; }
.diary-body { font-family: "KaiTi", "STKaiti", serif; font-size: 17px; line-height: 28px; color: #3E3A33; }
.diary-body p { margin-bottom: 12px; }
/* 最后一页：笔迹变潦草（自救指南 + 引导句） */
.diary-guide { margin-top: 12px; font-family: "KaiTi", "STKaiti", serif; font-size: 16px; color: #5A4A3A; }
.diary-guide .self { display: block; font-size: 15px; color: #4A5A6A; margin-top: 8px; }
.diary-guide .messy {
  display: block; margin-top: 18px; font-style: italic; color: #5A3A32;
  text-decoration: underline wavy #8A7B5E 1px; text-underline-offset: 5px;
}
/* 页脚（★第二层的入口；H3 隐藏字也在这里） */
.diary-foot {
  position: absolute; bottom: 16px; left: 48px; right: 48px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: "KaiTi", serif; font-size: 13px; color: #B5AA8F;
}
.diary-h3 { cursor: pointer; user-select: none; }
.diary-h3:hover { color: #8A7B5E; }
/* 日记第二层：页脚批注（P6 凯撒） */
.diary-foot-note { display: flex; align-items: center; gap: 10px; max-width: 72%; }
.diary-foot-cipher { font-family: "Courier New", monospace; font-size: 11px; color: #B5AA8F; line-height: 1.7; }
.diary-foot-cipher.decoded { font-family: "KaiTi", "STKaiti", serif; font-size: 13px; color: #B03A3A; }
.diary-foot-btn { border: 1px solid #C9B89A; background: none; color: #8A7B5E; font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.diary-foot-btn:hover { background: #8A7B5E; color: #fff; }
/* 翻页导航 */
.diary-nav { max-width: 660px; margin: 22px auto 0; display: flex; justify-content: space-between; align-items: center; }
.diary-btn { background: #3A78B8; color: #fff; border: none; border-radius: 6px; padding: 8px 20px; cursor: pointer; font-size: 14px; }
.diary-btn:disabled { background: #A9C3DE; cursor: default; }
.diary-page-num { font-size: 13px; color: #5B6B7C; }
/* ★H3 触发后的闪字层 */
.diary-overlay {
  position: fixed; inset: 0; background: rgba(20, 26, 34, .9); color: #E8E2D2;
  display: none; flex-direction: column; justify-content: space-evenly;
  z-index: 99; font-family: "KaiTi", serif; font-size: 30px; letter-spacing: 4px;
  text-align: center; padding: 0;
}
.diary-overlay p { margin: 0; flex: 1; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.diary-overlay.show { display: flex; }
.diary-overlay.glitch { animation: dglitch 2s steps(1, end) infinite; }  /* 与 body.shake 同 2s，闪频略低 */
body.shake { animation: dshake 2s linear; }
@keyframes dshake {
  0% { transform: translate(0, 0) rotate(0); }
  8% { transform: translate(-2px, 1px) rotate(-.3deg); }
  16% { transform: translate(2px, -1px) rotate(.3deg); }
  24% { transform: translate(-1px, -2px) rotate(-.2deg); }
  32% { transform: translate(1px, 2px) rotate(.2deg); }
  40% { transform: translate(-2px, 1px) rotate(.3deg); }
  48% { transform: translate(2px, -2px) rotate(-.3deg); }
  56% { transform: translate(-1px, 1px) rotate(.2deg); }
  64% { transform: translate(1px, -1px) rotate(-.2deg); }
  72% { transform: translate(-2px, -1px) rotate(.3deg); }
  80% { transform: translate(2px, 1px) rotate(-.3deg); }
  88% { transform: translate(-1px, 2px) rotate(.2deg); }
  100% { transform: translate(0, 0) rotate(0); }
}
@keyframes dglitch {
  0%, 100% { opacity: 1; transform: translateX(0); text-shadow: none; }
  12% { opacity: .15; transform: translateX(-3px); text-shadow: 2px 0 #B03A3A, -2px 0 #4A90D9; }
  24% { opacity: 1; transform: translateX(2px); text-shadow: -2px 0 #B03A3A, 2px 0 #4A90D9; }
  38% { opacity: .3; transform: translateX(-2px); text-shadow: 3px 0 #8B0000; }
  52% { opacity: 1; transform: translateX(1px); text-shadow: 2px 0 #4A90D9, -2px 0 #B03A3A; }
  66% { opacity: .1; transform: translateX(3px); text-shadow: -3px 0 #B03A3A; }
  80% { opacity: 1; transform: translateX(-1px); text-shadow: 1px 0 #B03A3A, -1px 0 #4A90D9; }
}
@keyframes dflicker { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 900px) {
  .f-wrap { grid-template-columns: 1fr; }
  .f-side { order: -1; }
  .f-nav { gap: 14px; font-size: 13px; }
}

/* ---------- 响应式（简单处理） ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(3, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .slide { grid-template-columns: 1fr; }
  .nav .container { flex-wrap: wrap; height: auto; padding: 10px 24px; gap: 8px; }
  .nav-links { flex-wrap: wrap; gap: 14px; }
  .nav-links a { padding: 8px 0; }
}

/* ---------- 档案区（T10）---------- */
.sig-cao { font-family: "STXingkai", "华文行楷", "KaiTi", cursive; }        /* 潦草行书（版本B签名） */
.sig-hidden { color: transparent; }                                        /* 拖选/全选可见的隐藏文字 */
.sig-hidden::selection { color: #8B0000; background: #E8F0FA; }
.redact { background: #3A4A58; color: #3A4A58; border-radius: 2px; padding: 0 4px; }  /* 涂黑姓名 */
.ver-note-warn { font-size: 12px; color: #B03A3A; border-top: 1px dashed #D9B8B8; padding-top: 10px; }
.ver-tab.warn { border-color: #D9B8B8; color: #B03A3A; }
.ver-tab.warn.active { background: #B03A3A; color: #fff; border-color: #B03A3A; }
.arc-btn { display: block; margin: 14px auto 0; border: 1px solid #C9D8E8; background: var(--card); color: #7E93A8; font-size: 12px; padding: 4px 14px; border-radius: 6px; cursor: pointer; font-family: inherit; }   /* 归档入口：G5 解锁后才显示（T2.3 进度锁模拟） */
.arc-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 档案区访问密码门（2026-08-16）：密码=论坛成立日 1220，提示见暖阳帖《今天的档案区好像进不去了》 */
.arc-lock { display: none; max-width: 560px; margin: 44px auto 60px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 30px; text-align: center; }
.arc-lock-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.arc-lock-sub { font-size: 13px; color: var(--text-sub); margin-bottom: 20px; line-height: 1.9; }
.arc-lock-row { display: flex; gap: 8px; justify-content: center; }
.arc-lock-row input { flex: 1; max-width: 240px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); }
.arc-lock-row button { padding: 9px 22px; border: none; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-size: 14px; font-family: inherit; }
.arc-lock-row button:hover { opacity: 0.9; }
.arc-lock-err { color: #C0392B; font-size: 13px; margin-top: 12px; }
body.theme-g4 .arc-lock-err { color: #C0392B; }
.arc-arch:hover { color: var(--accent); }
.f-locked .f-avatar { border-style: dashed; filter: grayscale(1); }
.arc-deep { font-family: "Courier New", monospace; font-size: 13px; line-height: 2; background: #F7FAFD; border: 1px dashed #C9D8E8; border-radius: 8px; padding: 18px 22px; }
.arc-deep .res-fail { color: #B03A3A; }
.arc-deep .res-gone { color: #8B0000; font-weight: bold; }
.arc-deep .arc-title { font-weight: bold; color: #3A4A58; font-family: inherit; }
.arc-deep .arc-hand-red { font-family: 'STXingkai', cursive; color: #8B0000; }
.arc-deep .arc-hand-brown { font-family: 'STXingkai', cursive; color: #7A6A5A; }
.arc-hint { font-size: 11px; color: #9AA8B6; margin: 10px 0 0; }
/* 主页变黑（theme-g4 第4-5章）时，历史归档同步变黑红 */
body.theme-g4 .arc-deep { background: #161B22; border-color: #2A3340; }
body.theme-g4 .arc-deep .arc-title { color: #8A9BAE; }
body.theme-g4 .arc-deep .res-gone { color: #C0392B; }
body.theme-g4 .arc-deep .arc-hand-red { color: #C0392B; }
body.theme-g4 .arc-deep .arc-hand-brown { color: #A8987E; }
/* 主页变黑时，不详档案页（F-07）的暗红手写同步提亮 */
body.theme-g4.f07-page span[style*="color:#8B0000"],
body.theme-g4.f07-page p[style*="color:#8B0000"] { color: #C0392B !important; }
/* F-07 页：隐藏文字在卡片内正常文档流（透明不可见、拖选/全选显色），多段各占其位，避免绝对定位互相重合 */
body.f07-page .post-main .sig-hidden { margin: 0; line-height: 2; }
/* 短内容页：footer 贴视口底部（f07/unknown 档案页 + 帖子页 + 私信页） */
body.f07-page, body.unknown-page,
body:has(.post-main), body:has(.pm-box), body:has(.arc-lock), body:has(.id-wrap), body:has(.en-wrap) { min-height: 100vh; display: flex; flex-direction: column; }
body.f07-page main, body.unknown-page main,
body:has(.post-main) main, body:has(.pm-box) main, body:has(.arc-lock) main, body:has(.id-wrap) main, body:has(.en-wrap) main { flex: 1; }

/* 终局收尾（2026-08-16）：摄像头指示灯 + 最后一段隐藏文字 */
#camFinal { position: fixed; top: 14px; right: 16px; z-index: 9999; cursor: pointer; padding: 8px; }
#camFinal .cam-dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: #E74C3C; box-shadow: 0 0 0 0 rgba(231,76,60,.7); animation: camPulse 1.6s infinite; }
@keyframes camPulse {
  0% { box-shadow: 0 0 0 0 rgba(231,76,60,.7); }
  70% { box-shadow: 0 0 0 10px rgba(231,76,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}
#camLayer { display: none; position: fixed; inset: 0; background: rgba(5,8,14,.92); z-index: 9998; align-items: center; justify-content: center; padding: 24px; flex-direction: column; color: #cfd6e0; font-family: Consolas, "Courier New", monospace; font-size: 15px; line-height: 2.2; letter-spacing: 1px; cursor: pointer; }
#camLayer p { margin: 0; }
#camLayer p:empty { height: 1em; }

/* ============================================================
   设计系统 v2 · 覆盖层（2026-08-17）
   —— 统一升级字体与动效，不破坏下方各页面专属样式
   视觉定位：科研机构之温 → 冷峻之蓝 → 黑红之渊（朝终局过渡）
   ============================================================ */

/* ---------- 设计令牌：字体 + 节奏 + 渐变 ---------- */
:root {
  --font-display: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "思源黑体", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-s: .45s;
  --dur-m: .8s;
  --grad: linear-gradient(115deg, #5D99D6 0%, #9CC0EC 100%);
  --accent-glow: rgba(74, 144, 217, .16);
  --ring: 0 0 0 3px var(--accent-glow);
}
body.theme-g3 {
  --grad: linear-gradient(115deg, #4786C9 0%, #83AEDF 100%);
  --accent-glow: rgba(58, 110, 168, .16);
}
body.theme-g4 {
  --grad: linear-gradient(115deg, #A31212 0%, #E04A4A 100%);
  --accent-glow: rgba(163, 18, 18, .30);
}

/* 基础正文：更克制的行距与平滑渲染 */
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .01em;
}

/* 系统级文本选择 / 焦点环 */
::selection { background: var(--accent); color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: none; box-shadow: var(--ring); border-radius: 4px;
}

/* ---------- 独特字体：衬线标题点亮编辑部式的克制 ---------- */
.logo { font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; }
.logo span { font-weight: 700; }
.hero h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.page-head h1 { font-family: var(--font-display); letter-spacing: .03em; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: .10em;
  position: relative; padding-bottom: 18px; text-indent: .10em;
}
/* 标题下的小节线下划线：渐变动点，四季更替的坐标轴 */
.section-title::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 54px; height: 2px; border-radius: 2px;
  background: var(--grad); box-shadow: 0 0 12px var(--accent-glow);
}
.section-sub { letter-spacing: .22em; text-indent: .22em; }
.stats b {
  font-family: var(--font-display);
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.f-title { font-weight: 600; }

/* ---------- 动效体系：Hero 载入 / 滚动显现 / 微交互 ---------- */

/* ① Hero 载入：分层错落的进入（挡住下一张 slide 的绝对定位） */
.hero .slide { isolation: isolate; }
.hero .slide .hero-tag,
.hero .slide h1,
.hero .slide .hero-sub,
.hero .slide .btn, .hero .slide .hero-img {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  animation: heroEnter .7s var(--ease) forwards;
}
.hero .slide.active .hero-tag { animation-delay: .10s; }
.hero .slide.active h1 { animation-delay: .22s; }
.hero .slide.active .hero-sub { animation-delay: .34s; }
.hero .slide.active .btn, .hero .slide.active .hero-img { animation-delay: .46s; }
@keyframes heroEnter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ② 滚动显现：common.js 给 <main> 的结构块加 .reveal-up（初始隐藏），进入视口后加 .in 播放浮起动效。
   类名用唯一 token，避免与 original_proposal 修订记录里原有的 .rev 冲突 */
.reveal-up { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-up.in { opacity: 1; transform: none; }
/* 结构块内子项：随父级显现时依次浮起（1-9 排消除器，线性渐增延迟） */
.reveal-up .grid > *, .reveal-up .partners > *, .reveal-up .news li, .reveal-up .stats .stat,
.reveal-up .grid-3 > *, .reveal-up .grid-2 > *, .reveal-up .grid-4 > * { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal-up.in .grid > *, .reveal-up.in .partners > *, .reveal-up.in .news li, .reveal-up.in .stats .stat,
.reveal-up.in .grid-3 > *, .reveal-up.in .grid-2 > *, .reveal-up.in .grid-4 > * { opacity: 1; transform: none; }
/* 遮蔽滚动显现的初始态：在未观测到系统时放行展示（见 JS-fallback） */
html.no-reveal .reveal-up, html.no-reveal .reveal-up .card *, html.no-reveal .reveal-up .grid > *, html.no-reveal .reveal-up .partners > * { opacity: 1 !important; transform: none !important; }

/* ③ 导航：原版链接自带 border-bottom 下划线（激活/悬停变色），此处不再叠加，避免出现双线 */

/* ④ 按钮：渐变色流动 + 掠过光芒 */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  background-image: var(--grad); background-size: 180% 100%; background-position: 0% 0;
  transition: background-position .4s var(--ease), transform .25s var(--ease), box-shadow .3s var(--ease);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn.ghost { background-image: none; box-shadow: none; }
.btn::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 56%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .55s var(--ease); z-index: 1;
}
.btn:hover::before { left: 130%; }

/* ⑤ 卡片：浮起 + 顶部高光收纳线 */
.card { position: relative; }
.card::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: var(--grad); opacity: 0; transition: opacity .3s var(--ease); border-radius: 2px;
}
.card:hover::before { opacity: 1; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
@media (hover: hover) {
  .card { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
}

/* 应用场景：第 1/2 阶段背景的柔和氛围光 */
.hero, .page-head { position: relative; overflow: hidden; }
.hero::before, .page-head::before {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent-glow), transparent 70%);
  top: -160px; right: -120px; pointer-events: none; z-index: 0;
}
.hero .container, .page-head .container { position: relative; z-index: 1; }

/* 减少动态偏好：关闭横向位移与显现动效 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-up, .reveal-up .grid > *, .reveal-up .partners > *, .reveal-up .news li, .reveal-up .stats .stat,
  .reveal-up .grid-3 > *, .reveal-up .grid-2 > *, .reveal-up .grid-4 > *,
  .hero .slide .hero-tag, .hero .slide h1, .hero .slide .hero-sub,
  .hero .slide .btn, .hero .slide .hero-img { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
}

/* ---------- 短内容页底栏对齐 ------------- */
body:has(.reveal-up) { scroll-behavior: smooth; }
