:root {
  --ink: #202925;
  --muted: #66716c;
  --line: #d9dfdb;
  --surface: #ffffff;
  --canvas: #f3f5f2;
  --green: #236858;
  --green-dark: #174a40;
  --green-soft: #e6f0ec;
  --amber: #a66028;
  --amber-soft: #f6ece2;
  --blue: #4b6675;
  --blue-soft: #e9eff2;
  --danger: #a23e34;
  --danger-soft: #f5e8e6;
  --experience: #17211e;
  color-scheme: light;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  letter-spacing: 0;
}

body.experience-active {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.brand-strip {
  min-height: 58px;
  padding: 10px clamp(18px, 4vw, 60px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.brand-link img {
  width: 28px;
  height: 28px;
}

.brand-strip nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand-strip nav a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.brand-strip nav a:hover,
.brand-strip nav a:focus-visible {
  color: var(--green);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 30px auto 44px;
}

.setup-view,
.report-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(26, 47, 40, 0.07);
  overflow: hidden;
}

.tool-heading,
.report-heading {
  min-height: 148px;
  padding: 30px 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.eyebrow,
.section-number {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.25;
}

.subtitle {
  max-width: 680px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.duration-note {
  flex: 0 0 auto;
  min-width: 154px;
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  display: grid;
  gap: 4px;
}

.duration-note strong {
  font-size: 14px;
}

.duration-note span {
  color: #7d5b3e;
  font-size: 12px;
}

.mode-switch {
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: #fafbf9;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 250px));
  gap: 0;
}

.mode-switch button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #bdc8c3;
  background: #fff;
  color: #53605b;
  font-size: 14px;
  font-weight: 750;
}

.mode-switch button:first-child {
  border-radius: 6px 0 0 6px;
}

.mode-switch button:last-child {
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
}

.mode-switch button.active {
  position: relative;
  z-index: 1;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.case-mode,
.readiness-section,
.report-section {
  padding: 28px 34px 32px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.report-section-title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
}

.section-heading > p {
  max-width: 420px;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.preset-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.preset-option {
  min-width: 0;
  min-height: 206px;
  padding: 17px 17px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.preset-option:hover {
  border-color: #aabbb4;
}

.preset-option.selected {
  border-color: var(--green);
  background: #fbfdfc;
  box-shadow: 0 0 0 3px rgba(35, 104, 88, 0.09);
}

.preset-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.preset-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preset-meta span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.preset-check {
  width: 18px;
  height: 18px;
  border: 1px solid #b6c1bd;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selected .preset-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.preset-check::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.preset-option h3 {
  margin: 14px 0 7px;
  font-size: 17px;
  line-height: 1.4;
}

.preset-option p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.preset-quote {
  margin-top: auto !important;
  padding-top: 12px;
  color: #3e4d47 !important;
  font-weight: 650;
}

.custom-form {
  display: grid;
  gap: 17px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.custom-form label {
  display: grid;
  gap: 7px;
}

.custom-form label > span {
  font-size: 13px;
  font-weight: 750;
}

.custom-form label b {
  margin-left: 5px;
  color: var(--amber);
  font-size: 10px;
}

input,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd4cf;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

input {
  min-height: 44px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #929d98;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 104, 88, 0.1);
}

.form-message,
.start-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.boundary-band {
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

.boundary-band p {
  margin: 0;
  color: #644a34;
  font-size: 14px;
  line-height: 1.75;
}

.consent-list {
  margin-top: 18px;
  display: grid;
  gap: 11px;
}

.consent-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #44514c;
  font-size: 13px;
  line-height: 1.65;
}

.consent-list input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.start-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 750;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  min-width: 160px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.secondary-button {
  border: 1px solid #c2ccc7;
  background: #fff;
  color: var(--ink);
}

.primary-button:hover,
.primary-button:focus-visible {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: #96aaa1;
  background: var(--green-soft);
  color: var(--green-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.privacy-note {
  max-width: 800px;
  margin: 12px 0 0;
  color: #7b8581;
  font-size: 11px;
  line-height: 1.65;
}

.experience-view {
  position: fixed;
  z-index: 50;
  inset: 0;
  min-width: 320px;
  min-height: 520px;
  padding: 26px 34px 22px;
  background: var(--experience);
  color: #f5f8f6;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.experience-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experience-header a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f5ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.experience-header img {
  width: 27px;
  height: 27px;
}

.experience-header span {
  color: #b8c5c0;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
}

.experience-center {
  width: min(720px, 100%);
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.experience-kicker {
  margin: 0 0 24px;
  color: #d9a16e;
  font-size: 13px;
  font-weight: 800;
}

.listening-mark {
  width: 176px;
  height: 176px;
  margin: 0 auto 28px;
  border: 1px solid rgba(211, 224, 218, 0.24);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.listening-mark::before {
  content: "";
  position: absolute;
  width: 128px;
  height: 128px;
  border: 1px solid rgba(217, 161, 110, 0.27);
  border-radius: 50%;
}

.listening-mark span {
  position: relative;
  z-index: 1;
  width: 5px;
  height: 20px;
  border-radius: 4px;
  background: #d9a16e;
  transform-origin: center;
}

.experience-view[data-state="listening"] .listening-mark {
  border-color: rgba(123, 181, 159, 0.5);
}

.experience-view[data-state="listening"] .listening-mark span {
  background: #7bb59f;
  animation: listenPulse 950ms ease-in-out infinite;
}

.experience-view[data-state="listening"] .listening-mark span:nth-child(2),
.experience-view[data-state="listening"] .listening-mark span:nth-child(4) {
  animation-delay: 130ms;
}

.experience-view[data-state="listening"] .listening-mark span:nth-child(3) {
  animation-delay: 260ms;
}

.experience-view[data-state="thinking"] .listening-mark {
  animation: thinkingRing 1.8s ease-in-out infinite;
}

.experience-view[data-state="speaking"] .listening-mark span {
  animation: speakingPulse 1.2s ease-in-out infinite;
}

.experience-view[data-state="speaking"] .listening-mark span:nth-child(2),
.experience-view[data-state="speaking"] .listening-mark span:nth-child(4) {
  animation-delay: 180ms;
}

.experience-center h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.35;
}

.experiencePrompt {
  max-width: 620px;
  min-height: 52px;
  margin: 14px 0 0;
  color: #c9d4d0;
  font-size: 16px;
  line-height: 1.75;
}

.transcript-preview {
  max-width: 620px;
  min-height: 42px;
  margin: 16px 0 0;
  color: #8fa19a;
  font-size: 13px;
  line-height: 1.65;
}

.experience-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.experience-controls button {
  min-width: 112px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #51615b;
  border-radius: 7px;
  background: #202d29;
  color: #eef3f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.experience-controls button span {
  font-size: 16px;
}

.experience-controls button b {
  font-size: 13px;
}

.experience-controls .stop-control {
  border-color: #81504b;
  background: #352522;
  color: #f5dcd8;
}

.voice-command-note {
  margin: 13px 0 0;
  color: #85958f;
  font-size: 11px;
  text-align: center;
}

.report-heading {
  align-items: center;
}

.report-heading > div {
  min-width: 0;
}

.report-heading p:last-child {
  max-width: 780px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.report-boundary {
  padding: 15px 34px;
  border-bottom: 1px solid #e2c9c6;
  background: var(--danger-soft);
  color: #6d3f39;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.65;
}

.report-section-title {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-section-title > span {
  color: var(--amber);
  font-size: 11px;
  font-weight: 850;
}

.known-material {
  display: grid;
  gap: 9px;
}

.known-material p {
  margin: 0;
  color: #46534e;
  font-size: 14px;
  line-height: 1.7;
}

.known-material strong {
  color: var(--ink);
}

.experience-path {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  counter-reset: path;
}

.experience-path li {
  min-width: 0;
  min-height: 126px;
  padding: 13px;
  border-top: 3px solid #92aaa0;
  background: #f7f9f7;
  counter-increment: path;
}

.experience-path li::before {
  content: counter(path, decimal-leading-zero);
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.experience-path strong {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.experience-path p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.report-grid .report-section {
  border-bottom: 0;
}

.report-grid .report-section + .report-section {
  border-left: 1px solid var(--line);
}

.report-section ul {
  margin: 0;
  padding-left: 19px;
}

.report-section li {
  margin-top: 9px;
  color: #47544f;
  font-size: 14px;
  line-height: 1.7;
}

.projection-section {
  border-bottom: 0;
  background: var(--blue-soft);
}

.icp-footer {
  min-height: 66px;
  padding: 18px clamp(20px, 4vw, 58px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: #78827e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 11px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.public-security-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.public-security-link img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

@keyframes listenPulse {
  0%,
  100% {
    transform: scaleY(0.65);
  }
  50% {
    transform: scaleY(1.8);
  }
}

@keyframes speakingPulse {
  0%,
  100% {
    transform: scaleY(0.75);
  }
  50% {
    transform: scaleY(1.45);
  }
}

@keyframes thinkingRing {
  0%,
  100% {
    border-color: rgba(211, 224, 218, 0.2);
  }
  50% {
    border-color: rgba(217, 161, 110, 0.65);
  }
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 24px, 720px);
    margin-top: 18px;
  }

  .tool-heading,
  .report-heading {
    min-height: 0;
    padding: 24px 22px;
  }

  .duration-note {
    display: none;
  }

  .mode-switch,
  .case-mode,
  .readiness-section,
  .report-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-list,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .preset-option {
    min-height: 0;
  }

  .preset-quote {
    margin-top: 12px !important;
  }

  .report-grid .report-section + .report-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .experience-path {
    grid-template-columns: 1fr;
  }

  .experience-path li {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .brand-strip {
    min-height: 54px;
    padding: 9px 14px;
  }

  .brand-strip nav {
    gap: 12px;
  }

  .brand-strip nav a:first-child {
    display: none;
  }

  .brand-link {
    font-size: 12px;
  }

  .brand-link img {
    width: 25px;
    height: 25px;
  }

  .shell {
    width: 100%;
    margin: 0 auto;
  }

  .setup-view,
  .report-view {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .tool-heading,
  .report-heading {
    padding: 23px 18px;
    display: block;
  }

  h1 {
    font-size: 27px;
  }

  .report-heading .secondary-button {
    margin-top: 18px;
  }

  .mode-switch {
    padding: 14px 18px;
  }

  .mode-switch button {
    min-height: 46px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.35;
  }

  .case-mode,
  .readiness-section,
  .report-section {
    padding: 24px 18px 27px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 8px;
    text-align: left;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .start-row {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .experience-view {
    padding: 18px 18px 16px;
  }

  .listening-mark {
    width: 138px;
    height: 138px;
    margin-bottom: 23px;
  }

  .listening-mark::before {
    width: 100px;
    height: 100px;
  }

  .experience-center h2 {
    font-size: 23px;
  }

  .experiencePrompt {
    min-height: 48px;
    font-size: 14px;
  }

  .experience-controls button {
    min-width: 106px;
  }

  .report-boundary {
    padding: 14px 18px;
    display: block;
  }

  .report-boundary strong {
    display: block;
    margin-bottom: 3px;
  }

  .icp-footer {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
