:root {
  --ink: #26314f;
  --muted: #64708d;
  --paper: #fffaf1;
  --panel: #ffffff;
  --blue: #3156d4;
  --red: #ef6f6c;
  --green: #159a73;
  --yellow: #f6c85f;
  --line: #e7dfd1;
  --shadow: 0 18px 45px rgba(38, 49, 79, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 200, 95, 0.34), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(49, 86, 212, 0.16), transparent 26%),
    linear-gradient(135deg, #fff7e4 0%, #f7fbff 48%, #fff1ef 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 22px;
  min-height: 100vh;
  padding: 22px;
}

.sidebar,
.workspace,
.question-card,
.coach-card,
.routine-panel article {
  border: 2px solid rgba(38, 49, 79, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 44px);
  padding: 18px;
  overflow: auto;
  border-radius: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: #ffe39a;
  border: 2px solid #26314f;
  transform: rotate(-4deg);
}

.brand-mark span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: var(--ink);
}

.brand-mark span:nth-child(1) {
  left: 13px;
  top: 19px;
  width: 8px;
  height: 8px;
}

.brand-mark span:nth-child(2) {
  right: 13px;
  top: 19px;
  width: 8px;
  height: 8px;
}

.brand-mark span:nth-child(3) {
  left: 16px;
  bottom: 15px;
  width: 26px;
  height: 4px;
  background: var(--red);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.45;
}

h4 {
  margin-bottom: 12px;
  font-size: 20px;
}

.goal-card {
  padding: 16px;
  border-radius: 18px;
  background: #26314f;
  color: white;
}

.goal-card p {
  margin-bottom: 6px;
  color: #ffe39a;
  font-weight: 700;
}

.goal-card strong {
  display: block;
  font-size: 21px;
  line-height: 1.35;
}

.day-nav {
  display: grid;
  gap: 9px;
}

.day-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 9px 12px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fff7e8;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.day-button small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.day-button.active {
  border-color: var(--blue);
  background: #eef3ff;
}

.workspace {
  min-width: 0;
  padding: 24px;
  border-radius: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.progress-box {
  width: 172px;
  padding: 14px;
  border-radius: 18px;
  background: #fff7e8;
}

.progress-box span {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfcb;
}

.progress-track div {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 180ms ease;
}

.routine-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.routine-panel article {
  display: flex;
  gap: 12px;
  min-height: 106px;
  padding: 16px;
  border-radius: 18px;
  box-shadow: none;
}

.routine-panel span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

.routine-panel strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.routine-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.practice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: stretch;
}

.question-card,
.coach-card {
  border-radius: 24px;
}

.question-card {
  min-width: 0;
  padding: 22px;
}

.question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 126px;
}

.question-head h3 {
  font-size: 26px;
  line-height: 1.5;
}

.soft-button,
.answer-button,
.question-switcher button,
.tool-buttons button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.soft-button.done {
  background: var(--green);
}

.thinking-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.tab-button {
  height: 52px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffaf1;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.tab-button.active {
  border-color: var(--blue);
  background: #eaf0ff;
  color: var(--blue);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.prompt-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.prompt-list li,
.sentence-stack p,
.answer-box {
  border-radius: 16px;
  background: #f6fbff;
  border: 2px solid #d8e5ff;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.5;
}

textarea {
  width: 100%;
  min-height: 148px;
  resize: vertical;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  color: var(--ink);
  background: #fffefb;
  line-height: 1.6;
}

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

.tool-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-buttons button {
  min-height: 40px;
  padding-inline: 12px;
  background: #f1f4fb;
  color: var(--ink);
}

.tool-buttons .tool.active {
  outline: 3px solid rgba(49, 86, 212, 0.22);
  background: var(--blue);
  color: white;
}

canvas {
  display: block;
  width: 100%;
  height: min(48vh, 460px);
  min-height: 310px;
  border: 3px dashed #d9cdb8;
  border-radius: 20px;
  background:
    linear-gradient(#edf4ff 1px, transparent 1px),
    linear-gradient(90deg, #edf4ff 1px, transparent 1px),
    #fffefb;
  background-size: 32px 32px;
  touch-action: none;
}

.solve-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.solve-row label {
  color: var(--muted);
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffefb;
  font-size: 20px;
}

.answer-button {
  background: var(--blue);
}

.answer-box {
  margin-top: 14px;
  background: #f2fff9;
  border-color: #bfe6d8;
}

.coach-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: #fffaf1;
}

.coach-visual {
  position: relative;
  height: 132px;
  margin: -4px 0 12px;
}

.sun {
  position: absolute;
  right: 20px;
  top: 8px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--ink);
}

.pencil {
  position: absolute;
  left: 20px;
  bottom: 14px;
  width: 150px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(90deg, #ef6f6c 0 70%, #ffe39a 70% 86%, #26314f 86%);
  transform: rotate(-8deg);
}

.pencil span {
  position: absolute;
  left: 18px;
  top: 9px;
  width: 75px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.spark {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--green);
  transform: rotate(45deg);
}

.s1 {
  left: 24px;
  top: 12px;
}

.s2 {
  right: 112px;
  bottom: 26px;
  background: var(--blue);
}

.coach-card h3 {
  margin-bottom: 12px;
  font-size: 24px;
}

.sentence-stack {
  display: grid;
  gap: 10px;
}

.sentence-stack p {
  margin-bottom: 0;
  background: white;
  border-color: #efe1c6;
}

.question-switcher {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

#questionDots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #d6c8ae;
}

.dot.active {
  background: var(--red);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .day-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .day-button {
    justify-content: center;
    text-align: center;
  }

  .day-button small {
    display: none;
  }

  .practice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace,
  .question-card,
  .coach-card {
    padding: 16px;
  }

  .topbar,
  .question-head,
  .drawing-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 23px;
  }

  .routine-panel {
    grid-template-columns: 1fr;
  }

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

  .progress-box {
    width: 100%;
  }
}
