:root {
  --paper: #f4f1ea;
  --paper-deep: #e8e2d7;
  --ink: #1e2022;
  --muted: #6f706e;
  --red: #d92f2f;
  --red-dark: #a91f25;
  --yellow: #f6c945;
  --green: #14765a;
  --white: #fffdf8;
  --line: rgba(30, 32, 34, .14);
  --shadow: 0 16px 42px rgba(48, 35, 28, .10);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(30,32,34,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,32,34,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

button, input { font: inherit; }
button { color: inherit; }

.topbar {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 88px;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--red);
  color: white;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 26px;
  box-shadow: 4px 4px 0 var(--yellow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.28rem; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(1.7rem, 5vw, 2.45rem); }

.icon-button {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,253,248,.76);
  display: grid;
  place-items: center;
}

.icon-button svg, .search-box svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 1120px; margin: 0 auto; padding: 0 18px 40px; }

.focus-card {
  position: relative;
  overflow: hidden;
  min-height: 305px;
  border-radius: 30px;
  padding: 28px 24px;
  color: white;
  background: var(--red);
  box-shadow: var(--shadow);
}

.focus-card::before {
  content: "";
  position: absolute;
  width: 245px;
  height: 245px;
  right: -70px;
  top: -78px;
  border: 46px solid rgba(246,201,69,.95);
  border-radius: 50%;
}

.focus-card::after {
  content: "今";
  position: absolute;
  right: 28px;
  bottom: -36px;
  color: rgba(255,255,255,.10);
  font: 220px/1 "STKaiti", "KaiTi", serif;
}

.focus-card > * { position: relative; z-index: 1; }
.focus-label { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: var(--yellow); color: #312a14; font-size: .8rem; font-weight: 900; }
.focus-card h2 { max-width: 690px; margin: 22px 0 13px; font-size: clamp(2.15rem, 8vw, 4.7rem); line-height: .98; letter-spacing: -.05em; }
.focus-card p { max-width: 610px; color: rgba(255,255,255,.82); line-height: 1.65; font-size: 1rem; }
.focus-actions { display: flex; gap: 10px; margin-top: 22px; }
.primary-button, .secondary-button, .copy-button, .source-button, .prompter-button {
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 17px;
  font-weight: 800;
}
.primary-button { background: white; color: var(--red-dark); }
.secondary-button { background: rgba(255,255,255,.13); color: white; border: 1px solid rgba(255,255,255,.35); }

.workspace, .guide { padding-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.progress-pill { white-space: nowrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.54); color: var(--muted); font-size: .8rem; font-weight: 700; }

.search-box { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-box input::placeholder { color: #96938d; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: .88rem; }
.filter.active { background: var(--ink); color: white; border-color: var(--ink); }

.idea-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.idea-card { position: relative; min-height: 245px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 7px 20px rgba(40,30,25,.05); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.idea-card:active { transform: scale(.985); }
.idea-card.shot { opacity: .68; }
.idea-card.shot::after { content: "已拍"; position: absolute; right: 18px; top: 18px; transform: rotate(8deg); padding: 5px 10px; border: 2px solid var(--green); color: var(--green); border-radius: 7px; font-weight: 900; }
.card-topline { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 8px; background: var(--paper-deep); color: #5a554e; font-size: .74rem; font-weight: 800; }
.tag.hot { background: #fde3df; color: var(--red-dark); }
.tag.safe { background: #dfeee8; color: #0f684f; }
.card-date { margin-left: auto; color: #918d85; font-size: .72rem; }
.idea-card h3 { max-width: 93%; margin-bottom: 12px; font: 700 1.42rem/1.2 "Songti SC", "STSong", serif; }
.idea-card > p { color: var(--muted); line-height: 1.55; font-size: .92rem; }
.card-metrics { display: flex; gap: 16px; margin-top: 26px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.card-metrics strong { color: var(--ink); font-size: .94rem; }
.card-arrow { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state button { margin-top: 12px; border: 0; background: transparent; color: var(--red); text-decoration: underline; }

.guide { display: none; }
.guide.visible { display: block; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.steps li > span { color: var(--red); font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.steps strong { display: block; margin-bottom: 6px; font-size: 1rem; }
.steps p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.safe-card { margin-top: 16px; padding: 22px; border-radius: 20px; background: #222425; color: white; }
.safe-card strong { color: var(--yellow); }
.safe-card p { margin: 9px 0 0; color: rgba(255,255,255,.75); line-height: 1.7; }
.delivery-note { margin-top: 16px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.5); }
.delivery-note summary { cursor: pointer; font-weight: 800; }
.delivery-note p { margin: 13px 0 0; color: var(--muted); line-height: 1.65; font-size: .9rem; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(92%, 420px); display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); border: 1px solid rgba(30,32,34,.12); border-radius: 21px; background: rgba(255,253,248,.88); backdrop-filter: blur(18px); box-shadow: 0 12px 35px rgba(30,30,30,.16); }
.nav-item { min-height: 52px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 750; }
.nav-item span { display: block; margin-bottom: 2px; font-size: 1.05rem; }
.nav-item.active { background: var(--ink); color: white; }

dialog { padding: 0; border: 0; }
dialog::backdrop { background: rgba(10,10,10,.54); backdrop-filter: blur(4px); }
.idea-dialog { width: 100%; max-width: 780px; height: 100%; max-height: 100%; margin: 0 0 0 auto; background: var(--paper); }
.dialog-shell { min-height: 100%; }
.dialog-header { position: sticky; z-index: 2; top: 0; display: grid; grid-template-columns: 76px 1fr 90px; align-items: center; min-height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; border-bottom: 1px solid var(--line); background: rgba(244,241,234,.92); backdrop-filter: blur(16px); text-align: center; font-size: .82rem; font-weight: 800; }
.back-button, .more-button { border: 0; background: transparent; }
.back-button { font-size: 1.6rem; }
.more-button { color: var(--red); font-size: .78rem; font-weight: 800; }
.dialog-content { padding: 26px 20px 60px; }
.detail-kicker { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog-content h2 { margin: 18px 0 12px; font-size: clamp(2.15rem, 8vw, 3.6rem); line-height: 1.06; }
.detail-summary { color: var(--muted); line-height: 1.7; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 22px 0 28px; }
.source-button { display: grid; place-items: center; text-decoration: none; background: var(--ink); color: white; }
.prompter-button { background: var(--red); color: white; }
.detail-section { margin-top: 16px; padding: 21px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
.detail-section h3 { margin-bottom: 14px; font-size: 1.05rem; }
.detail-section p { margin: 0; white-space: pre-line; line-height: 1.85; font-size: 1.02rem; }
.source-map { border-color: rgba(20,118,90,.28); background: #f3faf7; }
.mapping-label { display: inline-flex; margin-bottom: 10px; padding: 5px 9px; border-radius: 7px; background: #dfeee8; color: var(--green); font-size: .75rem; font-weight: 900; }
.mapping-arrow { margin: 16px 0 12px; color: var(--red-dark); font-size: .84rem; font-weight: 900; }
.detail-section ol { margin: 0; padding-left: 21px; }
.detail-section li { margin: 10px 0; padding-left: 4px; line-height: 1.6; }
.copy-button { width: 100%; margin-top: 16px; background: var(--paper-deep); }
.source-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source-stats div { padding: 13px 8px; border-radius: 12px; background: var(--paper); text-align: center; }
.source-stats strong { display: block; font-size: 1.1rem; }
.source-stats span { color: var(--muted); font-size: .72rem; }
.risk-note { border-left: 4px solid var(--yellow); }

.prompter-dialog { width: 100%; height: 100%; max-width: none; max-height: none; background: #111; color: white; }
.prompter-toolbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; background: rgba(17,17,17,.94); border-bottom: 1px solid rgba(255,255,255,.14); }
.prompter-toolbar button { min-height: 40px; padding: 0 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: transparent; color: white; font-size: .82rem; }
.font-controls { display: flex; gap: 5px; }
.prompter-text { max-width: 780px; min-height: 150vh; margin: 0 auto; padding: 35vh 24px 70vh; font-size: 2rem; line-height: 1.75; text-align: center; white-space: pre-line; }

.install-dialog { width: min(92%, 440px); border-radius: 26px; background: var(--white); }
.install-sheet { position: relative; padding: 32px 25px; text-align: center; }
.sheet-close { position: absolute; right: 12px; top: 10px; border: 0; background: transparent; font-size: 1.8rem; }
.install-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; background: var(--red); color: white; font: 36px "STKaiti", "KaiTi", serif; box-shadow: 5px 5px 0 var(--yellow); }
.install-sheet p { color: var(--muted); line-height: 1.7; }
.install-sheet ol { padding-left: 22px; text-align: left; line-height: 1.9; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 18px); padding: 11px 16px; border-radius: 999px; background: #161718; color: white; opacity: 0; pointer-events: none; transition: .25s ease; font-size: .84rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .topbar { padding-left: 26px; padding-right: 26px; }
  main { padding-left: 26px; padding-right: 26px; }
  .focus-card { padding: 42px; }
  .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr 1fr; }
  .bottom-nav { bottom: 20px; }
}

@media (min-width: 1020px) {
  .idea-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .focus-card { min-height: 370px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
