/* 提示词工坊 v2 — 暖纸质感：米纸底 / 奶油白面板 / 暖棕灰文字 / 砖红强调 */
:root {
  --bg: #f3ead8;
  --panel: #fef9ec;
  --panel-2: #f8efdb;
  --ink: #43382a;
  --ink-2: #7a6c58;
  --line: #e0d0b2;
  --accent: #b3402f;
  --accent-ink: #ffffff;
  --accent-soft: #f3ddd6;
  --ok: #4d7c4d;
  --err-bg: #f9e3dd;
  --err-ink: #93321f;
  --shadow: 0 2px 10px rgba(101, 78, 44, 0.10);
  --radius: 14px;
}
body.dark {
  --bg: #251c13;
  --panel: #33281b;
  --panel-2: #3a2d1e;
  --ink: #efe3cb;
  --ink-2: #bfae8f;
  --line: #57452c;
  --accent: #d96a55;
  --accent-ink: #fff7ea;
  --accent-soft: #4c3423;
  --err-bg: #4c2a20;
  --err-ink: #f0b9a8;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}
.container { max-width: 1180px; margin: 0 auto; padding: 28px 18px 40px; }
header { position: relative; text-align: center; margin-bottom: 26px; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: 1px; }
.subtitle { color: var(--ink-2); margin-top: 6px; font-size: 0.95rem; }
.theme-toggle {
  position: absolute; right: 0; top: 0;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-size: 0.85rem;
}
.main-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 22px; align-items: start; }
.bottom-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
@media (max-width: 900px) {
  .main-layout, .bottom-layout { grid-template-columns: 1fr; }
  .theme-toggle { position: static; margin-top: 10px; }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head .panel-title { margin-bottom: 0; }
.sub-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.label { display: block; font-size: 0.88rem; color: var(--ink-2); margin: 14px 0 8px; }
.label:first-of-type { margin-top: 0; }
.idea-input, .prompt-output {
  width: 100%;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.97rem;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.idea-input:focus, .prompt-output:focus { border-color: var(--accent); }
.prompt-output.small { font-size: 0.9rem; }
.char-count { text-align: right; font-size: 0.78rem; color: var(--ink-2); margin-top: 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn:hover { filter: brightness(1.07); }
.primary-btn:disabled { opacity: 0.55; cursor: wait; }
.primary-btn.image-btn { margin-top: 4px; }
.hint { min-height: 1.2em; font-size: 0.85rem; color: var(--ink-2); margin-top: 10px; }
.hint.error { color: var(--err-ink); }
.templates { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 6px; }
.candidate-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.candidate-tabs .chip.active { background: var(--accent); }
.note-zh { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 6px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.action-btn {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.9rem;
  cursor: pointer;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.text-btn { background: none; border: none; color: var(--ink-2); cursor: pointer; font-size: 0.85rem; }
.text-btn:hover { color: var(--accent); }
.fields-details { margin-top: 16px; }
.fields-details summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-2); }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.fields-grid label { font-size: 0.82rem; color: var(--ink-2); display: block; }
.fields-grid input, .fields-grid textarea {
  width: 100%; margin-top: 4px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 0.88rem; font-family: inherit; outline: none;
}
.fields-grid .wide { grid-column: 1 / -1; }
.divider { border: none; border-top: 1px solid var(--line); margin: 22px 0 16px; }
.image-error {
  display: none; margin-top: 10px;
  background: var(--err-bg); color: var(--err-ink);
  border-radius: 8px; padding: 10px 14px; font-size: 0.9rem;
}
.image-error.show { display: block; }
.image-preview { margin-top: 14px; }
.image-preview img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.image-preview figcaption { font-size: 0.8rem; color: var(--ink-2); margin-top: 6px; }
.item-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.item {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.item:hover { border-color: var(--accent); }
.item-text { font-size: 0.88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { font-size: 0.76rem; color: var(--ink-2); margin-top: 4px; }
.empty { color: var(--ink-2); font-size: 0.88rem; padding: 8px 0; }
footer { text-align: center; color: var(--ink-2); font-size: 0.8rem; margin-top: 28px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg);
  padding: 10px 20px; border-radius: 999px; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: all 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
