:root {
  --ink: #102d29;
  --muted: #647d78;
  --green: #277b6d;
  --green-strong: #17665a;
  --mint: #dff5e9;
  --blue: #e4f0ff;
  --paper: rgba(255, 255, 255, .78);
  --line: rgba(27, 91, 80, .13);
  --shadow: 0 22px 65px rgba(32, 88, 78, .10);
  --radius: 26px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 0%, rgba(195, 241, 215, .82), transparent 29%),
    radial-gradient(circle at 96% 14%, rgba(211, 231, 255, .88), transparent 30%),
    linear-gradient(145deg, #f5fbf7, #f7fbff 54%, #eff8f5);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(47, 141, 123, .24);
  outline-offset: 2px;
}
.noscript { padding: 14px; color: #7d3528; background: #ffe5dd; text-align: center; }
.page-shell { min-height: 100vh; overflow: hidden; }

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  width: min(1220px, calc(100% - 40px));
  height: 72px;
  margin: 18px auto 0;
  padding: 0 14px 0 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background: rgba(255,255,255,.67);
  box-shadow: 0 14px 42px rgba(41,91,83,.08);
  backdrop-filter: blur(22px);
}
.brand { width: max-content; padding: 0; display: flex; gap: 11px; align-items: center; border: 0; color: inherit; background: transparent; text-align: left; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px 13px 13px 5px; color: #fff; background: var(--ink); font: 700 19px/1 Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.nav-tabs { display: flex; gap: 4px; padding: 5px; border-radius: 17px; background: rgba(235,245,242,.8); }
.nav-tabs button { padding: 10px 21px; border: 0; border-radius: 12px; color: #5c736e; background: transparent; font-size: 12px; }
.nav-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 12px rgba(35,73,67,.08); font-weight: 700; }

.primary-button, .secondary-button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 720;
}
.primary-button { border: 1px solid var(--ink); color: #fff; background: var(--ink); box-shadow: 0 8px 22px rgba(18,43,40,.15); }
.secondary-button { border: 1px solid var(--line); color: #4f706a; background: rgba(255,255,255,.8); }
.top-report { justify-self: end; }

main { width: min(1180px, calc(100% - 40px)); margin: 34px auto 70px; }
.service-banner {
  min-height: 44px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(64,133,118,.13);
  border-radius: 14px;
  color: #48736b;
  background: rgba(226,244,237,.75);
  font-size: 10px;
}
.service-banner.demo { color: #776846; background: rgba(247,239,215,.78); }
.service-banner.error { color: #8c4b3f; background: rgba(255,229,221,.82); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4db587; box-shadow: 0 0 0 4px rgba(77,181,135,.13); }
.service-banner.demo .status-dot { background: #c59b42; box-shadow: 0 0 0 4px rgba(197,155,66,.12); }
.service-banner.error .status-dot { background: #cf6a58; }
.service-banner strong { font-size: 10px; }
.service-banner span:last-child { color: inherit; opacity: .75; }

.view { margin-top: 20px; padding: 36px; border: 1px solid rgba(255,255,255,.91); border-radius: 34px; background: rgba(255,255,255,.58); box-shadow: var(--shadow); backdrop-filter: blur(25px); }
.view[hidden] { display: none; }
.view-heading, .heat-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 25px; }
.eyebrow { color: #3f786f; font-size: 9px; font-weight: 780; letter-spacing: .16em; }
h1 { margin: 10px 0 11px; font-size: clamp(34px, 4vw, 53px); line-height: 1.08; letter-spacing: -.055em; }
.view-heading p, .heat-intro p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.summary-pills { display: flex; gap: 8px; }
.summary-pills span { min-width: 92px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; color: #6a817c; background: rgba(255,255,255,.7); font-size: 9px; text-align: center; }
.summary-pills b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 19px; }

.control-deck {
  margin-top: 27px;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 165px auto;
  gap: 9px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(242,248,246,.84);
}
.search-control { height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(34,84,76,.1); border-radius: 13px; background: #fff; }
.search-control > span { color: #4c756e; font-size: 21px; transform: rotate(-15deg); }
.search-control input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.select-control > span, .heat-filters label > span, .dialog-card label > span { display: block; margin-bottom: 6px; color: #6c817d; font-size: 8px; font-weight: 720; }
.select-control > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.select-control select, .heat-filters select, .heat-filters input, .dialog-card select, .dialog-card input {
  width: 100%; height: 46px; padding: 0 12px; border: 1px solid rgba(34,84,76,.12); border-radius: 13px; color: var(--ink); background: #fff; outline: 0; font-size: 10px;
}
.dialog-card textarea { width: 100%; padding: 11px 12px; resize: vertical; border: 1px solid rgba(34,84,76,.12); border-radius: 13px; color: var(--ink); background: #fff; outline: 0; font-size: 10px; line-height: 1.55; }
.segment-control { display: flex; gap: 3px; padding: 4px; border-radius: 13px; background: #e6f0ed; }
.segment-control button { min-width: 62px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; color: #627a75; background: transparent; font-size: 9px; font-weight: 680; }
.segment-control button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(35,79,72,.08); }

.library-grid { margin-top: 18px; min-height: 680px; display: grid; grid-template-columns: minmax(300px,.78fr) minmax(0,1.55fr); gap: 17px; }
.question-index, .question-detail, .ranking-panel { border: 1px solid var(--line); border-radius: 23px; background: rgba(255,255,255,.72); overflow: hidden; }
.panel-head { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-head strong { font-size: 11px; }
.panel-head > span { color: #849590; font-size: 8px; }
.question-list { height: 680px; padding: 8px; overflow: auto; }
.topic-card { width: 100%; min-height: 70px; padding: 10px 11px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 1px solid transparent; border-radius: 14px; color: var(--ink); background: transparent; text-align: left; }
.topic-card:hover { background: rgba(235,246,242,.64); }
.topic-card.active { border-color: rgba(50,128,111,.13); background: linear-gradient(135deg, rgba(223,244,235,.86), rgba(232,241,253,.72)); }
.topic-number { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #34766b; background: #e0f2ec; font-size: 9px; font-weight: 750; }
.topic-copy { min-width: 0; }
.topic-copy strong, .topic-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-copy strong { font-size: 11px; }
.topic-copy small { margin-top: 5px; color: #82938f; font-size: 8px; }
.topic-arrow { color: #66817b; font-size: 14px; }
.question-detail { min-height: 680px; padding: 28px; }
.detail-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.detail-top h2 { margin: 7px 0 4px; font-size: 28px; letter-spacing: -.04em; }
.detail-source { max-width: 210px; padding: 7px 10px; border-radius: 9px; color: #718783; background: #f1f6f5; font-size: 8px; text-align: right; }
.detail-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.detail-meta span { padding: 6px 9px; border-radius: 8px; color: #4b736b; background: #e6f3ef; font-size: 8px; font-weight: 700; }
.question-section { margin-top: 21px; }
.question-section h3 { margin: 0 0 10px; color: #58736d; font-size: 9px; letter-spacing: .1em; }
.question-section ol { margin: 0; padding: 0; list-style: none; counter-reset: question; }
.question-section li { position: relative; margin-top: 8px; padding: 13px 14px 13px 42px; border: 1px solid var(--line); border-radius: 13px; color: #26443f; background: rgba(248,251,250,.8); font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.55; counter-increment: question; }
.question-section li::before { content: counter(question); position: absolute; left: 13px; top: 12px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; color: #37776c; background: #e4f3ed; font: 700 8px/1 sans-serif; }
.cue-card { padding: 17px; border-radius: 15px; background: linear-gradient(135deg, rgba(226,246,237,.78), rgba(230,240,254,.75)); }
.cue-card strong { display: block; font: 600 14px/1.5 Georgia, serif; }
.cue-card p { margin: 8px 0 0; color: #5d7772; font-size: 9px; }
.detail-actions { margin-top: 23px; display: flex; justify-content: flex-end; }
.empty-state { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #839590; text-align: center; }
.empty-state > span { margin-bottom: 8px; font-size: 27px; }
.empty-state strong { color: #54706a; font-size: 12px; }
.empty-state p { margin: 7px 0 0; font-size: 9px; }

.heat-intro { min-height: 210px; padding: 30px; align-items: flex-end; border-radius: 25px; background: radial-gradient(circle at 85% 15%, rgba(169,225,211,.55), transparent 34%), linear-gradient(135deg, rgba(235,249,242,.9), rgba(229,239,254,.86)); }
.heat-intro h1 { max-width: 720px; }
.featured-cities { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 7px; }
.featured-cities button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; color: #4d716a; background: rgba(255,255,255,.72); font-size: 9px; }
.featured-cities button.active { color: #fff; background: var(--green-strong); }
.heat-filters { margin-top: 14px; padding: 12px; display: grid; grid-template-columns: 170px minmax(160px,1fr) 150px auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 18px; background: rgba(246,250,249,.78); }
.heat-filters select, .heat-filters input { height: 42px; }
.heat-stats { margin-top: 15px; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.heat-stats article { min-height: 116px; padding: 17px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.7); }
.heat-stats span { color: #718681; font-size: 9px; }
.heat-stats strong { margin: auto 0 2px; font-size: 27px; letter-spacing: -.045em; }
.heat-stats strong.city-stat { font-size: 18px; }
.heat-stats small { color: #91a09d; font-size: 8px; }
.ranking-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.ranking-panel { margin-top: 16px; padding: 25px; }
.ranking-panel-p2 { background: linear-gradient(145deg,rgba(255,255,255,.78),rgba(238,245,255,.76)); }
.panel-head.large { height: auto; padding: 0 0 17px; }
.panel-head h2 { margin: 6px 0 0; font-size: 25px; letter-spacing: -.04em; }
.ranking-list { border-top: 1px solid var(--line); }
.ranking-row { min-height: 79px; padding: 11px 4px; display: grid; grid-template-columns: 36px minmax(190px,1fr) minmax(100px,.7fr) 80px 74px; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.rank { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #267266; background: #dff2eb; font-size: 10px; font-weight: 780; }
.rank.first { color: #994936; background: #ffe2d6; }
.rank.second { color: #846b2e; background: #fff0c7; }
.rank-topic strong, .rank-topic small { display: block; }
.rank-topic strong { font-size: 11px; }
.rank-topic small { margin-top: 5px; color: #839590; font-size: 8px; }
.heat-meter { height: 6px; border-radius: 99px; background: #e8efed; overflow: hidden; }
.heat-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#62bd98,#6ea9df); }
.rank-count { text-align: right; }
.rank-count strong, .rank-count small { display: block; }
.rank-count strong { font-size: 15px; }
.rank-count small { color: #879793; font-size: 7px; }
.heat-label { justify-self: end; padding: 6px 8px; border-radius: 8px; color: #3f7168; background: #e8f3ef; font-size: 8px; font-weight: 700; }
.heat-label.hot { color: #9c4b36; background: #ffe5dc; }
.heat-label.warm { color: #8a6c26; background: #fff1ce; }
.ranking-grid .ranking-row { grid-template-columns: 32px minmax(0,1fr) 62px; grid-template-rows: auto auto; gap: 8px 10px; }
.ranking-grid .ranking-row .rank { grid-row: 1 / span 2; }
.ranking-grid .ranking-row .heat-meter { grid-column: 2 / 4; }
.ranking-grid .ranking-row .rank-count { grid-column: 3; grid-row: 1; }
.ranking-grid .ranking-row .heat-label { display: none; }

footer { width: min(1180px, calc(100% - 40px)); min-height: 82px; margin: 0 auto 24px; padding: 18px 22px; display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: center; gap: 15px; border: 1px solid rgba(255,255,255,.88); border-radius: 23px; background: rgba(255,255,255,.5); }
footer > div { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.brand-mark.mini { width: 28px; height: 28px; border-radius: 9px 9px 9px 4px; font-size: 13px; }
footer p { margin: 0; color: #7d8f8b; font-size: 8px; text-align: center; }
footer a { justify-self: end; color: #3e746a; font-size: 9px; text-decoration: none; font-weight: 700; }

.report-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 25px; background: transparent; overflow: visible; }
.report-dialog::backdrop { background: rgba(13,38,34,.36); backdrop-filter: blur(10px); }
.dialog-card { max-height: calc(100vh - 32px); padding: 29px; position: relative; overflow-y: auto; border: 1px solid rgba(255,255,255,.9); border-radius: 25px; background: rgba(250,253,252,.98); box-shadow: 0 30px 90px rgba(13,47,41,.24); }
.dialog-card h2 { margin: 8px 0; font-size: 25px; letter-spacing: -.04em; }
.dialog-card > p { margin: 0 0 15px; color: #718580; font-size: 9px; line-height: 1.6; }
.dialog-card label { display: block; margin-top: 12px; }
.report-question-picker { margin-top: 12px; }
.report-question-picker > label { margin-top: 0; }
.report-question-searchbox { height: 48px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(34,84,76,.14); border-radius: 13px; background: #fff; transition: .2s ease; }
.report-question-searchbox:focus-within { border-color: #57a88c; box-shadow: 0 0 0 4px rgba(67,157,126,.11); }
.report-question-searchbox > span { color: #4c756e; font-size: 20px; transform: rotate(-15deg); }
.report-question-searchbox input { height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; }
.report-search-summary { min-height: 25px; padding: 7px 3px 3px; color: #82938f; font-size: 8px; }
.report-question-results { max-height: 230px; padding: 6px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 14px 38px rgba(31,73,65,.12); }
.report-question-result { width: 100%; padding: 11px 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; }
.report-question-result:hover, .report-question-result:focus-visible { background: #edf7f3; }
.report-question-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.report-question-result > span { align-self: start; padding: 4px 6px; border-radius: 6px; color: #44736a; background: #e5f3ee; font-size: 7px; font-weight: 760; }
.report-question-result small { grid-column: 1 / -1; overflow: hidden; color: #7e918c; font-family: Georgia, "Times New Roman", serif; font-size: 8px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.report-question-empty { padding: 24px 12px; color: #7f918c; font-size: 9px; line-height: 1.6; text-align: center; }
.report-question-selected { min-height: 54px; padding: 10px 11px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; align-items: center; border: 1px solid rgba(55,139,112,.18); border-radius: 13px; background: linear-gradient(135deg, #e8f7f0, #eef5ff); }
.report-question-selected strong, .report-question-selected small { display: block; }
.report-question-selected strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.report-question-selected small { margin-top: 4px; color: #68807a; font-size: 8px; }
.report-question-selected button { grid-column: 2; grid-row: 1 / span 2; padding: 7px 9px; border: 1px solid rgba(50,113,98,.12); border-radius: 8px; color: #3e7469; background: rgba(255,255,255,.72); font-size: 8px; }
.report-new-question { width: 100%; margin-top: 9px; padding: 10px 12px; border: 1px dashed rgba(49,124,103,.28); border-radius: 11px; color: #357465; background: rgba(232,247,240,.58); font-size: 9px; }
.report-new-question:hover { background: #e6f5ef; }
.submission-p23-fields { display: grid; gap: 4px; padding: 14px; margin-top: 12px; border: 1px solid var(--line); border-radius: 15px; background: #f3f9f6; }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 10px; color: #647b76; background: #fff; font-size: 19px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.privacy-note { margin-top: 14px; padding: 12px; display: flex; gap: 9px; border-radius: 12px; color: #5f7873; background: #eaf5f1; }
.privacy-note p { margin: 0; font-size: 8px; line-height: 1.5; }
.form-error { margin-top: 12px; padding: 10px; border-radius: 10px; color: #91483b; background: #ffe5de; font-size: 9px; }
.dialog-submit { width: 100%; margin-top: 16px; }
.dialog-submit:disabled { cursor: not-allowed; opacity: .5; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; max-width: calc(100% - 30px); padding: 11px 16px; transform: translate(-50%, 20px); border-radius: 12px; color: #fff; background: rgba(16,45,41,.94); box-shadow: 0 14px 40px rgba(12,42,37,.2); font-size: 10px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 930px) {
  .topbar { height: auto; min-height: 72px; padding-block: 11px; grid-template-columns: 1fr auto; row-gap: 8px; }
  .brand { grid-column: 1; grid-row: 1; }
  .top-report { grid-column: 2; grid-row: 1; }
  .nav-tabs { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .nav-tabs button { flex: 1; }
  .control-deck { grid-template-columns: 1fr 160px; }
  .segment-control { grid-column: 1 / -1; }
  .segment-control button { flex: 1; }
  .library-grid { grid-template-columns: 1fr; }
  .question-list { height: 400px; }
  .question-detail { min-height: auto; }
  .heat-stats { grid-template-columns: 1fr 1fr; }
  .ranking-grid { grid-template-columns: 1fr; }
  .ranking-row { grid-template-columns: 34px minmax(160px,1fr) minmax(90px,.6fr) 72px; }
  .heat-label { display: none; }
}

@media (max-width: 680px) {
  .topbar { width: calc(100% - 24px); height: auto; margin-top: 10px; border-radius: 20px; }
  .brand small { display: none; }
  .top-report { padding: 0 12px; }
  main { width: calc(100% - 24px); margin-top: 22px; }
  .service-banner { align-items: flex-start; flex-wrap: wrap; }
  .view { padding: 20px 14px; border-radius: 25px; }
  .view-heading, .heat-intro { flex-direction: column; }
  h1 { font-size: 37px; }
  .summary-pills { width: 100%; }
  .summary-pills span { flex: 1; }
  .control-deck { grid-template-columns: 1fr; }
  .segment-control { grid-column: auto; overflow-x: auto; }
  .segment-control button { min-width: 70px; }
  .question-detail { padding: 20px 15px; }
  .detail-top { flex-direction: column; }
  .detail-source { max-width: none; text-align: left; }
  .heat-intro { min-height: 290px; padding: 23px; align-items: flex-start; }
  .heat-filters { grid-template-columns: 1fr; }
  .heat-stats { grid-template-columns: 1fr 1fr; }
  .ranking-panel { padding: 20px 12px; }
  .ranking-row { grid-template-columns: 31px 1fr 62px; gap: 8px; }
  .heat-meter, .heat-label { display: none; }
  footer { width: calc(100% - 24px); grid-template-columns: 1fr auto; }
  footer p { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .heat-stats { grid-template-columns: 1fr; }
  .topic-card { grid-template-columns: 31px minmax(0,1fr) auto; }
}

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