:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --fg: #1d1d1f;
  --muted: #86868b;
  --subtle: #6e6e73;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --radius-sm: 14px;
  --pink: #ff2974;
  --pink-soft: rgba(255, 41, 116, 0.12);
  --pink-line: rgba(255, 41, 116, 0.28);
  --warn-bg: #fff8eb;
  --warn-line: rgba(180, 120, 20, 0.22);
  --warn-fg: #8a5a00;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}
body { min-height: 100vh; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 88px;
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 24px); padding: 28px 0 64px; }
}

/* —— hero —— */
.hero { margin-bottom: 22px; }
.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.brand-mark {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #111114;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.08);
}
.brand h1 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.brand h1 .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--pink);
  vertical-align: middle;
  transform: translateY(-2px);
}
.brand .sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.topnav {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.055);
  border-radius: 980px;
  padding: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.navtab {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  border-radius: 980px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
}
.navtab:hover { color: var(--fg); }
.navtab.active {
  background: #fff;
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.08);
}

.lede {
  margin: 18px 0 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.55;
  letter-spacing: -0.015em;
  color: var(--subtle);
}
.lede strong { color: var(--fg); font-weight: 650; }

/* —— safety banner —— */
.safety {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 0 22px;
  padding: 14px 16px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  color: var(--warn-fg);
  font-size: 0.86rem;
  line-height: 1.5;
}
.safety-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 980px;
  background: rgba(180, 120, 20, 0.12);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* —— stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.stat.accent {
  border-color: var(--pink-line);
  background: linear-gradient(180deg, #fff 0%, #fff5f9 100%);
  box-shadow: 0 2px 8px rgba(255, 41, 116, 0.08), 0 10px 24px rgba(255, 41, 116, 0.06);
}
.stat .label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.stat .value {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

/* —— toolbar —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--subtle);
  border-radius: 980px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.chip:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}
.chip.active {
  background: var(--fg);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}
.chip .n {
  margin-left: 6px;
  opacity: 0.65;
  font-weight: 500;
  font-size: 0.78rem;
}
.chip.active .n { opacity: 0.75; }

.search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 980px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--fg);
  box-shadow: var(--shadow);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.search::placeholder { color: var(--muted); }
.search:focus {
  border-color: var(--pink-line);
  box-shadow: 0 0 0 3px rgba(255, 41, 116, 0.18);
}

/* —— section —— */
.section {
  margin-bottom: 28px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head .meta {
  font-size: 0.78rem;
  color: var(--muted);
}

/* —— cards grid —— */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.tag {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 980px;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.card-blurb {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--subtle);
  flex: 1;
}
.card-tip {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.card-tip::before {
  content: "提示 · ";
  font-weight: 650;
  color: var(--subtle);
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  border-radius: 980px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 650;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); }
.btn.primary {
  background: var(--fg);
  color: #fff;
  border-color: transparent;
}
.btn.primary:hover {
  background: #000;
}
.btn.primary::after {
  content: "→";
  opacity: 0.7;
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding-left: 4px;
  font-weight: 500;
  font-size: 0.78rem;
}

.empty {
  grid-column: 1 / -1;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

/* —— how-to —— */
.howto {
  margin: 8px 0 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
}
.howto h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  padding: 4px 2px;
}
.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--pink);
  font-size: 0.78rem;
  font-weight: 750;
  margin-bottom: 8px;
}
.step h3 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.step p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--subtle);
}

/* —— footer —— */
.footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}
.footer a {
  color: var(--pink);
  font-weight: 560;
}
.footer .fine {
  margin-top: 8px;
  font-size: 0.7rem;
  opacity: 0.85;
}


/* —— prompts (aligned with tools cards) —— */
.prompts-section {
  margin-top: 4px;
}
.section-hint {
  margin: -4px 0 14px;
  padding: 0 2px;
  font-size: 0.88rem;
  color: var(--subtle);
  line-height: 1.5;
}
.prompts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prompt-card .prompt-body-wrap {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.prompt-body-wrap[hidden] { display: none !important; }
.prompt-pre {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: #f7f7f8;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (min-width: 721px) {
  .prompt-card:has(.prompt-body-wrap:not([hidden])) {
    grid-column: 1 / -1;
  }
}

.card-audience {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  font-weight: 650;
  color: #111;
  padding: 8px 10px;
  background: #f0f0f3;
  border-radius: 10px;
}

.card-media {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  border: 1px solid var(--line, #e5e5ea);
  margin: 0.35rem 0 0.15rem;
  background: #fafafa;
}
