:root {
  --cream: #f7f3e9;
  --ink: #17201c;
  --muted: #5d675f;
  --line: #d8d6ca;
  --green: #195f46;
  --mint: #d6eadc;
  --orange: #ec6b3d;
  --yellow: #f1d663;
  --white: #fffdf8;
  --serif: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --max: 1180px;
  --gutter: 16px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  background: var(--cream);
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
.skip {
  position: fixed;
  top: -60px;
  left: var(--gutter);
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}
main {
  width: min(var(--max), calc(100% - var(--gutter) * 2));
  margin: 0 auto;
}

/* 顶部说明 */
.hero {
  padding: 28px 0 20px;
}
.eyebrow {
  font-size: 14px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 7vw, 46px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero-lead {
  font-size: 17px;
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 44em;
}

/* 查找 */
.toolbar {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px 28px;
}
.search {
  flex: 1 1 260px;
}
.search label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.search > div {
  position: relative;
}
.search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  padding: 12px 48px 12px 14px;
  outline: none;
}
.search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(25, 95, 70, 0.12);
}
.search > div > span {
  position: absolute;
  right: 16px;
  top: 9px;
  font-size: 24px;
  color: var(--green);
}
.count {
  margin: 0 0 4px auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
}
.count b {
  font: 30px/1 Georgia, serif;
  color: var(--orange);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 4px;
}
.filter {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  min-height: 44px;
  padding: 8px 18px;
  font-size: 16px;
  cursor: pointer;
}
.filter span {
  color: #99a29b;
  font-size: 14px;
}
.filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.filter.active span {
  color: #b9c4bd;
}

/* 指令卡 */
.catalog {
  padding: 16px 0 72px;
  display: grid;
  gap: 16px;
}
.card {
  align-self: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px var(--gutter) 16px;
}
.group-tag {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}
.what {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 8px;
}
.card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 14px;
}
.meta {
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
  font-size: 15px;
}
.meta div {
  display: flex;
  gap: 10px;
}
.meta dt {
  flex: 0 0 auto;
  color: #8a938e;
}
.meta dd {
  margin: 0;
  color: var(--muted);
}
.prompt {
  background: #111318;
  color: #eef0f5;
  border-radius: 14px;
  padding: 16px;
}
.prompt-label {
  margin: 0 0 10px;
  font-size: 14px;
  color: #a9b6ad;
}
.prompt pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 14px;
  font: 16px/1.85 var(--sans);
}
.copy {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0b0d12;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.copy.done {
  background: var(--mint);
}
.download {
  margin: 12px 0 0;
}
.download a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-size: 15px;
  text-decoration: none;
}
.disclose {
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.disclose summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.disclose summary::-webkit-details-marker {
  display: none;
}
.disclose summary::before {
  content: "＋ ";
}
.disclose[open] summary::before {
  content: "− ";
}
.disclose-body {
  padding-bottom: 12px;
}
.loading {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.sample {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  background: #f1ece0;
  border-radius: 8px;
  padding: 14px;
  font: 16px/1.8 var(--sans);
}
.output {
  font-size: 16px;
}
.output > :first-child {
  margin-top: 0;
}
.output p {
  margin: 0 0 12px;
}
.output h3,
.output h4,
.output h5 {
  font-size: 17px;
  margin: 16px 0 8px;
}
.output ul,
.output ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.output li {
  margin-bottom: 4px;
}
.output code {
  background: #f1ece0;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 15px;
}
.output hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
.table-scroll {
  overflow-x: auto;
  margin: 0 0 12px;
}
.output table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 15px;
}
.output th,
.output td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.output th {
  background: #f1ece0;
}
.empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}


@media (min-width: 900px) {
  :root {
    --gutter: 24px;
  }
  .hero {
    padding: 40px 0 24px;
  }
  .catalog {
    grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  }
  .card {
    padding: 24px;
  }
}

/* ---------- 品牌层：颜色与字体接到 /resources/brand/brand.css ---------- */
:root{--cream:var(--xy-paper);--ink:var(--xy-ink);--muted:var(--xy-ink-2);--line:var(--xy-rule);--green:var(--xy-red-ink);--mint:var(--xy-paper-2);--orange:var(--xy-red);--white:var(--xy-sheet);--serif:var(--xy-serif);--sans:var(--xy-sans)}
html,body{background:var(--xy-paper)}
.hero h1{font-weight:700}
:focus-visible{outline-color:var(--xy-ink)}
.library-tail{background:var(--xy-ink);color:var(--xy-sheet);padding:36px max(var(--gutter),calc((100% - var(--max))/2));display:flex;flex-wrap:wrap;justify-content:space-between;align-items:end;gap:20px 40px}
.library-tail b{font-family:var(--xy-serif);font-size:22px}
.library-tail p{color:#cfc6b6;font-size:16px;margin:8px 0 0;max-width:42em}
.library-tail>a{display:inline-flex;align-items:center;min-height:44px;font-size:16px;color:var(--xy-sheet);text-decoration:underline;text-underline-offset:4px}
.library-tail+.xy-foot{margin-top:0}
:root{--yellow:#efdca8}

.technique-filters { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.technique-filters > span { display: block; color: var(--muted); font-size: 14px; font-weight: 700; }
.technique-filters .filters { padding-top: 8px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.group-tag { margin: 0; }
.technique-tag { border: 1px solid var(--line); background: var(--mint); color: var(--green); border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.prompt .slot { padding: 2px 5px; border-radius: 5px; color: var(--ink); background: var(--yellow); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.why { margin-top: 16px; }
.why h3 { margin: 0 0 4px; color: var(--green); font-size: 16px; }
.why p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-link { display: inline-block; margin-top: 8px; color: var(--green); font-weight: 700; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; padding-bottom: 12px; }
.image-grid a { display: block; min-width: 0; }
.image-grid img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.followup { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.followup:last-child { border-bottom: 0; }
.followup p { min-width: 0; flex: 1; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.followup-copy { width: auto; flex: 0 0 auto; min-width: 64px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--green); color: var(--green); background: var(--white); }
@media (max-width: 480px) { .followup { align-items: stretch; flex-direction: column; } .followup-copy { align-self: flex-start; } }

/* 从课程链接跳过来的那一条 */
.card.linked {
  outline: 2px solid var(--accent, #2e63e6);
  outline-offset: 4px;
}
