/* 笋苗作文 · 滿分模板頁（沿用 styles.css 的睡蓮色票；正體字形優先） */

html:has(body.tpl-page), body.tpl-page { height: auto; }
body.tpl-page {
  font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "PingFang TC", Georgia, serif;
  --tpl-display: "Kaiti TC", "BiauKai", "STKaiti", "Noto Serif TC", "Songti TC", serif;
  --tpl-sticky: 64px;
}
.tpl-page [lang="zh-Hans"] { font-family: "Noto Serif SC", "Songti SC", "PingFang SC", serif; }

.tpl-brand { text-decoration: none; color: inherit; }

.tpl { max-width: 960px; }

.tpl-hero {
  padding: 30px 32px 24px;
  border-radius: var(--radius-lg);
  background: var(--canvas);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tpl-hero h1 {
  margin: 0 0 12px;
  font-family: var(--tpl-display);
  font-size: 34px;
  font-weight: 600;
  color: var(--pond-deep);
  letter-spacing: 0.04em;
}
body.dark .tpl-hero h1 { color: var(--lily-white); }
.tpl-hero-lead { margin: 0 0 10px; font-size: 17px; line-height: 1.85; }
.tpl-hero-src { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.tpl-hero-src a, .tpl-panel a { color: var(--lily-pink-deep); }
body.dark .tpl-hero-src a, body.dark .tpl-panel a { color: var(--lily-pink); }

/* 分頁：手機可橫向捲動 */
.tpl-tabs {
  position: sticky;
  top: var(--tpl-sticky);
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-radius: var(--radius-md);
  background: var(--canvas-strong);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-1);
}
.tpl-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--tpl-display);
  font-size: 16px;
  line-height: 1.3;
  white-space: nowrap;
}
.tpl-tab-group { font-size: 11px; color: var(--ink-soft); font-family: inherit; letter-spacing: 0.08em; }
.tpl-tab:hover { color: var(--lily-pink-deep); }
.tpl-tab.active {
  color: var(--lily-white);
  background: linear-gradient(140deg, var(--pond-mid), var(--pond-deep));
}
.tpl-tab.active .tpl-tab-group { color: var(--pond-haze); }

.tpl-panel > * { scroll-margin-top: calc(var(--tpl-sticky) + 84px); }
.tpl-panel { scroll-margin-top: calc(var(--tpl-sticky) + 84px); }

.tpl-genre-head, .tpl-module, .tpl-spine-wrap, .tpl-final {
  margin: 0 0 16px;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--canvas);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tpl-genre-head h2 {
  margin: 0 0 6px;
  font-family: var(--tpl-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--pond-deep);
}
body.dark .tpl-genre-head h2 { color: var(--lily-white); }
.tpl-exam { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tpl-chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  font-size: 13px;
  color: var(--ink-soft);
}
.tpl-chip b { color: var(--pond-mid); }
body.dark .tpl-chip b { color: var(--pond-light); }
.tpl-lead { margin: 0 0 12px; font-size: 16px; line-height: 1.9; }
.tpl-warn {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--lily-pink-deep);
  border-radius: 6px;
  background: rgba(217, 158, 180, 0.14);
  font-size: 14px;
  line-height: 1.8;
}

.tpl-section-title {
  margin: 0 0 14px;
  font-family: var(--tpl-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--pond-mid);
}
body.dark .tpl-section-title { color: var(--pond-light); }

/* 全篇骨架 */
.tpl-spine { list-style: none; margin: 0; padding: 0; counter-reset: spine; }
.tpl-spine li { counter-increment: spine; }
.tpl-spine a {
  display: grid;
  grid-template-columns: 2.2em 9em 7.5em 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px dashed var(--edge);
  color: var(--ink);
  text-decoration: none;
}
.tpl-spine li:last-child a { border-bottom: 0; }
.tpl-spine a::before {
  content: counter(spine);
  font-family: var(--tpl-display);
  color: var(--lily-pink-deep);
  font-size: 18px;
}
.tpl-spine a:hover .tpl-spine-label { color: var(--lily-pink-deep); }
.tpl-spine-label { font-family: var(--tpl-display); font-size: 17px; }
.tpl-spine-words { font-size: 13px; color: var(--ink-soft); }
.tpl-spine-job { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

/* 模塊 */
.tpl-module-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tpl-module-n {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pond-mid);
  color: var(--lily-white);
  font-size: 14px;
  flex: 0 0 auto;
}
.tpl-module-head h3 { margin: 0; font-family: var(--tpl-display); font-size: 23px; font-weight: 600; }
.tpl-words { font-size: 13px; color: var(--ink-soft); }
.tpl-job { margin: 0 0 16px; line-height: 1.85; }
.tpl-job b { color: var(--pond-mid); font-weight: 600; }
body.dark .tpl-job b { color: var(--pond-light); }

.tpl-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tpl-move {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--edge-soft);
  background: var(--canvas-soft);
}
.tpl-move h4 { margin: 0 0 8px; font-family: var(--tpl-display); font-size: 18px; font-weight: 600; color: var(--pond-deep); }
body.dark .tpl-move h4 { color: var(--lily-white); }
.tpl-frame {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(138, 168, 150, 0.16);
  line-height: 1.9;
  font-size: 15px;
}
.slot {
  padding: 1px 4px;
  border-radius: 4px;
  border-bottom: 1.5px solid var(--willow-gold);
  background: rgba(201, 167, 107, 0.18);
  color: var(--ink);
}
.tpl-note { margin: 0 0 10px; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }
.tpl-eg { margin: 0; padding: 10px 12px; border-left: 3px solid var(--sky-mauve); border-radius: 4px; background: rgba(181, 162, 189, 0.12); }
.tpl-eg blockquote { margin: 0 0 6px; font-size: 15px; line-height: 1.85; }
.tpl-eg figcaption { font-size: 12.5px; }
.tpl-eg.demo { border-left-color: var(--willow-gold); background: rgba(201, 167, 107, 0.1); }
.tpl-demo-label { display: inline-block; margin-bottom: 4px; font-size: 12px; color: var(--ink-soft); letter-spacing: 0.1em; }
.tpl-why { margin: 6px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-soft); }

.tpl-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 12px; }
.tpl-bad, .tpl-good { padding: 14px 16px; border-radius: var(--radius-md); }
.tpl-bad { background: rgba(184, 101, 127, 0.1); border: 1px solid rgba(184, 101, 127, 0.28); }
.tpl-good { background: rgba(74, 104, 89, 0.1); border: 1px solid rgba(74, 104, 89, 0.28); }
.tpl-compare-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tpl-bad .tpl-compare-label { color: var(--lily-pink-deep); }
.tpl-good .tpl-compare-label { color: var(--pond-mid); }
body.dark .tpl-bad .tpl-compare-label { color: var(--lily-pink); }
body.dark .tpl-good .tpl-compare-label { color: var(--pond-light); }
.tpl-bad p, .tpl-good p { margin: 0; line-height: 1.85; font-size: 15px; }
.tpl-bad-text { text-decoration: line-through; text-decoration-color: rgba(184, 101, 127, 0.55); text-decoration-thickness: 1px; }
.tpl-move .tpl-bad-text { margin: 0 0 4px; padding: 8px 10px; border-radius: 8px; background: rgba(184, 101, 127, 0.1); line-height: 1.8; }
.tpl-src { margin: 6px 0 0 !important; font-size: 12.5px !important; color: var(--ink-soft); }
.tpl-fix { margin: 0; font-size: 14px; }

.tpl-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tpl-check label { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; line-height: 1.7; cursor: pointer; }
.tpl-check input { margin-top: 0.45em; accent-color: var(--pond-mid); flex: 0 0 auto; }
.tpl-check label:has(input:checked) { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--edge); }

.tpl-cta { margin: 18px 0 0; }
.tpl-cta-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(140deg, var(--lily-pink-deep), var(--pond-mid));
  color: #fff !important;
  font: inherit;
  font-family: var(--tpl-display);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

/* 體檢表 */
.tpl-table { display: grid; gap: 2px; margin-bottom: 14px; }
.tpl-row { display: grid; grid-template-columns: 1fr 26% 26%; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--edge); }
.tpl-row-head { font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--edge); }
.tpl-row-name { font-size: 14.5px; line-height: 1.6; }
.tpl-row-name small { display: block; font-size: 12.5px; color: var(--ink-soft); }
.tpl-row-v { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tpl-row-v b { font-weight: 600; min-width: 2.6em; }
.tpl-bar { display: inline-block; height: 10px; border-radius: 5px; flex: 0 1 auto; max-width: 70%; }
.tpl-bar.human { background: var(--pond-light); }
.tpl-bar.ai { background: var(--lily-pink-deep); }

#tpl-input {
  width: 100%;
  min-height: 180px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--edge);
  background: var(--canvas-strong);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.85;
  resize: vertical;
}
.tpl-summary ul { margin: 12px 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.7; }
.tpl-marked {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--canvas-strong);
  border: 1px solid var(--edge);
  line-height: 2;
  font-size: 15px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tpl-marked mark { background: rgba(217, 158, 180, 0.45); color: inherit; border-radius: 3px; padding: 0 2px; }
body.dark .tpl-marked mark { background: rgba(184, 101, 127, 0.55); }

@media (max-width: 720px) {
  body.tpl-page { --tpl-sticky: 56px; }
  .tpl-hero { padding: 22px 18px 18px; }
  .tpl-hero h1 { font-size: 27px; }
  .tpl-hero-lead { font-size: 16px; }
  .tpl-tabs { margin: 14px -4px 12px; padding: 6px; gap: 4px; }
  .tpl-tab { padding: 5px 10px; font-size: 15px; }
  .tpl-genre-head, .tpl-module, .tpl-spine-wrap, .tpl-final { padding: 18px 16px; border-radius: 18px; }
  .tpl-genre-head h2 { font-size: 24px; }
  .tpl-spine a { grid-template-columns: 1.8em 1fr; row-gap: 2px; }
  .tpl-spine-words, .tpl-spine-job { grid-column: 2; }
  .tpl-moves { grid-template-columns: 1fr; }
  .tpl-move { padding: 14px; }
  .tpl-compare { grid-template-columns: 1fr; }
  .tpl-row { grid-template-columns: 1fr; gap: 4px; }
  .tpl-row-head { display: none; }
  .tpl-row-v::before { font-size: 12px; color: var(--ink-soft); min-width: 2.4em; }
  .tpl-row-v:nth-child(2)::before { content: "佳作"; }
  .tpl-row-v:nth-child(3)::before { content: "AI"; }
}
