:root {
  --bg: #0f1216;
  --panel: #171b22;
  --panel-2: #1d222b;
  --line: #2a313c;
  --text: #e8edf4;
  --muted: #9aa6b6;
  --accent: #ff6b4a;
  --accent-2: #ffa14a;
  --pos: #36d399;
  --neg: #f4628a;
  --neu: #8aa0bd;
  --risk: #ffb020;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #20262f 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(15, 18, 22, 0.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 34px; line-height: 1; }
.site-header h1 { font-size: 20px; margin: 0; letter-spacing: 0.5px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; color: var(--accent-2); border: 1px solid rgba(255, 161, 74, 0.4); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }

main { padding: 28px 0 60px; }

/* panels */
.panel, .card, .about { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.input-panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.panel-head h2 { font-size: 16px; margin: 0; }
.actions { display: flex; gap: 8px; }

textarea {
  width: 100%; min-height: 200px; resize: vertical;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 14px; line-height: 1.7;
  font-family: inherit;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.15); }

.panel-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 12px; }
.hint { color: var(--muted); font-size: 13px; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer;
  transition: 0.15s ease; font-family: inherit;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #1a1207; font-weight: 700; padding: 10px 22px; }
.btn.primary:hover { filter: brightness(1.07); }

/* results */
.results { margin-top: 26px; }
.hidden { display: none; }
.summary-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; line-height: 1.2; }
.stat b { font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.pos b { color: var(--pos); }
.stat.neg b { color: var(--neg); }
.stat.neu b { color: var(--neu); }
.grow { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { padding: 18px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card-sub { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.card.pain { border-top: 3px solid var(--neg); }
.card.sell { border-top: 3px solid var(--pos); }
.card.risk { border-top: 3px solid var(--risk); }
.card.motive { border-top: 3px solid #6aa9ff; }
.card.copy { border-top: 3px solid var(--accent); }
.card.extra { border-top: 3px solid #b48aff; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-head .name { font-weight: 700; font-size: 14px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.count { color: var(--accent-2); border-color: rgba(255, 161, 74, 0.4); }
.tag.u-高 { color: #ff5a5a; border-color: rgba(255, 90, 90, 0.5); }
.tag.u-中 { color: var(--risk); border-color: rgba(255, 176, 32, 0.5); }
.tag.u-低 { color: var(--muted); }
.quotes { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; }
.quotes span { display: block; padding-left: 12px; position: relative; }
.quotes span::before { content: "›"; position: absolute; left: 0; color: var(--accent); }
.copy-line { font-size: 14px; }
.copy-line .src { color: var(--muted); font-size: 12px; margin-left: 6px; }
.copy-hook { background: linear-gradient(135deg, rgba(255,107,74,.15), rgba(255,161,74,.12)); border-color: rgba(255,161,74,.4); }
.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }

/* about */
.about { padding: 22px; margin-top: 26px; }
.about h2 { font-size: 17px; margin: 0 0 10px; }
.about p { color: var(--text); font-size: 14px; }
.bullets { margin: 10px 0; padding-left: 20px; }
.bullets li { margin: 6px 0; font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; padding: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent); color: #1a1207; padding: 10px 20px; border-radius: 10px; font-weight: 700; opacity: 0; transition: 0.25s ease; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .badge { align-self: flex-start; }
  .panel-foot { flex-direction: column-reverse; align-items: stretch; }
  .panel-foot .btn { width: 100%; }
}
