/* ==========================================================================
   公文写作课程站 · 视觉系统
   配色：白(背景) + 朱砂红(强调) + 灰(层次)
   气质：规范、严肃、留白充足；以红头文件与印章为灵感。
   ========================================================================== */

:root {
  /* 主色 */
  --red: #b01f24;          /* 朱砂红 · 公文红头 */
  --red-bright: #d4252c;
  --red-soft: #f7e9e9;     /* 极浅红底 */
  --red-line: #e7c9c9;

  /* 灰阶 */
  --ink: #1d1d1f;          /* 近黑 · 标题 */
  --gray-900: #2b2b2e;
  --gray-700: #4a4a4f;
  --gray-500: #7a7a82;
  --gray-400: #9a9aa2;
  --gray-300: #c8c8ce;
  --gray-200: #e6e6ea;
  --gray-100: #f2f2f5;
  --gray-50:  #f8f8fa;

  /* 背景 */
  --bg: #ffffff;
  --bg-soft: #f7f7f9;

  /* 字体 */
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Songti SC", "SimSun", "STSong", Georgia, serif;     /* 公文/宋体感 */
  --kai: "STKaiti", "KaiTi", "楷体", "Songti SC", serif;

  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20,20,30,.05), 0 2px 8px rgba(20,20,30,.04);
  --shadow-md: 0 6px 24px rgba(20,20,30,.08);
  --shadow-red: 0 8px 26px rgba(176,31,36,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--gray-900);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--red); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-block;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); font-weight: 700; margin-bottom: 14px;
}
.divider-red { width: 56px; height: 4px; background: var(--red); border-radius: 4px; margin: 18px 0; }

/* ───────────── 顶部导航 ───────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo-frame {
  width: 40px; height: 40px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.brand-logo { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; color: var(--ink); letter-spacing: .02em; }
.brand-text small { font-size: 11px; color: var(--gray-500); letter-spacing: .12em; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-size: 15px; color: var(--gray-700); font-weight: 500; transition: .18s;
}
.nav-link:hover { color: var(--red); background: var(--gray-100); }
.nav-link.active { color: var(--red); font-weight: 700; }
.nav-link.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 3px; background: var(--red); border-radius: 3px;
}
.menu-button {
  display: none; margin-left: auto; background: none; border: 1px solid var(--gray-200);
  border-radius: 9px; padding: 8px; color: var(--ink); cursor: pointer;
}

/* ───────────── 按钮 ───────────── */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 10px; transition: .18s; box-shadow: var(--shadow-red);
  border: 1px solid var(--red);
}
.button:hover { background: #97191e; transform: translateY(-1px); }
.button.secondary {
  background: #fff; color: var(--red); border: 1px solid var(--red-line); box-shadow: none;
}
.button.secondary:hover { background: var(--red-soft); color: var(--red); }
.button .arrow { width: 18px; height: 18px; transition: transform .18s; }
.button:hover .arrow { transform: translateX(3px); }
.button.ghost { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-200); box-shadow: none; }
.button.ghost:hover { background: var(--gray-100); color: var(--ink); }

/* ───────────── Hero ───────────── */
.home-hero { position: relative; background: var(--bg); overflow: hidden; }
.home-hero::before {
  /* 红头装饰带 */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--red), var(--red-bright));
}
.home-hero-grid {
  display: grid; grid-template-columns: 1.35fr .65fr; gap: 48px; align-items: center;
  padding: 76px 24px 64px;
}
.home-copy { min-width: 0; padding-right: 24px; }
.home-title {
  font-family: var(--serif); font-size: clamp(22px, 3.8vw, 48px); font-weight: 800;
  letter-spacing: .01em; line-height: 1.2; margin: 6px 0 18px;
  white-space: nowrap;
}
.home-title .accent { color: var(--red); }
.home-lead { font-size: 18px; color: var(--gray-700); margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span {
  font-size: 13px; color: var(--gray-700); background: var(--gray-100);
  border: 1px solid var(--gray-200); padding: 6px 12px; border-radius: 999px;
}
.course-team { display: flex; gap: 22px; margin: 18px 0 6px; }
.team-credit { font-size: 14px; color: var(--gray-500); }
.team-credit strong { color: var(--ink); margin-left: 4px; font-size: 15px; }

/* Hero 右侧印章视觉 */
.hero-seal-wrap { display: grid; place-items: center; }
.hero-seal {
  width: min(320px, 80%); filter: drop-shadow(0 10px 30px rgba(176,31,36,.18));
  animation: seal-in .8s ease both;
}
@keyframes seal-in { from { opacity: 0; transform: scale(.9) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* ───────────── 区块通用 ───────────── */
.section { padding: 72px 0; }
.section.soft { background: var(--bg-soft); }
.section-heading { margin-bottom: 40px; }
.section-heading h2 { font-size: clamp(26px, 3.2vw, 36px); font-family: var(--serif); }
.section-heading p { color: var(--gray-500); max-width: 640px; }

/* ───────────── 卡片网格 ───────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--red-line); }
.card .kicker { font-size: 13px; color: var(--red); font-weight: 700; letter-spacing: .08em; }
.card h3 { font-size: 20px; margin: 10px 0 8px; }
.card p { color: var(--gray-700); font-size: 15px; margin: 0; }
.card .card-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--red-soft);
  color: var(--red); display: grid; place-items: center; margin-bottom: 16px;
}
.card .card-icon svg { width: 24px; height: 24px; }

/* 模块入口卡（首页大卡，含跳转） */
.module-card {
  position: relative; display: block; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); transition: .2s; overflow: hidden;
}
.module-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red);
  transform: scaleY(0); transform-origin: top; transition: .22s;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.module-card:hover::before { transform: scaleY(1); }
.module-card .num { font-family: var(--serif); font-size: 14px; color: var(--red); font-weight: 700; letter-spacing: .1em; }
.module-card h3 { font-size: 22px; margin: 8px 0 8px; }
.module-card p { color: var(--gray-700); font-size: 15px; }
.module-card .more { margin-top: 14px; color: var(--red); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.module-card .more svg { width: 16px; height: 16px; }

/* ───────────── 课程路径（大纲概览） ───────────── */
.phase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.phase-card {
  display: block; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: .2s; border-top: 3px solid var(--red);
}
.phase-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.phase-card span { font-size: 12px; color: var(--gray-500); letter-spacing: .08em; font-weight: 600; }
.phase-card h3 { font-size: 19px; margin: 10px 0 8px; }
.phase-card p { color: var(--gray-700); font-size: 14px; margin: 0; }

/* ───────────── 表格（公文格式气质） ───────────── */
.doc-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.doc-table th, .doc-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); font-size: 15px; }
.doc-table thead th { background: var(--red); color: #fff; font-weight: 600; letter-spacing: .02em; }
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover { background: var(--gray-50); }
.doc-table .wk { font-family: var(--serif); color: var(--red); font-weight: 700; white-space: nowrap; }

/* ───────────── 标签页 / 过滤 ───────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tab {
  border: 1px solid var(--gray-200); background: #fff; color: var(--gray-700);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; cursor: pointer; transition: .18s;
}
.tab:hover { border-color: var(--red-line); color: var(--red); }
.tab.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ───────────── 知识库 / 技能 列表 ───────────── */
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.lib-count { color: var(--gray-500); font-size: 14px; }
.lib-list { display: grid; gap: 14px; }
.lib-item {
  display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); padding: 18px 22px; box-shadow: var(--shadow-sm); transition: .18s;
}
.lib-item:hover { border-color: var(--red-line); box-shadow: var(--shadow-md); }
.lib-code {
  flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--red-soft);
  color: var(--red); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 14px;
}
.lib-meta { flex: 1; min-width: 0; }
.lib-meta h3 { font-size: 17px; margin: 0 0 4px; }
.lib-meta p { margin: 0; color: var(--gray-500); font-size: 13px; }
.lib-tag { display: inline-block; font-size: 12px; color: var(--red); background: var(--red-soft); border: 1px solid var(--red-line); padding: 2px 10px; border-radius: 999px; margin-left: 8px; }
.lib-actions { display: flex; gap: 10px; flex: none; }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 28px;
  text-align: center; background: var(--gray-50); transition: .2s; margin-bottom: 30px;
}
.upload-zone.drag { border-color: var(--red); background: var(--red-soft); }
.upload-zone h3 { margin: 0 0 6px; }
.upload-zone p { color: var(--gray-500); font-size: 14px; margin: 0 0 16px; }

/* ───────────── 技能卡片 ───────────── */
.skill-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: .2s;
}
.skill-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--red-line); }
.skill-badge {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line);
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.skill-card h3 { font-size: 19px; margin: 0 0 8px; }
.skill-card .one-liner { color: var(--red); font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.skill-card p { color: var(--gray-700); font-size: 14px; flex: 1; }
.skill-card .skill-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 10px; }
.skill-card .src { font-size: 12px; color: var(--gray-500); }
.skill-card .dl-btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff;
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--red); transition: .18s;
}
.skill-card .dl-btn:hover { background: #97191e; }
.skill-card .dl-btn svg { width: 16px; height: 16px; }
.skill-card .dl-btn.disabled { background: #fff; color: var(--gray-400); border-color: var(--gray-200); cursor: not-allowed; }

/* ───────────── 关于 / 时间线 ───────────── */
.about-hero { padding: 70px 0 30px; }
.about-hero h1 { font-family: var(--serif); font-size: clamp(30px,4vw,44px); }
.lead-text { font-size: 18px; color: var(--gray-700); max-width: 760px; }
.timeline { border-left: 3px solid var(--red-line); margin-left: 8px; padding-left: 26px; }
.timeline li { position: relative; list-style: none; margin: 0 0 22px; }
.timeline li::before { content: ""; position: absolute; left: -35px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--red-line); }
.timeline strong { color: var(--ink); }
.timeline span { color: var(--gray-700); display: block; font-size: 15px; }

/* 统计条 */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.stat { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; text-align: center; }
.stat .n { font-family: var(--serif); font-size: 34px; color: var(--red); font-weight: 800; }
.stat .l { color: var(--gray-500); font-size: 14px; }

/* ───────────── 页脚 ───────────── */
.site-footer { background: var(--gray-50); border-top: 3px solid var(--red); padding: 48px 0 30px; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.footer-inner h4 { font-size: 15px; color: var(--ink); margin-bottom: 14px; }
.footer-inner a, .footer-inner p { color: var(--gray-500); font-size: 14px; display: block; margin: 0 0 8px; }
.footer-inner a:hover { color: var(--red); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { width: 34px; height: 34px; }
.footer-bottom { border-top: 1px solid var(--gray-200); margin-top: 28px; padding-top: 18px; color: var(--gray-400); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ───────────── 提示/警示条 ───────────── */
.note { background: var(--red-soft); border: 1px solid var(--red-line); border-left: 4px solid var(--red); border-radius: 10px; padding: 14px 18px; color: var(--red); font-size: 14px; }
.note.gray { background: var(--gray-100); border-color: var(--gray-200); border-left-color: var(--gray-300); color: var(--gray-700); }

/* ───────────── 响应式 ───────────── */
@media (max-width: 900px) {
  .home-hero-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 48px; }
  .hero-seal-wrap { order: -1; }
  .phase-grid, .grid-3, .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 12px; border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-md); }
  .menu-button { display: inline-flex; }
  .phase-grid, .grid-3, .grid-2, .grid-4, .stats { grid-template-columns: 1fr; }
  .lib-item { flex-wrap: wrap; }
  .lib-actions { width: 100%; }
  .section { padding: 52px 0; }
}
