:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #626a73;
  --line: #dfe3e8;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --blue: #2457d6;
  --green: #147a5c;
  --amber: #a35c00;
  --shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 24px 18px;
}

.brand p,
.kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.brand h1,
#lessonTitle {
  margin: 0;
  line-height: 1.15;
}

.brand h1 {
  font-size: 30px;
}

.search {
  display: grid;
  gap: 8px;
  margin: 24px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
}

.lesson-list {
  display: grid;
  gap: 8px;
}

.lesson-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.lesson-button:hover,
.lesson-button.active {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.06);
}

.lesson-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.lesson-button span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  min-width: 0;
  width: min(1180px, 100%);
  padding: 28px;
}

.learning-home {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 14px;
  margin-bottom: 14px;
}

.start-panel,
.method-panel,
.lesson-coach article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.start-panel,
.method-panel {
  padding: 20px;
}

.start-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
}

.start-panel p,
.method-panel li {
  color: var(--muted);
  line-height: 1.7;
}

.method-panel h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.method-panel ol {
  margin: 0;
  padding-left: 22px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

#lessonTitle {
  font-size: clamp(26px, 3vw, 42px);
}

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

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.summary-grid,
.two-columns,
.lesson-coach {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.lesson-coach article {
  padding: 16px;
}

.lesson-coach span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.lesson-coach p {
  margin: 0;
  line-height: 1.7;
}

.summary-grid article,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.summary-grid article {
  padding: 16px;
}

.summary-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong {
  font-size: 28px;
}

.panel {
  margin-bottom: 14px;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.panel-title h3 {
  margin: 0;
  font-size: 20px;
}

.panel-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.steps {
  margin: 0;
  padding-left: 22px;
}

.steps li {
  margin: 10px 0;
  line-height: 1.7;
}

.function-list,
.sheet-list,
.preview-list {
  display: grid;
  gap: 10px;
}

.function,
.sheet,
.preview-sheet {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fcfdff;
}

.function strong,
.sheet strong,
.preview-sheet strong {
  display: block;
  margin-bottom: 5px;
}

.function p,
.sheet p,
.preview-sheet p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: #eef3ff;
  color: #1b2b4a;
  font-weight: 800;
}

code {
  color: var(--amber);
  font-family: "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
}

.empty {
  color: var(--muted);
  line-height: 1.6;
}

.path-list {
  display: grid;
  gap: 12px;
}

.path-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fcfdff;
}

.path-stage h4 {
  margin: 0 0 6px;
  font-size: 17px;
}

.path-stage p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.path-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.path-chip {
  border: 1px solid #cdd7e5;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f7faff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}

.path-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

@media (max-width: 860px) {
  .app,
  .summary-grid,
  .two-columns,
  .lesson-coach,
  .learning-home {
    grid-template-columns: 1fr;
  }

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

  .content {
    padding: 18px;
  }

  .toolbar,
  .panel-title {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }
}
