/* 聰明投 API 3.0 — Prompt 產生器。品牌 token 與主站一致：暖白底、品牌紅只給主要動作與選中狀態。 */
:root {
  --brand: #A31621; --brand-deep: #7C1019; --brand-tint: #F7ECEA;
  --ink: #201B1A; --muted: #77706C; --line: #E8E2DE; --paper: #FAF9F7; --surface: #FFFFFF;
  --up: #C4372F; --down: #1E7F4F;
  --warn: #A8720F; --warn-bg: #F9F1E0; --ok: #2E7D57; --ok-bg: #E9F3EE;
  --radius: 14px; --shadow: 0 1px 2px rgba(32,27,26,.05), 0 6px 24px rgba(32,27,26,.06);
  --ease: cubic-bezier(.2,.7,.3,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; padding-bottom: 76px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; background: rgba(250,249,247,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; min-width: 0; }
.brand b { color: var(--brand); }
.mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); display: inline-block; flex: none; }
.here { color: var(--muted); font-size: 14px; }
.pill { margin-left: auto; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.off { background: #F0EDEB; color: var(--muted); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.intro { padding: 28px 0 20px; }
.intro h1 { font-size: 26px; line-height: 1.35; letter-spacing: .01em; }
.lead { color: var(--muted); margin-top: 6px; max-width: 46em; }
.facts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.facts b { display: block; color: var(--ink); font-size: 14.5px; }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.left { display: grid; gap: 16px; min-width: 0; }
.right { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card h3 { font-size: 14px; color: var(--muted); font-weight: 700; margin: 20px 0 8px; }
.n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.help { font-size: 13px; color: var(--muted); margin-top: 4px; }

.goals { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.goal { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease); }
.goal b { font-size: 15.5px; }
.goal span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.goal:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(32,27,26,.07), 0 14px 36px rgba(32,27,26,.11); }
.goal.on { border-color: var(--brand); background: var(--brand-tint); }
.goal.on b { color: var(--brand-deep); }

.mgroup + .mgroup { margin-top: 16px; }
.mgroup h4 { font-size: 13px; color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; }
.mlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mod { text-align: left; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; transition: border-color .16s var(--ease), background .16s var(--ease); }
.mod .tick { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; border: 1.5px solid #CFC7C2; background: #fff; position: relative; }
.mod.on { border-color: var(--brand); background: var(--brand-tint); }
.mod.on .tick { background: var(--brand); border-color: var(--brand); }
.mod.on .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mtext { display: flex; flex-direction: column; min-width: 0; }
.mtext b { font-size: 14.5px; }
.mtext span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.mtext em { font-style: normal; font-size: 12px; color: var(--muted); margin-top: 3px; opacity: .85; }

.field { margin-top: 14px; min-width: 0; }
.field:first-child { margin-top: 0; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.row2 { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
select, input[type="text"] { width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
select:focus, input:focus, button:focus-visible, pre:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; white-space: nowrap; transition: border-color .16s var(--ease), background .16s var(--ease); }
.chip:hover { border-color: #CFC7C2; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }

.issue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--warn-bg); border-left: 4px solid var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.issue span { flex: 1 1 200px; min-width: 0; }
.issue button { border: 1.5px solid var(--warn); background: #fff; color: var(--warn); border-radius: 999px; padding: 4px 12px; font-size: 13.5px; font-weight: 700; }
.notice { background: #F4F1EE; border-left: 4px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 13.5px; color: var(--muted); }

.primary { min-height: 44px; padding: 8px 20px; border: 0; border-radius: 12px; color: #fff; font-weight: 700; background: linear-gradient(180deg, #B01A26, var(--brand)); box-shadow: 0 6px 16px rgba(163,22,33,.24); transition: transform .16s var(--ease), background .16s var(--ease); }
.primary:hover { transform: translateY(-1px); }
.primary:disabled { background: #D9D2CE; box-shadow: none; cursor: not-allowed; transform: none; }
.primary.done { background: var(--ok); box-shadow: none; }
.ghost { min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; font-size: 14px; }
.ghost.done { border-color: var(--ok); color: var(--ok); }
.linkbtn { margin-top: 16px; background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; font-size: 13.5px; }
.linkbtn.done { color: var(--ok); }

.tryrow { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; }
.tryrow .help { flex: 1 1 220px; margin: 0; min-width: 0; }
.phead { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 16px 0 8px; }
#prompt { margin: 0; max-height: 380px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #1E1A19; color: #F3ECE8; border-radius: 12px; padding: 14px 16px; font: 12.5px/1.65 Consolas, "Noto Sans Mono CJK TC", "Microsoft JhengHei", monospace; }
#prompt.empty { background: #F4F1EE; color: var(--muted); font-family: inherit; font-size: 14px; }
.steps { margin: 0; padding-left: 22px; font-size: 14px; }
.steps li { margin: 4px 0; }
.addon { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addon label { font-size: 13.5px; font-weight: 700; }
.addon select { flex: 1 1 160px; width: auto; min-width: 0; }

/* 版面示意：依所選外觀換色 */
.wire { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 7px; background: #FAF9F7; --w-card: #fff; --w-ink: #201B1A; --w-soft: #E4DDD8; --w-acc: #A31621; }
.wire.style-dark { background: #12161C; --w-card: #1C222B; --w-ink: #E9EEF5; --w-soft: #36404D; --w-acc: #E2B95A; border-color: #12161C; }
.wire.style-mobile { max-width: 250px; margin: 0 auto; border-radius: 22px; padding: 14px 10px; }
.wire.style-print { background: #fff; --w-card: #fff; --w-soft: #D9D2CE; --w-acc: #201B1A; }
.w-top { display: flex; flex-wrap: wrap; gap: 5px; font-size: 10.5px; color: var(--w-ink); }
.w-top span { border: 1px solid var(--w-soft); border-radius: 6px; padding: 1px 7px; background: var(--w-card); }
.w-top .w-key { flex: 1 1 80px; }
.w-demo { font-size: 10.5px; text-align: center; border-radius: 6px; padding: 2px; background: #F9F1E0; color: #8A5E0C; }
.w-block { background: var(--w-card); border: 1px solid var(--w-soft); border-radius: 8px; padding: 7px 9px; }
.wire.style-print .w-block { border-width: 0 0 1px; border-radius: 0; }
.w-title { font-size: 11.5px; font-weight: 700; color: var(--w-ink); margin-bottom: 5px; }
.w-foot { font-size: 10px; color: var(--w-ink); opacity: .55; text-align: center; }
.g-row { display: flex; gap: 6px; }
.g-row i { flex: 1; height: 26px; border-radius: 5px; background: var(--w-soft); }
.g-row.s i { height: 18px; } .g-row.t i { height: 38px; }
.wire.style-mobile .g-row.t, .wire.style-mobile .g-row.s { flex-direction: column; }
.wire.style-mobile .g-row.t i, .wire.style-mobile .g-row.s i { flex: none; height: 14px; }
.wire svg { display: block; width: 100%; height: 44px; }
.l1 { fill: none; stroke: var(--w-acc); stroke-width: 2; } .l2 { fill: none; stroke: var(--w-ink); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .6; } .l3 { fill: none; stroke: var(--w-soft); stroke-width: 1.5; }
.a1 { fill: var(--down); opacity: .55; } .b1 { fill: var(--up); opacity: .75; } .b2 { fill: var(--down); opacity: .75; }
.g-table { display: grid; gap: 4px; flex: 1; }
.g-table i { height: 6px; border-radius: 3px; background: var(--w-soft); }
.g-table i.short { width: 60%; }
.g-donut { display: flex; gap: 10px; align-items: center; }
.g-donut svg { width: 44px; height: 44px; flex: none; }
.d1 { fill: none; stroke: var(--w-soft); stroke-width: 7; } .d2 { fill: none; stroke: var(--w-acc); stroke-width: 7; stroke-dasharray: 53 88; transform: rotate(-90deg); transform-origin: 20px 20px; }
.g-gauge { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--w-soft), var(--w-acc)); margin: 8px 0 4px; }
.g-gauge b { position: absolute; left: 58%; top: -5px; width: 3px; height: 22px; background: var(--w-ink); border-radius: 2px; }
.g-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.g-grid i { height: 7px; border-radius: 2px; background: var(--w-soft); }
.g-grid i:nth-child(3n) { background: var(--w-acc); opacity: .55; } .g-grid i:nth-child(7n) { opacity: .3; }

.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(250,249,247,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; }
.sticky .primary { flex: 1; }
.foot { max-width: 1180px; margin: 28px auto 0; padding: 0 16px 20px; font-size: 12.5px; color: var(--muted); }
.foot p + p { margin-top: 4px; }

@media (max-width: 599px) {
  .intro { padding: 20px 0 14px; }
  .intro h1 { font-size: 23px; }
  .facts { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
  .facts li { border: 0; border-radius: 0; padding: 8px 0; background: none; }
  .facts li + li { border-top: 1px solid var(--line); }
  .card { padding: 16px; }
}
@media (min-width: 1000px) {
  body { padding-bottom: 0; }
  .grid { grid-template-columns: minmax(0, 1fr) 440px; }
  .right { position: sticky; top: 62px; max-height: calc(100vh - 74px); overflow: auto; border-radius: var(--radius); }
  .sticky { display: none; }
  .intro h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
