:root {
  --ink: #1d2927;
  --muted: #62706d;
  --line: #d8e0dc;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --accent: #236858;
  --accent-dark: #174c41;
  --accent-soft: #e6f1ed;
  --amber: #a95e25;
  --amber-soft: #f6ece3;
  --blue-soft: #e9eff4;
  --danger: #a33f32;
  --shadow: 0 14px 36px rgba(20, 51, 44, 0.08);
  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 {
  background: var(--canvas);
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.brand-strip {
  min-height: 58px;
  padding: 10px clamp(18px, 4vw, 60px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  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: 700;
  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(--accent);
}

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

.workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 122px;
  padding: 25px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

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

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

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

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.case-controls,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-controls {
  flex: 0 0 auto;
  padding-top: 7px;
}

.icon-button,
.primary-button,
.secondary-button,
.ai-case-button {
  min-height: 40px;
  border-radius: 6px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.primary-button,
.secondary-button,
.ai-case-button {
  padding: 0 17px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

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

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.ai-case-button {
  border-color: #c9a987;
  background: #fffaf5;
  color: #84491d;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: #9bb4ac;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.ai-case-button:hover,
.ai-case-button:focus-visible {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #713a14;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.difficulty-bar {
  min-height: 64px;
  padding: 11px 30px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
}

.difficulty-selector {
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: repeat(3, 76px);
  border: 1px solid #becbc6;
  border-radius: 6px;
  overflow: hidden;
}

.difficulty-selector button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #d1dad6;
  background: #fff;
  color: #53615d;
  font-size: 13px;
  font-weight: 750;
}

.difficulty-selector button:last-child {
  border-right: 0;
}

.difficulty-selector button:hover,
.difficulty-selector button:focus-visible {
  background: #f0f5f3;
  color: var(--accent-dark);
}

.difficulty-selector button.active {
  background: var(--accent);
  color: #fff;
}

.difficulty-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.scope-note {
  min-height: 48px;
  padding: 12px 30px;
  background: var(--accent-dark);
  color: #f8fbfa;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.scope-note strong {
  color: #fff;
}

.scope-note span {
  color: #cfe1dc;
}

.case-section {
  padding: 24px 30px 26px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
}

.case-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.case-meta h2 {
  margin: 5px 0 0;
  font-size: 16px;
}

.case-labels {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.difficulty-badge,
.case-origin {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.difficulty-badge {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.case-origin {
  background: var(--blue-soft);
  color: #405d6e;
}

.case-kicker,
.case-progress,
.local-progress,
.ai-label {
  font-size: 12px;
  font-weight: 700;
}

.case-kicker {
  color: var(--amber);
}

.case-progress,
.local-progress {
  color: var(--muted);
}

blockquote {
  max-width: 1080px;
  margin: 18px 0 0;
  padding: 0 0 0 19px;
  border-left: 3px solid var(--amber);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.75;
  white-space: pre-line;
}

.case-source {
  margin: 12px 0 0 22px;
  color: #78827f;
  font-size: 12px;
}

.case-generation-status {
  min-height: 18px;
  margin: 6px 0 0 22px;
  color: var(--accent);
  font-size: 12px;
}

body[data-difficulty="intermediate"] blockquote {
  font-size: 18px;
  font-weight: 560;
}

body[data-difficulty="advanced"] blockquote {
  max-width: 1180px;
  font-size: 17px;
  font-weight: 520;
  line-height: 1.8;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.practice-panel,
.feedback-panel {
  min-width: 0;
  padding: 28px 30px 30px;
}

.practice-panel {
  border-right: 1px solid var(--line);
}

.feedback-panel {
  background: #f8faf9;
}

.panel-heading {
  min-height: 48px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.ai-label {
  padding: 6px 8px;
  border: 1px solid #c5d6d0;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.answer-field {
  display: block;
  margin-top: 18px;
}

.field-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
}

.field-title b {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: #3d5969;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.inference-field .field-title b {
  background: var(--amber-soft);
  color: var(--amber);
}

.interpretation-field .field-title b {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.field-hint {
  display: block;
  margin: 7px 0 9px 34px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid #cdd6d2;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

textarea::placeholder {
  color: #98a39f;
}

textarea:hover {
  border-color: #aebdb7;
}

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

.inference-field textarea {
  border-color: #d8b899;
  background: #fffdfb;
}

.interpretation-field textarea {
  border-color: #bfd3cc;
  background: #fbfdfc;
}

.optional-divider {
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.optional-divider span {
  position: relative;
  top: -9px;
  padding-right: 10px;
  background: #fff;
}

.form-message {
  min-height: 21px;
  margin: 12px 0 2px;
  color: var(--danger);
  font-size: 13px;
}

.button-row {
  justify-content: flex-start;
}

.privacy-note {
  margin: 12px 0 0;
  color: #78827f;
  font-size: 11px;
  line-height: 1.6;
}

.feedback-empty {
  min-height: 430px;
  padding: 58px 36px;
  border: 1px dashed #c9d5d0;
  border-radius: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 15px;
  border: 2px solid #9eb8af;
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
}

.feedback-empty p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.hidden {
  display: none !important;
}

.feedback-summary {
  margin: 0 0 18px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.dimension-list {
  display: grid;
  gap: 11px;
}

.dimension-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

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

.dimension-item h3,
.chain-section h3,
.alternatives-section h3 {
  margin: 0;
  font-size: 14px;
}

.dimension-item p {
  margin: 8px 0 0;
  color: #4f5d59;
  font-size: 13px;
  line-height: 1.7;
}

.status-tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: #405d6e;
  font-size: 11px;
  font-weight: 800;
}

.status-tag.strong {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-tag.revisit {
  background: var(--amber-soft);
  color: #8a4c1e;
}

.chain-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.chain-title span {
  color: var(--muted);
  font-size: 11px;
}

.reasoning-chain {
  margin-top: 12px;
}

.chain-node {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.chain-node span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chain-node p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.65;
}

.inference-node {
  border-color: #d9b796;
  background: #fffaf5;
}

.inference-node span {
  color: var(--amber);
}

.chain-arrow {
  height: 22px;
  color: #90a09a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.alternatives-section {
  margin-top: 17px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.alternatives-section ul {
  margin: 9px 0 0;
  padding-left: 18px;
}

.alternatives-section li {
  margin-top: 6px;
  color: #4f5d59;
  font-size: 13px;
  line-height: 1.65;
}

.next-focus {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-left: 3px solid #8499a5;
  background: var(--blue-soft);
  color: #3f555f;
  font-size: 13px;
  line-height: 1.65;
}

.full-button {
  width: 100%;
  margin-top: 14px;
}

.method-strip {
  margin: 18px 0 28px;
  padding: 19px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  background: #fff;
}

.method-strip div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.method-strip span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.method-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.method-strip strong {
  color: var(--ink);
}

.icp-footer {
  min-height: 68px;
  padding: 18px clamp(18px, 4vw, 60px);
  border-top: 1px solid var(--line);
  background: #fff;
  color: #75807d;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 12px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.icp-footer a {
  color: #75807d;
  text-decoration: none;
}

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

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

@media (max-width: 980px) {
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .practice-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .feedback-empty {
    min-height: 260px;
  }

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

@media (max-width: 680px) {
  .brand-strip {
    padding: 10px 16px;
  }

  .brand-link span {
    max-width: 170px;
  }

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

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

  .shell {
    width: 100%;
    margin-top: 0;
  }

  .workspace {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    min-height: auto;
    padding: 22px 18px 18px;
    display: block;
  }

  h1 {
    font-size: 25px;
  }

  .case-controls {
    margin-top: 18px;
    flex-wrap: wrap;
  }

  .difficulty-bar {
    padding: 13px 18px;
    display: block;
  }

  .difficulty-selector {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .difficulty-bar p {
    margin-top: 9px;
  }

  .scope-note {
    padding: 11px 18px;
    display: block;
    line-height: 1.6;
  }

  .scope-note span {
    display: block;
  }

  .case-section,
  .practice-panel,
  .feedback-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  blockquote {
    font-size: 17px;
    line-height: 1.72;
  }

  body[data-difficulty="advanced"] blockquote {
    font-size: 16px;
    line-height: 1.75;
  }

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

  .button-row button {
    width: 100%;
  }

  .method-strip {
    margin: 0;
    padding: 18px;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .icp-footer,
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

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