/* 标匠 · AI LOGO 的样式：一个文件、没有构建链、没有外链字体。
   配色与同族站点一致（冷灰底 + 近黑主色）。 */

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --ink: #141414;
  --ink-soft: #6e6e6e;
  --line: #e6e6e4;
  --accent: #171717;
  --danger: #c0392b;
  --ok: #1f7a4d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: var(--ink); }
a:hover { color: #000; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand small { color: var(--ink-soft); font-weight: 400; font-size: 12px; }

.topbar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.topbar .who { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 顶栏账号区（照门户那套）：未登录是两个按钮；登录后是「头像 + 昵称 + 箭头」，点开是下拉。 */
.topbar .account { position: relative; }
.topbar .account-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; max-width: 12rem;
  padding: 0 8px 0 4px; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.topbar .account-btn:hover { border-color: var(--ink-soft); }
.topbar .avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.topbar .avatar.lg { width: 32px; height: 32px; }
.topbar .caret { width: 12px; height: 12px; flex: none; color: var(--ink-soft); }
.topbar .menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; width: 13rem;
  padding: 4px 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); overflow: hidden;
}
.topbar .menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 10px; border-bottom: 1px solid var(--line);
}
.topbar .menu-text { min-width: 0; }
.topbar .menu-text strong {
  display: block; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .menu-text small {
  display: block; font-size: 12px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .menu a, .topbar .menu-out {
  display: block; width: 100%; padding: 8px 12px; font-size: 13px; text-align: left;
  color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.topbar .menu a:hover, .topbar .menu-out:hover { background: var(--bg); }
.topbar .menu-out { border-top: 1px solid var(--line); }

main { padding: 24px 0 48px; }

.hero h1 { font-size: 26px; margin: 8px 0 6px; }
.hero p { margin: 0; color: var(--ink-soft); }
.crumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }

/* 左列为表单（固定偏窄）、右列留给候选：候选卡片是 auto-fill，越宽排得越多。 */
.grid { display: grid; gap: 16px; grid-template-columns: minmax(20rem, 24rem) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* 两列各自是 flex 列，卡间距只由 gap 决定。**不要改回 `.card + .card { margin-top }`**：
   隐藏的兄弟也算「相邻」，收起状态下的候选卡会把可见的占位卡压下去 16px，两列顶边就错开了。 */
section, aside { display: flex; flex-direction: column; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
input[type="text"], select, textarea {
  width: 100%; padding: 9px 10px; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
input[type="text"]:focus, select:focus, textarea:focus { outline: 2px solid #d8d8d6; }
textarea { min-height: 62px; resize: vertical; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* 「更多要求」折叠区：默认收起，标题上带一个三角；改过默认值后由 JS 在标题里写上改了几项。 */
.more { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 10px; }
.more > summary {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; list-style: none;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "▸"; font-size: 11px; }
.more[open] > summary::before { content: "▾"; }
.more > summary:hover { color: var(--ink); }
.more-body { margin-top: 10px; }
.more-body > .field:last-child, .more-body > label.field:last-child { margin-bottom: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 11px; font-size: 13px; cursor: pointer; color: inherit;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.tiers { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.tier {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer;
  background: var(--surface); text-align: left; color: inherit;
}
.tier[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier b { display: block; font-size: 14px; }
.tier span { display: block; font-size: 12px; color: var(--ink-soft); }
.tier em { display: block; font-style: normal; font-size: 12px; margin-top: 4px; }

/* 「一次生成几个」：分段控件。与风格 chips 同一套观感，但**一行不换行**——
   三个数字挤成两行会让人以为还有别的选项。窄屏只收内边距。 */
.seg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg-label { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.seg .chips { flex-wrap: nowrap; }
.seg .chip { padding: 5px 14px; }
@media (max-width: 420px) {
  .seg .chip { padding: 5px 10px; }
}

button.primary, button.ghost, a.primary, a.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 10px 16px; font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: none; border: 1px solid var(--line);
}
button.primary, a.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost, a.ghost { background: var(--surface); color: var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.wide { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.notice { font-size: 13px; color: var(--ink-soft); }
.notice strong { color: var(--ink); }
.alert { color: var(--danger); font-size: 13px; }
.ok { color: var(--ok); font-size: 13px; }

.results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.candidate { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); }
.candidate .thumb {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#f1f1ef 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  border-radius: 8px; overflow: hidden;
}
.candidate .thumb img { width: 78%; height: 78%; object-fit: contain; }
.candidate h3 { font-size: 13px; margin: 8px 0 6px; font-weight: 600; }
.candidate .row button, .candidate .row a { padding: 6px 10px; font-size: 12px; }
.refine { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.refine .chips { margin-top: 6px; }
.refine-note { margin-top: 6px; font-size: 13px; padding: 6px 9px; }
.candidate.is-refined::after {
  content: "改过的一版"; display: inline-block; font-size: 11px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}

/* 间距工具类：CSP 是 style-src 'self'，行内 style 属性会被浏览器拒掉，所以只能用类。 */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-6 { margin-top: 6px; }

.usage { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
.usage b { color: var(--ink); }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; }
footer.site .foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
footer.site .foot-mark { width: 28px; height: 28px; border-radius: 8px; }
footer.site .foot-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
footer.site .foot-brand-text strong { font-size: 15px; }
footer.site .foot-brand-text small { font-size: 12px; color: var(--ink-soft); }
footer.site .cols { display: flex; flex-wrap: wrap; gap: 24px; }
footer.site h4 { font-size: 13px; margin: 0 0 6px; }
footer.site ul { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink-soft); }
footer.site li { margin-bottom: 4px; }
footer.site .fine { margin-top: 14px; font-size: 12px; color: var(--ink-soft); }

details.faq { border-top: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 500; }
ul.plain { margin: 6px 0 0; padding-left: 20px; color: var(--ink-soft); }
ul.plain li { margin-bottom: 6px; }
.muted { color: var(--ink-soft); }
