:root {
  color-scheme: light;
  --cream: #eedcc3;
  --milk: #f5e6d0;
  --paper: rgba(248, 234, 214, 0.94);
  --ink: #332015;
  --muted: #67503d;
  --line: rgba(89, 54, 31, 0.24);
  --brown: #4a2f1e;
  --accent: #c07a54;
  --blue: rgba(185, 215, 223, 0.3);
  --green: rgba(170, 196, 167, 0.24);
  --shadow: 0 28px 80px rgba(73, 43, 22, 0.18);
  --soft-shadow: 0 16px 44px rgba(73, 43, 22, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --cream: #17120f;
  --milk: #201711;
  --paper: rgba(42, 32, 25, 0.88);
  --ink: #f2e5d2;
  --muted: #c6ad94;
  --line: rgba(240, 222, 196, 0.16);
  --brown: #130d0a;
  --accent: #d79472;
  --blue: rgba(142, 180, 189, 0.16);
  --green: rgba(147, 170, 143, 0.14);
  --shadow: 0 32px 86px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

#practiceApp[hidden],
.password-gate[hidden],
.problem-visual[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(120deg, rgba(246, 229, 205, 0.9), rgba(232, 207, 175, 0.7)),
    url("/assets/cream-living-room.jpg") center top / cover fixed;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

[data-theme="dark"] body {
  background:
    linear-gradient(120deg, rgba(19, 13, 10, 0.92), rgba(31, 23, 18, 0.82)),
    url("/assets/cream-living-room.jpg") center top / cover fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(120deg, rgba(246, 229, 205, 0.9), rgba(185, 215, 223, 0.2), rgba(216, 193, 160, 0.48)),
    url("/assets/cream-living-room.jpg") center / cover;
}

[data-theme="dark"] .password-gate {
  background:
    linear-gradient(120deg, rgba(19, 13, 10, 0.92), rgba(142, 180, 189, 0.14), rgba(147, 170, 143, 0.12)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.password-gate.is-unlocked {
  display: none;
}

.gate-card {
  width: min(100%, 480px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 42px);
  background:
    linear-gradient(135deg, var(--paper), rgba(239, 216, 187, 0.82)),
    url("/assets/cream-living-room.jpg") center / cover;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .gate-card {
  background:
    linear-gradient(135deg, rgba(42, 32, 25, 0.92), rgba(31, 23, 18, 0.78)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.gate-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
}

.gate-card p {
  color: var(--muted);
}

.gate-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 20px;
}

.gate-card button {
  min-height: 44px;
  padding: 0 14px;
}

#passwordMessage {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 800;
}

.practice-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(248, 235, 216, 0.95), rgba(231, 207, 175, 0.9)),
    url("/assets/cream-living-room.jpg") center 18% / cover;
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .practice-header {
  background:
    linear-gradient(90deg, rgba(18, 13, 10, 0.92), rgba(42, 32, 25, 0.86)),
    url("/assets/cream-living-room.jpg") center 18% / cover;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.78), rgba(222, 197, 164, 0.52)),
    url("/assets/cream-living-room.jpg") center / cover;
  color: var(--brown);
  box-shadow: var(--soft-shadow);
}

.nav-links {
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-weight: 800;
}

.nav-links a:hover {
  color: var(--accent);
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle span {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 7px -2px 0 currentColor;
}

[data-theme="dark"] .theme-toggle span {
  box-shadow: inset 0 0 0 currentColor;
}

.practice-shell {
  padding: clamp(28px, 5vw, 64px) clamp(18px, 5vw, 72px) 72px;
}

.practice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(105deg, rgba(248, 233, 212, 0.95), rgba(200, 221, 223, 0.46) 52%, rgba(207, 216, 190, 0.4)),
    url("/assets/cream-living-room.jpg") center / cover;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .practice-hero {
  background:
    linear-gradient(105deg, rgba(19, 13, 10, 0.9), rgba(142, 180, 189, 0.14) 48%, rgba(147, 170, 143, 0.12)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(3.4rem, 11vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
}

.stats-panel,
.toolbar,
.problem-list,
.problem-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--paper), rgba(237, 216, 188, 0.84)),
    url("/assets/cream-living-room.jpg") center / cover;
  box-shadow: var(--soft-shadow);
}

[data-theme="dark"] .stats-panel,
[data-theme="dark"] .toolbar,
[data-theme="dark"] .problem-list,
[data-theme="dark"] .problem-detail {
  background:
    linear-gradient(135deg, rgba(42, 32, 25, 0.92), rgba(31, 23, 18, 0.76)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.stats-panel {
  padding: 18px;
}

.stats-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stats-panel strong {
  display: block;
  margin: 8px 0 14px;
  font-size: 2.2rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(74, 47, 30, 0.14);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(74, 47, 30, 0.92), rgba(185, 215, 223, 0.74), rgba(170, 196, 167, 0.72)),
    url("/assets/lakeside-greenery.jpg") center / cover;
  transition: width 180ms ease;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(220px, 1fr) repeat(3, minmax(140px, 0.25fr));
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
}

.toolbar label,
.editor-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 238, 220, 0.94);
  color: var(--ink);
  outline: none;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(19, 13, 10, 0.58);
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
  font-size: 1rem;
  font-weight: 750;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 122, 84, 0.16);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace > *,
.practice-hero > *,
.toolbar > *,
.io-grid > *,
.detail-top > * {
  min-width: 0;
}

.problem-list {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 14px;
}

.list-heading,
.detail-top,
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.official-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background:
    linear-gradient(135deg, rgba(248, 235, 216, 0.94), rgba(195, 220, 224, 0.42)),
    url("/assets/lakeside-greenery.jpg") center / cover;
  color: var(--ink);
  font-weight: 900;
}

[data-theme="dark"] .official-link {
  background:
    linear-gradient(135deg, rgba(42, 32, 25, 0.88), rgba(142, 180, 189, 0.14)),
    url("/assets/lakeside-greenery.jpg") center / cover;
}

.list-heading {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(74, 47, 30, 0.94), rgba(109, 68, 42, 0.9)),
    url("/assets/cream-living-room.jpg") center / cover;
  color: #fffaf1;
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  filter: brightness(1.04);
}

#clearFilters {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.problem-item {
  width: 100%;
  margin-bottom: 10px;
  padding: 14px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(249, 237, 219, 0.96), rgba(234, 213, 185, 0.88)),
    url("/assets/plant-workspace.jpg") center / cover;
  color: var(--ink);
}

[data-theme="dark"] .problem-item {
  background:
    linear-gradient(135deg, rgba(42, 32, 25, 0.92), rgba(31, 23, 18, 0.76)),
    url("/assets/plant-workspace.jpg") center / cover;
}

.problem-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 122, 84, 0.18);
}

.problem-item.done .problem-name::after {
  content: " done";
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.problem-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.problem-name {
  display: block;
  min-width: 0;
  margin: 0;
  flex: 1;
  font-size: 1.1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.problem-list-category {
  display: inline-flex;
  max-width: 48%;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(106, 154, 172, 0.72);
  border-radius: 6px;
  padding: 6px 10px;
  background:
    linear-gradient(135deg, rgba(255, 252, 246, 0.98), rgba(214, 235, 238, 0.94), rgba(215, 232, 214, 0.92)),
    url("/assets/warm-water-garden.jpg") center / cover;
  color: #3d291d;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  box-shadow:
    0 9px 22px rgba(73, 43, 22, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.66);
}

[data-theme="dark"] .problem-list-category {
  border-color: rgba(142, 190, 203, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 249, 239, 0.96), rgba(199, 224, 230, 0.92), rgba(202, 222, 201, 0.9)),
    url("/assets/warm-water-garden.jpg") center / cover;
  color: #352319;
}

.problem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  border: 1px solid rgba(255, 248, 237, 0.24);
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff8ed;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  box-shadow: 0 4px 10px rgba(55, 35, 24, 0.14);
}

.chip-collection {
  background:
    linear-gradient(135deg, rgba(72, 43, 27, 0.94), rgba(112, 73, 48, 0.9)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.chip-difficulty.difficulty-easy {
  background:
    linear-gradient(135deg, rgba(48, 81, 70, 0.94), rgba(79, 116, 101, 0.9)),
    url("/assets/plant-workspace.jpg") center / cover;
}

.chip-difficulty.difficulty-medium,
.chip-topic.tone-0 {
  background:
    linear-gradient(135deg, rgba(43, 78, 94, 0.96), rgba(66, 111, 128, 0.9)),
    url("/assets/lakeside-greenery.jpg") center / cover;
}

.chip-difficulty.difficulty-hard,
.chip-topic.tone-2 {
  background:
    linear-gradient(135deg, rgba(111, 56, 38, 0.96), rgba(151, 79, 55, 0.9)),
    url("/assets/warm-water-garden.jpg") center / cover;
}

.chip-topic.tone-1 {
  background:
    linear-gradient(135deg, rgba(46, 78, 65, 0.96), rgba(76, 116, 94, 0.9)),
    url("/assets/plant-workspace.jpg") center / cover;
}

.chip-difficulty.difficulty-neutral {
  background:
    linear-gradient(135deg, rgba(74, 51, 38, 0.94), rgba(113, 82, 61, 0.9)),
    url("/assets/cream-living-room.jpg") center / cover;
}

[data-theme="dark"] .chip {
  border-color: rgba(255, 248, 237, 0.28);
  color: #fff8ed;
}

[data-theme="dark"] .chip-collection {
  background:
    linear-gradient(135deg, rgba(48, 29, 19, 0.97), rgba(96, 61, 39, 0.94)),
    url("/assets/cream-living-room.jpg") center / cover;
}

[data-theme="dark"] .chip-difficulty.difficulty-easy,
[data-theme="dark"] .chip-topic.tone-1 {
  background:
    linear-gradient(135deg, rgba(31, 57, 48, 0.98), rgba(64, 101, 83, 0.94)),
    url("/assets/plant-workspace.jpg") center / cover;
}

[data-theme="dark"] .chip-difficulty.difficulty-medium,
[data-theme="dark"] .chip-topic.tone-0 {
  background:
    linear-gradient(135deg, rgba(29, 57, 69, 0.98), rgba(53, 93, 109, 0.94)),
    url("/assets/lakeside-greenery.jpg") center / cover;
}

[data-theme="dark"] .chip-difficulty.difficulty-hard,
[data-theme="dark"] .chip-topic.tone-2 {
  background:
    linear-gradient(135deg, rgba(78, 39, 27, 0.98), rgba(124, 65, 44, 0.94)),
    url("/assets/warm-water-garden.jpg") center / cover;
}

.problem-detail {
  min-height: 720px;
  padding: clamp(18px, 3vw, 28px);
}

.problem-detail h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.problem-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
}

.problem-title-row h2 {
  min-width: 0;
}

.problem-category {
  display: inline-flex;
  min-height: 46px;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(74, 47, 30, 0.32);
  border-radius: 8px;
  padding: 7px 14px;
  background:
    linear-gradient(135deg, rgba(74, 47, 30, 0.9), rgba(106, 154, 172, 0.64), rgba(169, 200, 189, 0.68)),
    url("/assets/warm-water-garden.jpg") center / cover;
  color: #fffaf1;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 24px rgba(73, 43, 22, 0.15);
}

[data-theme="dark"] .problem-category {
  border-color: rgba(242, 229, 210, 0.2);
  background:
    linear-gradient(135deg, rgba(16, 11, 9, 0.92), rgba(74, 47, 30, 0.86), rgba(75, 106, 100, 0.58)),
    url("/assets/warm-water-garden.jpg") center / cover;
  color: #f2e5d2;
}

.done-button {
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
}

.done-button.is-done {
  background:
    linear-gradient(135deg, rgba(170, 196, 167, 0.86), rgba(185, 215, 223, 0.72)),
    url("/assets/lakeside-greenery.jpg") center / cover;
  color: var(--brown);
}

.problem-description {
  margin: 22px 0;
  color: var(--muted);
  font-size: 1.07rem;
  font-weight: 520;
}

.problem-visual {
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(248, 235, 216, 0.94), rgba(195, 219, 223, 0.38), rgba(200, 214, 190, 0.32)),
    url("/assets/warm-water-garden.jpg") center / cover;
  box-shadow: var(--soft-shadow);
}

[data-theme="dark"] .problem-visual {
  background:
    linear-gradient(135deg, rgba(21, 15, 12, 0.92), rgba(44, 34, 27, 0.84), rgba(64, 82, 72, 0.18)),
    url("/assets/warm-water-garden.jpg") center / cover;
}

#visualCanvas {
  width: 100%;
  aspect-ratio: 18 / 7;
  min-height: 220px;
  max-height: 360px;
  padding: 10px;
}

#visualCanvas svg {
  display: block;
  width: 100%;
  height: 100%;
}

.problem-visual figcaption {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.visual-axis,
.visual-edge {
  stroke: var(--brown);
  stroke-width: 3;
  fill: none;
}

[data-theme="dark"] .visual-axis,
[data-theme="dark"] .visual-edge {
  stroke: #d8bea3;
}

.visual-arrow-head {
  fill: var(--brown);
}

[data-theme="dark"] .visual-arrow-head {
  fill: #d8bea3;
}

.visual-bar,
.visual-node-box,
.visual-tree-node,
.visual-cell,
.visual-phone-key {
  fill: #d8b48d;
  stroke: #62412b;
  stroke-width: 2;
}

.visual-bar.active,
.visual-node-box.active,
.visual-node-box.target,
.visual-tree-node.active,
.visual-cell.target,
.visual-cell.queen,
.visual-cell.source {
  fill: #a9c8bd;
  stroke: #496f68;
}

.visual-tree-node.invalid,
.visual-cell.marked,
.visual-node-box.removed {
  fill: #cf9279;
  stroke: #74402f;
}

.visual-water {
  fill: rgba(132, 193, 214, 0.58);
}

.visual-water.container-water {
  stroke: rgba(73, 122, 139, 0.68);
  stroke-width: 2;
}

.visual-rectangle {
  fill: rgba(148, 196, 179, 0.32);
  stroke: #56796e;
  stroke-width: 3;
  stroke-dasharray: 8 6;
}

.visual-path,
.visual-random,
.visual-guide,
.visual-remove {
  fill: none;
  stroke: #6a9aac;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visual-random {
  stroke-dasharray: 7 6;
}

.visual-guide,
.visual-remove {
  stroke: #9e5c45;
  stroke-width: 3;
}

.visual-label,
.visual-cell-text,
.visual-node-text,
.visual-order-text,
.visual-sequence,
.visual-phone-digit,
.visual-phone-letters {
  fill: #3a2618;
  text-anchor: middle;
  font-family: "Cascadia Code", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 800;
}

[data-theme="dark"] .visual-label,
[data-theme="dark"] .visual-cell-text,
[data-theme="dark"] .visual-node-text,
[data-theme="dark"] .visual-order-text,
[data-theme="dark"] .visual-sequence,
[data-theme="dark"] .visual-phone-digit,
[data-theme="dark"] .visual-phone-letters {
  fill: #f2e5d2;
}

.visual-phone-digit {
  font-size: 34px;
}

.visual-order-badge {
  fill: #6a9aac;
  stroke: #fffaf1;
  stroke-width: 2;
}

.visual-order-text {
  fill: #fffaf1;
  font-size: 11px;
}

.visual-sequence {
  font-size: 13px;
}

.visual-level-guide {
  stroke: rgba(106, 154, 172, 0.32);
  stroke-width: 10;
  stroke-linecap: round;
}

.visual-phone-letters {
  font-size: 18px;
  letter-spacing: 0;
}

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

.io-grid section,
.hint-box,
.interview-box,
.solution-box,
.methods-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(249, 237, 220, 0.94), rgba(213, 222, 210, 0.72)),
    url("/assets/cream-living-room.jpg") center / cover;
}

[data-theme="dark"] .io-grid section,
[data-theme="dark"] .hint-box,
[data-theme="dark"] .interview-box,
[data-theme="dark"] .solution-box,
[data-theme="dark"] .methods-box {
  background:
    linear-gradient(135deg, rgba(19, 13, 10, 0.68), rgba(42, 32, 25, 0.72)),
    url("/assets/cream-living-room.jpg") center / cover;
}

.io-grid h3 {
  margin: 0;
  padding: 12px 14px 0;
  font-size: 0.9rem;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: var(--ink);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.hint-box,
.interview-box,
.solution-box,
.methods-box {
  margin-top: 14px;
  padding: 14px;
}

.interview-box {
  background:
    linear-gradient(135deg, rgba(249, 236, 217, 0.95), rgba(194, 219, 223, 0.42), rgba(201, 215, 191, 0.34)),
    url("/assets/warm-water-garden.jpg") center / cover;
}

[data-theme="dark"] .interview-box {
  background:
    linear-gradient(135deg, rgba(25, 18, 14, 0.86), rgba(59, 44, 32, 0.72), rgba(107, 132, 111, 0.14)),
    url("/assets/warm-water-garden.jpg") center / cover;
}

.methods-box {
  background:
    linear-gradient(135deg, rgba(248, 234, 214, 0.95), rgba(199, 214, 190, 0.42)),
    url("/assets/plant-workspace.jpg") center / cover;
}

[data-theme="dark"] .methods-box {
  background:
    linear-gradient(135deg, rgba(42, 32, 25, 0.9), rgba(147, 170, 143, 0.12)),
    url("/assets/plant-workspace.jpg") center / cover;
}

.methods-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.methods-heading h3 {
  margin: 0;
}

.methods-heading select {
  max-width: 260px;
}

#methodIdea {
  color: var(--muted);
}

summary {
  cursor: pointer;
  font-weight: 900;
}

.hint-box p,
.interview-box ul {
  margin: 12px 0 0;
  color: var(--muted);
}

.interview-box ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.research-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(248, 235, 216, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

[data-theme="dark"] .research-line {
  background: rgba(19, 13, 10, 0.54);
}

.research-line a {
  color: var(--accent);
  font-weight: 900;
}

.interview-box li::marker {
  color: var(--blue);
}

.editor-label {
  margin-top: 18px;
}

.editor-label small {
  color: var(--muted);
  font-weight: 700;
}

textarea {
  min-height: 390px;
  margin-top: 10px;
  padding: 16px;
  resize: vertical;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.summary-editor {
  min-height: 120px;
}

.editor-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.editor-actions button {
  min-height: 40px;
  padding: 0 14px;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .practice-header {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .practice-hero,
  .toolbar,
  .workspace,
  .io-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .problem-list,
  .problem-detail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .problem-list {
    position: static;
    max-height: none;
  }
}

@media (max-width: 540px) {
  .problem-title-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .detail-top,
  .editor-actions,
  .gate-card form,
  .methods-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .done-button,
  .editor-actions button,
  .official-link,
  .gate-card button,
  .methods-heading select {
    width: 100%;
  }
}
