/* 小学打印资料站 v3 · 设计系统「印格纸本」
   方向：文具编辑风 —— 米白纸感 + 墨线 + 批改红点缀 + 宋体标题
   原则：纸质肌理、细墨线分隔、克制阴影、字重层级清晰、打印优先 */
:root {
  /* 纸 */
  --paper: #FAF7F0;
  --paper-2: #F3EEE2;
  --card: #FFFFFF;
  /* 墨 */
  --ink: #1B1B1F;
  --ink-2: #55555E;
  --ink-3: #8E8E97;
  /* 线 */
  --line: #E8E1D3;
  --line-2: #D8CDB8;
  /* 主色：靛墨 / 点缀：批改红 */
  --brand: #1E3A5F;
  --brand-2: #2E5A88;
  --accent: #C8452F;
  --gold: #B08A2E;
  /* 兼容旧变量名（部分页面/组件仍引用） */
  --grad: linear-gradient(135deg, #1E3A5F 0%, #2E5A88 100%);
  --grad-soft: linear-gradient(135deg, #2E5A88, #4A76A3);
  --bg: var(--paper);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27,27,31,.05), 0 6px 18px rgba(27,27,31,.05);
  --shadow-lg: 0 2px 4px rgba(27,27,31,.06), 0 14px 34px rgba(27,27,31,.10);
  /* 工具色（低饱和墨色系） */
  --c-kousuan: #C8862A;
  --c-tianzige: #C2405F;
  --c-gushici: #2F7D5F;
  --c-danci: #2E5A88;
  --c-plan: #6C5A9E;
  --c-photo: #2A7B8C;
  --c-moshu: #B03A6E;
  --c-clock: #1F6F63;
  --c-shudu: #B07A24;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  color: var(--ink); line-height: 1.68;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(30,58,95,.05), transparent 45%),
    radial-gradient(circle at 92% 4%, rgba(200,69,47,.05), transparent 40%),
    repeating-linear-gradient(0deg, rgba(30,58,95,.028) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(30,58,95,.022) 0 1px, transparent 1px 26px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .sheet-title, .hero h1 {
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  font-weight: 700; letter-spacing: .02em;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
::selection { background: rgba(200,69,47,.18); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== 顶部导航 ===== */
.nav {
  background: rgba(250,247,240,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
}
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; }
.nav .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18.5px; color: var(--brand); letter-spacing: .02em; }
.nav .brand .bird { font-size: 21px; }
.nav .links { display: flex; gap: 24px; font-size: 13.5px; color: var(--ink-2); }
.nav .links a { padding-bottom: 2px; border-bottom: 1.5px solid transparent; }
.nav .links a:hover { color: var(--brand); border-bottom-color: var(--accent); }

/* ===== Hero（纸本，非渐变）===== */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(250,247,240,0) 62%),
    repeating-linear-gradient(0deg, rgba(30,58,95,.05) 0 1px, transparent 1px 34px);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand) 0 22%, var(--accent) 22% 30%, var(--gold) 30% 34%, transparent 34%);
  opacity: .55;
}
.hero-inner {
  max-width: 1120px; margin: 0 auto; padding: 52px 22px 96px;
  display: grid; grid-template-columns: 1.25fr .95fr; gap: 40px; align-items: center;
}
@media (max-width: 880px) { .hero-inner { grid-template-columns: 1fr; padding-bottom: 84px; } .hero-stack { display: none; } }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px;
}
.hero .eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.hero .logo-big { font-size: 30px; line-height: 1; margin-bottom: 12px; }
.hero h1 { font-size: 46px; line-height: 1.18; color: var(--brand); letter-spacing: .01em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .slogan { font-size: 16px; color: var(--ink-2); margin-top: 16px; max-width: 30em; }
.hero .slogan b { font-weight: 700; color: var(--ink); }
.hero .cta-row { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .cta {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.12);
  transition: transform .16s, box-shadow .16s;
}
.hero .cta.ghost { background: transparent; color: var(--brand); border-color: var(--line-2); }
.hero .cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,58,95,.18); }

/* 叠纸视觉（纯 CSS） */
.hero-stack { position: relative; height: 300px; }
.hero-stack .sheet {
  position: absolute; inset: 0; margin: auto; width: 74%; height: 268px;
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(30,58,95,.10) 25px 26px),
    repeating-linear-gradient(90deg, transparent 0 25px, rgba(30,58,95,.10) 25px 26px),
    #fff;
  border: 1px solid var(--line-2); border-radius: 6px;
  box-shadow: 0 2px 0 #fff, 0 18px 40px rgba(27,27,31,.13);
}
.hero-stack .sheet.s1 { transform: rotate(-7deg) translate(-26px, 10px); opacity: .75; }
.hero-stack .sheet.s2 { transform: rotate(4deg) translate(22px, -6px); opacity: .9; }
.hero-stack .sheet.s3 { transform: rotate(-1.5deg); }
.hero-stack .sheet .stamp {
  position: absolute; right: 14px; bottom: 14px; width: 68px; height: 68px; border-radius: 50%;
  border: 2.5px solid var(--accent); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC","SimSun",serif; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transform: rotate(-12deg); opacity: .85; letter-spacing: .02em;
}
.hero-stack .sheet .cap {
  position: absolute; left: 18px; top: 14px; font-family: "Songti SC","SimSun",serif;
  font-size: 15px; color: var(--ink-3); letter-spacing: .3em;
}

/* ===== 统计条（尺子/印章条）===== */
.stats {
  margin-top: 30px; display: flex; gap: 0; flex-wrap: wrap;
  border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff;
  box-shadow: var(--shadow); max-width: 620px;
}
.stats .st { flex: 1 1 0; min-width: 104px; padding: 12px 10px; text-align: center; border-left: 1px dashed var(--line-2); }
.stats .st:first-child { border-left: none; }
.stats .st b {
  display: block; font-family: "Songti SC","SimSun",serif; font-size: 23px; color: var(--brand); line-height: 1.2;
}
.stats .st span { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }

/* ===== 工具卡（索引卡/档案卡）===== */
.tools { margin-top: -64px; position: relative; z-index: 5; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line-2); }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.tool-card:hover .go { gap: 8px; }
.tool-card:hover .go::after { transform: none; }
.tool-card .bar { display: none; }
.tool-card .body { padding: 20px 20px 18px; flex: 1; display: flex; flex-direction: column; }
.tool-card .ic {
  width: 46px; height: 46px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 23px; margin-bottom: 13px; background: var(--paper-2) !important; border: 1px solid var(--line);
}
.tool-card h3 { font-size: 17.5px; margin-bottom: 6px; color: var(--brand); }
.tool-card p { font-size: 13px; color: var(--ink-2); flex: 1; }
.tool-card .go {
  margin-top: 14px; font-size: 13.5px; font-weight: 700; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px; transition: gap .18s;
}
/* 各工具顶条与图标墨色 */
.t-kousuan::before { background: var(--c-kousuan); }
.t-kousuan .ic { color: var(--c-kousuan); }
.t-tianzige::before { background: var(--c-tianzige); }
.t-tianzige .ic { color: var(--c-tianzige); }
.t-gushici::before { background: var(--c-gushici); }
.t-gushici .ic { color: var(--c-gushici); }
.t-danci::before { background: var(--c-danci); }
.t-danci .ic { color: var(--c-danci); }
.t-plan::before { background: var(--c-plan); }
.t-plan .ic { color: var(--c-plan); }
.t-photo::before { background: var(--c-photo); }
.t-photo .ic { color: var(--c-photo); }
.t-moshu::before { background: var(--c-moshu); }
.t-moshu .ic { color: var(--c-moshu); }
.t-clock::before { background: var(--c-clock); }
.t-clock .ic { color: var(--c-clock); }
.t-shudu::before { background: var(--c-shudu); }
.t-shudu .ic { color: var(--c-shudu); }

/* ===== 分区 ===== */
.sec { margin-top: 56px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: 22px; color: var(--brand); display: flex; align-items: center; gap: 9px; }
.sec-head .sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative;
}
.cat-card::after {
  content: ""; position: absolute; left: 20px; right: 20px; top: 46px; border-top: 2px solid var(--paper-2);
  opacity: 0; /* 预留 */
}
.cat-card h3 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: var(--brand); }
.cat-card h3 .em { font-size: 19px; }
.cat-card ul { list-style: none; }
.cat-card li { font-size: 13.5px; color: var(--ink-2); padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; }
.cat-card li:last-child { border-bottom: none; }
.cat-card li a { color: var(--brand-2); border-bottom: 1px solid transparent; }
.cat-card li a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.cat-card li .soon { color: #C3BCae; font-size: 11.5px; flex: 0 0 auto; }

/* ===== 三步说明 ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(244px, 1fr)); gap: 16px; counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px;
}
.step .n {
  flex: 0 0 32px; height: 32px; border-radius: 6px; background: var(--paper-2);
  border: 1px solid var(--line-2); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC","SimSun",serif; font-weight: 700; font-size: 16px;
}
.step b { display: block; margin-bottom: 3px; color: var(--brand); }
.step p { font-size: 13px; color: var(--ink-2); }

/* ===== 页脚 ===== */
footer { margin-top: 60px; background: #FFFDF9; border-top: 1px solid var(--line-2); padding: 30px 22px; }
.foot-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.foot-inner .changelog { font-size: 12.5px; line-height: 1.95; }
.foot-inner .changelog b { color: var(--brand); }
.copyright { max-width: 1120px; margin: 20px auto 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); text-align: center; letter-spacing: .04em; }

/* ===== 工具页 ===== */
.page-head {
  border-bottom: 1px solid var(--line-2);
  background:
    linear-gradient(180deg, rgba(255,255,255,.8), rgba(250,247,240,0) 78%),
    repeating-linear-gradient(0deg, rgba(30,58,95,.05) 0 1px, transparent 1px 30px);
  padding: 28px 22px 30px; position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand) 0 16%, var(--accent) 16% 22%, var(--gold) 22% 25%, transparent 25%);
  opacity: .5;
}
.page-head .inner { max-width: 1120px; margin: 0 auto; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; letter-spacing: .02em; }
.crumb a:hover { color: var(--accent); }
.page-head h1 { font-size: 29px; color: var(--brand); }
.page-head .desc { font-size: 13.5px; color: var(--ink-2); margin-top: 7px; max-width: 46em; }
.tool-body { max-width: 1120px; margin: -14px auto 0; padding: 0 22px 46px; position: relative; }
.tool-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 880px) { .tool-layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.panel-title {
  font-size: 14.5px; font-weight: 700; margin-bottom: 3px; color: var(--brand);
  padding-bottom: 9px; border-bottom: 2px solid var(--paper-2);
}
.panel-sub { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 16px; }
.grp { margin-bottom: 17px; }
.grp > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; letter-spacing: .02em; }
.seg { display: flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  flex: 1; border: none; background: transparent; padding: 7px 6px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); font-family: inherit; white-space: nowrap;
  transition: background .14s, color .14s;
}
.seg button:hover { color: var(--brand); }
.seg button.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 3px rgba(27,27,31,.10); }
.row2 { display: flex; gap: 10px; }
.minmax { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.minmax input { width: 74px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff; }
.minmax input:focus { outline: 2px solid rgba(46,90,136,.35); border-color: transparent; }
textarea, .txt {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; resize: vertical; background: #fff; line-height: 1.7;
}
textarea:focus, .txt:focus { outline: 2px solid rgba(46,90,136,.35); border-color: transparent; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--ink-2); }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #DED8C9; border-radius: 20px; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.btn {
  width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 11px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-top: 6px; transition: transform .14s, box-shadow .14s, background .14s;
}
.btn-main { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.16); }
.btn-main:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(30,58,95,.22); }
.btn-print { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.16); }
.btn-print:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(200,69,47,.24); }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); }
.panel .saved { font-size: 12px; color: var(--ink-3); margin-top: 10px; text-align: center; line-height: 1.6; }

/* 预览区（纸张） */
.preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 32px; min-height: 480px;
}
.preview .sheet-title { text-align: center; font-size: 23px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.preview .sheet-meta { text-align: center; color: var(--ink-2); font-size: 12.5px; margin-bottom: 18px; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table td { border: 1px solid var(--line); text-align: center; font-size: 20px; padding: 15px 6px; font-family: "KaiTi","SimSun",serif; }

/* 田字格 */
.tian-grid { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.tian { width: 2.4cm; height: 2.4cm; border: 1.5px solid #B9B2A2; position: relative; background: #fff; }
.tian::before, .tian::after { content: ""; position: absolute; background: rgba(30,58,95,.22); height: 1px; left: 0; right: 0; top: 50%; }
.tian::after { transform: rotate(90deg); }
.tian .py { position: absolute; top: 2px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--brand-2); }
.tian .ch { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "KaiTi","SimSun",serif; font-size: 1.75cm; line-height: 1; }
.tian .ch.trace { color: rgba(0,0,0,.13); }
.tian .ch.hollow { color: transparent; -webkit-text-stroke: 1.2px #A9A294; }

/* 古诗卡 */
.poem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.poem-card { border: 1px solid var(--line); border-left: 3px solid var(--c-gushici); border-radius: 6px; padding: 15px 17px; break-inside: avoid; background: #fff; }
.poem-card .pt { font-weight: 700; font-size: 16.5px; color: var(--c-gushici); font-family: "Songti SC","SimSun",serif; }
.poem-card .pa { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.poem-card .pb { font-family: "KaiTi","SimSun",serif; font-size: 16px; line-height: 1.9; }
.poem-card .chk { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

/* 单词卡 */
.word-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.word-card { border: 1px solid var(--line); border-radius: 6px; padding: 14px; text-align: center; break-inside: avoid; background: #fff; }
.word-card .en { font-size: 19px; font-weight: 800; color: var(--c-danci); }
.word-card .ph { font-size: 12px; color: var(--ink-3); }
.word-card .cn { font-size: 14.5px; margin-top: 4px; }

/* 计划表 */
.plan-table { width: 100%; border-collapse: collapse; }
.plan-table th, .plan-table td { border: 1px solid var(--line); padding: 9px; text-align: center; font-size: 14px; }
.plan-table th { background: var(--paper-2); color: var(--brand); font-weight: 700; }
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-cell { border: 1px solid var(--line-2); border-radius: 6px; height: 2.5cm; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #CFC7B6; }
.tip { margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.notice {
  font-size: 12.5px; color: #8A5A17; background: #FDF6E7; border: 1px solid #EBD9AE;
  border-left: 3px solid var(--gold); border-radius: 6px; padding: 10px 12px; margin-top: 14px;
}

/* ===== 打印（纸面纯黑白）===== */
@media print {
  .nav, .panel, .page-head .crumb, .btn, footer, .notice, .hero, .stats, .crumb, .hero-stack { display: none !important; }
  body {
    background: #fff !important; background-image: none !important;
  }
  .page-head { display: none !important; }
  .tool-body { margin: 0; padding: 0; max-width: 100%; }
  .tool-layout { grid-template-columns: 1fr; }
  .preview { box-shadow: none; border: none; padding: 0; border-radius: 0; min-height: 0; }
  .preview .sheet-title { font-size: 24px; color: #000; }
  .sheet-table td { border-color: #000; font-size: 22px; padding: 17px 6px; }
  .tian { border-color: #000; }
  .tian::before, .tian::after { background: rgba(0,0,0,.28); }
  .tian .py { color: #000; }
  .poem-card, .word-card, .plan-table th, .plan-table td, .day-cell { border-color: #000; }
  .poem-card { border-left-color: #000; }
  .poem-card .pt { color: #000; }
  .word-card .en { color: #000; }
  .plan-table th { background: #fff; color: #000; }
}
