/**
 * 《未来工坊》数字活页站点样式
 * 界面与功能对齐 Aesthetics：浅色主题、顶栏导航、课程地图/任务资源
 */
:root {
  --fw-primary: #0066b3;
  --fw-primary-hover: #0079d4;
  --fw-nav-bg: #37474f;
  --fw-nav-text: rgba(255,255,255,0.92);
  --fw-bg: #fff;
  --fw-fg: #1a1a1a;
  --fw-border: #e0e0e0;
  --fw-muted: #555;
  --fw-font: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--fw-font);
  background: var(--fw-bg);
  color: var(--fw-fg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== 顶栏导航（对齐 Aesthetics）========== */
.fw-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 3.6rem;
  background: var(--fw-nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.fw-navbar .site-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  margin-right: 1.5rem;
}
.fw-navbar .site-name:hover { color: #fff; }
.fw-navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.fw-navbar .nav-link {
  color: var(--fw-nav-text);
  text-decoration: none;
  padding: 0 1rem;
  font-size: 0.9rem;
  line-height: 3.6rem;
}
.fw-navbar .nav-link:hover { color: #fff; }
.fw-navbar .nav-link.active { color: #fff; font-weight: 600; }

/* 模块下拉 */
.fw-navbar .dropdown {
  position: relative;
  display: inline-block;
}
.fw-navbar .dropdown-title {
  background: transparent;
  border: none;
  color: var(--fw-nav-text);
  font-size: 0.9rem;
  font-family: var(--fw-font);
  cursor: pointer;
  padding: 0 1rem;
  line-height: 3.6rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.fw-navbar .dropdown-title:hover { color: #fff; }
.fw-navbar .dropdown-arrow { font-size: 0.6rem; }
.fw-navbar .nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--fw-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}
.fw-navbar .dropdown:hover .nav-dropdown { display: block; }
.fw-navbar .nav-dropdown a {
  display: block;
  padding: 0.4rem 1rem;
  color: var(--fw-fg);
  text-decoration: none;
  font-size: 0.9rem;
}
.fw-navbar .nav-dropdown a:hover { color: var(--fw-primary); }

/* 主内容区（为固定顶栏留空）*/
.fw-main { padding-top: 3.6rem; min-height: 100vh; }

/* ========== 首页 ========== */
.fw-home {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.fw-home h1 { font-size: 2rem; margin-top: 0; margin-bottom: 0.5rem; }
.fw-home .subtitle { font-size: 0.9rem; color: var(--fw-muted); margin-bottom: 1.5rem; }
.fw-home hr { border: none; border-top: 1px solid var(--fw-border); margin: 1.5rem 0; }
.fw-home h2 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--fw-border); }
.fw-home ol, .fw-home ul { padding-left: 1.5rem; }
.fw-home li { margin-bottom: 0.5rem; }
.fw-home a { color: var(--fw-primary); text-decoration: none; }
.fw-home a:hover { text-decoration: underline; }

/* 入口卡片网格（对齐 Aesthetics home-entry-grid）*/
.home-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
  max-width: 800px;
}
.home-entry-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--fw-border);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.home-entry-card:hover { border-color: #ccc; background: #f9f9f9; }
.home-entry-card__title { font-size: 1.1rem; font-weight: 600; color: var(--fw-primary); margin-bottom: 0.35rem; }
.home-entry-card__desc { font-size: 0.9rem; color: var(--fw-muted); line-height: 1.5; }
@media (max-width: 719px) { .home-entry-grid { grid-template-columns: 1fr; } }

/* 64 任务网格（首页下方）*/
.tasks-grid {
  padding: 0;
  max-width: 100%;
}
.tasks-grid .module-block { margin-bottom: 2rem; }
.tasks-grid .module-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fw-fg);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--fw-border);
}
.tasks-grid .module-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.tasks-grid .task-card {
  display: block;
  background: #fff;
  border: 1px solid var(--fw-border);
  border-radius: 4px;
  padding: 1rem;
  text-decoration: none;
  color: var(--fw-fg);
  transition: border-color 0.2s, background 0.2s;
}
.tasks-grid .task-card:hover { border-color: var(--fw-primary); background: #f5f9fc; }
.tasks-grid .task-card .task-id { font-size: 0.85rem; color: var(--fw-primary); font-weight: 700; margin-bottom: 0.25rem; }
.tasks-grid .task-card .task-title { font-size: 1rem; font-weight: 600; margin: 0; }

/* ========== 通用内容页（课程地图、任务资源、开营致辞）========== */
.fw-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.fw-page h1 { font-size: 2rem; margin-top: 0; margin-bottom: 0.75rem; }
.fw-page .subtitle { font-size: 0.95rem; color: var(--fw-muted); margin-bottom: 1rem; }
.fw-page h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--fw-border); }
.fw-page p { margin: 0.5rem 0 1rem; }
.fw-page a { color: var(--fw-primary); text-decoration: none; }
.fw-page a:hover { text-decoration: underline; }
.fw-page blockquote { border-left: 4px solid var(--fw-border); margin: 1rem 0; padding: 0.25rem 0 0.25rem 1rem; color: var(--fw-muted); }

/* 表格（对齐 Aesthetics）*/
.fw-page table, .task-page table {
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
}
.fw-page tr { border-top: 1px solid #dfe2e5; }
.fw-page tr:nth-child(2n) { background: #f6f8fa; }
.fw-page td, .fw-page th { border: 1px solid #dfe2e5; padding: 0.5rem 0.75rem; }
.fw-page th { font-weight: 600; text-align: left; }

/* ========== 任务详情页 ========== */
.task-page {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.task-page .back-link { color: var(--fw-primary); margin-bottom: 1rem; display: inline-block; }
.task-banner {
  border: 2px solid var(--fw-primary);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  background: #f5f9fc;
}
.task-banner h1 { margin: 0 0 0.25rem 0; font-size: clamp(1.35rem, 2.5vw, 1.75rem); color: var(--fw-fg); }
.task-banner .task-subtitle { color: var(--fw-primary); font-size: 1rem; }
.task-banner .task-id { font-size: 0.9rem; color: var(--fw-muted); margin-top: 0.5rem; }
.task-banner img.banner-image { max-width: 100%; height: auto; margin-top: 0.75rem; border-radius: 4px; }

.task-section { margin-bottom: 1.5rem; }
.task-section h2 { font-size: 1.2rem; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--fw-border); color: var(--fw-fg); }

/* 任务页两大块：老师用 / 学生用 */
.task-block-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fw-fg);
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.task-section--teacher .task-block-title { background: #e8f4fc; border-left: 4px solid #1565c0; }
.task-section--student .task-block-title { background: #f0f7e8; border-left: 4px solid #2e7d32; }
.task-subsection { margin-bottom: 1.25rem; }
.task-subsection h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fw-fg);
}
.task-flow-intro {
  font-size: 0.95rem;
  color: var(--fw-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.fw-instruction { color: var(--fw-fg); }
.fw-instruction .fw-instruction__step { background: #f8fafc; border-left-color: var(--fw-primary); }
.fw-instruction .fw-instruction__step-num { color: var(--fw-primary); }
.fw-instruction .fw-instruction__step-desc strong { color: var(--fw-primary); }
/* 五、任务流程 — 步骤标题与块分隔（使用显式「第X步：phaseName」，不用 counter） */
.task-flow-steps .fw-instruction__step-num::before { content: none; }
.task-flow-steps .fw-instruction__step-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fw-fg);
  margin-bottom: 0.5rem;
}
.step-block { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--fw-border); }
.step-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.step-block__header .fw-instruction__step-num { margin-bottom: 0; }
.step-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
/* 时间、自检标准、提供的资料 */
.step-meta { margin: 0.35rem 0; font-size: 0.95rem; }
.step-meta strong { color: var(--fw-fg); }
.step-resources { margin-top: 0.25rem; margin-bottom: 0.5rem; min-height: 1.5rem; }
.step-resources .step-media__img { margin-bottom: 0.5rem; }
.step-resources .step-links__a { margin-right: 0.5rem; margin-bottom: 0.25rem; }
.step-resources-empty { color: var(--fw-muted); }

/* 提供的资料：可展开/收起的资源块 */
.step-resource-item { margin-bottom: 0.75rem; border: 1px solid var(--fw-border); border-radius: 6px; overflow: hidden; }
.step-resource-item__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f5f7f9;
  border: none;
  cursor: pointer;
  font-family: var(--fw-font);
  font-size: 0.95rem;
  text-align: left;
  color: var(--fw-fg);
}
.step-resource-item__head:hover { background: #eef1f4; }
.step-resource-item__label { font-weight: 500; }
.step-resource-item__arrow { font-size: 0.75rem; color: var(--fw-muted); transition: transform 0.2s; }
.step-resource-item__body { padding: 0.75rem 1rem; background: #fff; border-top: 1px solid var(--fw-border); }
.step-resource-item__body.hidden { display: none; }
.step-resource-usage { margin: 0 0 0.5rem 0; font-size: 0.9rem; color: var(--fw-muted); line-height: 1.5; }
.step-resource-json-preview { margin: 0.75rem 0 0.5rem 0; }
.step-resource-json-title { font-weight: 700; margin: 0 0 0.25rem 0; font-size: 1rem; }
.step-resource-json-usage { font-size: 0.9rem; color: var(--fw-muted); margin: 0 0 0.5rem 0; }
.step-resource-json-hint { font-size: 0.95rem; margin: 0 0 0.5rem 0; color: var(--fw-primary); }
.step-resource-auction-list { margin: 0.5rem 0 0; padding-left: 1.5rem; line-height: 1.6; }
.step-resource-auction-list li { margin-bottom: 0.35rem; }
.step-resource-json-loading, .step-resource-json-err { color: var(--fw-muted); font-size: 0.9rem; margin: 0; }
.step-resource-item__img { display: block; margin: 0.5rem 0; max-width: 100%; border-radius: 4px; }
.step-resource-item__caption { margin: 0.25rem 0 0.5rem 0; font-size: 1rem; font-weight: 600; color: var(--fw-fg); line-height: 1.4; }
.step-resource-item__iframe { display: block; width: 100%; min-height: 90vh; height: 95vh; max-height: none; border: 1px solid var(--fw-border); border-radius: 6px; margin: 0.5rem 0; background: #fff; }

/* 五、任务流程 — 步骤内嵌图与链接 */
.step-media { margin: 0.75rem 0; }
.step-media__img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--fw-border); display: block; margin-bottom: 0.5rem; }
.step-media__img:last-child { margin-bottom: 0; }
.step-term-link { margin: 0.5rem 0; font-size: 0.95rem; }
.step-term-link a { color: var(--fw-primary); text-decoration: none; }
.step-term-link a:hover { text-decoration: underline; }
.step-links { margin: 0.5rem 0; font-size: 0.95rem; }
.step-links__a {
  display: inline-block;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #f0f7ff;
  border: 1px solid var(--fw-primary);
  color: var(--fw-primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}
.step-links__a:hover { background: var(--fw-primary); color: #fff; }

/* 任务正文中的术语词典链接 */
.glossary-term-link {
  color: var(--fw-primary);
  text-decoration: underline;
}
.glossary-term-link:hover { text-decoration: none; }

.expert-tips-toggle {
  padding: 0.5rem 1rem;
  background: var(--fw-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--fw-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.75rem;
}
.expert-tips-toggle:hover { background: var(--fw-primary-hover); }
.expert-tips-box { border: 1px solid var(--fw-border); border-radius: 6px; padding: 1rem; background: #f9fafb; margin-bottom: 1rem; }
.expert-tips-box.hidden { display: none; }
.expert-tips-box .expert-tips-empty { color: #6b7280; font-style: italic; margin: 0; }
.expert-tip-item { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px dashed var(--fw-border); }
.expert-tip-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.expert-tip-item .pit { font-weight: 700; color: var(--fw-primary); margin-bottom: 0.25rem; }

/* 本任务作业纸（可展开/收起） */
.task-worksheet-toggle { margin-top: 0.25rem; }
.task-worksheet-box { border: 1px solid var(--fw-border); border-radius: 6px; padding: 1rem; background: #f9fafb; margin-bottom: 1rem; }
.task-worksheet-box.hidden { display: none; }
.task-worksheet-item { margin-bottom: 1.5rem; }
.task-worksheet-item:last-child { margin-bottom: 0; }
.task-worksheet-label { font-weight: 600; margin-bottom: 0.5rem; color: var(--fw-fg); }
.task-worksheet-iframe { width: 100%; min-height: 400px; border: 1px solid var(--fw-border); border-radius: 4px; background: #fff; }
.task-worksheet-actions { font-size: 0.9rem; color: var(--fw-muted); margin-top: 0.5rem; }
.task-worksheet-actions a { color: var(--fw-primary); }

/* 本任务问卷（可展开/收起） */
.task-questionnaire-toggle { margin-top: 0.25rem; }
.task-questionnaire-box { border: 1px solid var(--fw-border); border-radius: 6px; padding: 1rem; background: #f9fafb; margin-bottom: 1rem; }
.task-questionnaire-box.hidden { display: none; }
.task-questionnaire-item { margin-bottom: 1.5rem; }
.task-questionnaire-item:last-child { margin-bottom: 0; }
.task-questionnaire-label { font-weight: 600; margin-bottom: 0.5rem; color: var(--fw-fg); }
.task-questionnaire-iframe { width: 100%; min-height: 400px; border: 1px solid var(--fw-border); border-radius: 4px; background: #fff; }
.task-questionnaire-actions { font-size: 0.9rem; color: var(--fw-muted); margin-top: 0.5rem; }
.task-questionnaire-actions a { color: var(--fw-primary); }

/* 本任务术语（第3步支架后，可展开/收起） */
.task-terms-toggle {
  padding: 0.5rem 1rem;
  background: var(--fw-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--fw-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.task-terms-toggle:hover { background: var(--fw-primary-hover); }
.task-terms-box { border: 1px solid var(--fw-border); border-radius: 6px; padding: 1rem; background: #f9fafb; margin-bottom: 1rem; }
.task-terms-box.hidden { display: none; }
.task-terms-by-module { margin-bottom: 1.25rem; }
.task-terms-by-module:last-child { margin-bottom: 0; }
.task-terms-module-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.35rem 0; color: var(--fw-fg); }
.task-terms-task-label { font-size: 0.9rem; color: var(--fw-muted); margin: 0 0 0.5rem 0; }
.task-term-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.task-term-item { border: 1px solid var(--fw-border); border-radius: 4px; background: #fff; overflow: hidden; }
.task-term-item__head {
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-family: var(--fw-font);
  font-size: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fw-primary);
  text-decoration: underline;
}
.task-term-item__head:hover { background: #f0f4f8; }
.task-term-item__arrow { font-size: 0.75em; transition: transform 0.2s; }
.task-term-item__body { padding: 0.75rem 1rem; border-top: 1px solid var(--fw-border); }
.task-term-item__body.hidden { display: none; }
.task-term-item__body p { margin: 0.5rem 0 0; }
.task-term-item__body p:first-child { margin-top: 0; }
.task-term-explanation, .task-term-guidance { font-size: 0.95rem; line-height: 1.5; }
.task-term-glossary-link { display: inline-block; margin-top: 0.75rem; font-size: 0.9rem; color: var(--fw-primary); }
.task-terms-list .glossary-term-link { display: inline-block; }

.rubric-list, .reflection-box {
  background: #f9fafb;
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid var(--fw-border);
}
.rubric-list ul, .reflection-box p { margin: 0; padding-left: 1.25rem; }
.rubric-list li { margin-bottom: 0.35rem; }
.reflection-box p { font-style: italic; color: var(--fw-muted); }

/* 一、子项目描述 */
.task-desc-box p { margin: 0.75rem 0; }
.task-desc-box p:first-child { margin-top: 0; }
.objectives-list { padding-left: 1.5rem; margin: 0.5rem 0 1rem; }
.objectives-list li { margin-bottom: 0.5rem; }
.resource-desc-list { margin: 0.5rem 0 1rem; padding-left: 1.5rem; }
.resource-desc-list li { margin-bottom: 0.35rem; }
.step-label { margin-bottom: 0.75rem; font-weight: 600; color: var(--fw-fg); }
.process-table-wrap { overflow-x: auto; margin: 1rem 0; }
.process-table { border-collapse: collapse; width: 100%; min-width: 560px; }
.process-table th, .process-table td { border: 1px solid var(--fw-border); padding: 0.5rem 0.6rem; font-size: 0.9rem; text-align: left; }
.process-table th { background: #f6f8fa; font-weight: 600; }
.process-table tr:nth-child(even) { background: #f9fafb; }

.resources-list a {
  display: inline-block;
  margin-right: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: #fff;
  border: 1px solid var(--fw-primary);
  color: var(--fw-primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
}
.resources-list a:hover { background: var(--fw-primary); color: #fff; }

/* ========== 术语词典页 ========== */
.glossary-filter {
  font-size: 1rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--fw-border);
  border-radius: 4px;
  font-family: var(--fw-font);
  margin-left: 0.5rem;
}
.glossary-module-block { margin-bottom: 2.5rem; }
.glossary-module-block:first-of-type { margin-top: 0; }
.glossary-module-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fw-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--fw-border);
}
.glossary-task-block { margin-bottom: 1.5rem; }
.glossary-task-block:last-child { margin-bottom: 0; }
.glossary-task-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fw-fg);
  margin: 0 0 0.75rem 0;
  padding-left: 0.25rem;
  border-left: 3px solid var(--fw-primary);
}
.glossary-term-list { display: flex; flex-direction: column; gap: 1.25rem; }
.glossary-term-card {
  background: #f9fafb;
  border: 1px solid var(--fw-border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
}
.glossary-term-card--collapsible { padding: 0; overflow: hidden; }
.glossary-term-card__head {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--fw-font);
  font-size: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fw-primary);
  transition: background 0.2s;
}
.glossary-term-card__head:hover { background: #f0f4f8; }
.glossary-term-card__arrow { font-size: 0.75em; transition: transform 0.2s; }
.glossary-term-card__body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--fw-border);
}
.glossary-term-card__body.hidden { display: none; }
.glossary-term-card__body .glossary-term-explanation,
.glossary-term-card__body .glossary-term-guidance { margin-top: 0.75rem; }
.glossary-term-tasks { margin-top: 0.75rem; font-size: 0.9rem; }
.glossary-term-task-link { color: var(--fw-primary); margin-right: 0.25rem; }
.glossary-term-task-link:hover { text-decoration: underline; }
.glossary-term-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fw-fg);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}
.glossary-term-card--collapsible .glossary-term-card__head .glossary-term-name { margin: 0; }
.glossary-term-explanation,
.glossary-term-guidance {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fw-fg);
}
.glossary-term-guidance { margin-bottom: 0; }
.glossary-term-card p:last-child { margin-bottom: 0; }

/* ========== 移动端适配 ========== */
* { -webkit-tap-highlight-color: transparent; }
body { -webkit-text-size-adjust: 100%; }

/* 下拉菜单：触摸设备支持 focus-within */
.fw-navbar .dropdown:hover .nav-dropdown,
.fw-navbar .dropdown:focus-within .nav-dropdown { display: block; }

@media (max-width: 719px) {
  .glossary-term-card { padding: 1rem; }

  /* 顶栏：紧凑布局，触摸友好 */
  .fw-navbar {
    padding: 0 0.75rem;
    height: auto;
    min-height: 3.6rem;
  }
  .fw-navbar .site-name { font-size: 1rem; margin-right: 0.75rem; }
  .fw-navbar .nav-links { gap: 0; }
  .fw-navbar .nav-link,
  .fw-navbar .dropdown-title {
    padding: 0.6rem 0.5rem;
    line-height: 1.4;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .fw-navbar .nav-dropdown a {
    padding: 0.6rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* 主内容区 */
  .fw-main { padding-top: 3.6rem; }
  .fw-home, .fw-page, .task-page {
    padding: 1.25rem 1rem;
  }
  .fw-home h1 { font-size: 1.5rem; }
  .fw-home h2 { font-size: 1.2rem; margin-top: 1.5rem; }

  /* 入口卡片：单列、触摸友好 */
  .home-entry-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
  }
  .home-entry-card {
    padding: 1.25rem 1rem;
    min-height: 72px;
  }
  .home-entry-card__title { font-size: 1.05rem; }
  .home-entry-card__desc { font-size: 0.85rem; }

  /* 任务矩阵卡片 */
  .tasks-grid .module-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
  }
  .tasks-grid .task-card {
    padding: 0.85rem;
    min-height: 72px;
  }
  .tasks-grid .task-card .task-title { font-size: 0.95rem; }

  /* 表格横向滚动 */
  .fw-page table, .task-page table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 419px) {
  .fw-home h1 { font-size: 1.35rem; }
  .home-entry-card { padding: 1rem 0.85rem; }
  .tasks-grid .module-cards { grid-template-columns: 1fr; }
}

@media (min-width: 1200px) {
  .task-page { max-width: 72rem; font-size: 1.05rem; }
  .task-banner h1 { font-size: 2rem; }
}
