:root {
  --bg: #f7fbfa;
  --panel: #ffffff;
  --panel-strong: #eef8f4;
  --text: #17332d;
  --muted: #5d706a;
  --line: #d8e7e2;
  --accent: #087f5b;
  --accent-2: #0f9f95;
  --accent-soft: #dff5ee;
  --warn: #b54708;
  --code: #20312d;
  --shadow: 0 12px 32px rgba(15, 61, 51, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(8, 127, 91, 0.08), transparent 280px),
    var(--bg);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(247, 251, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions,
.button-row,
.section-title,
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: 0.18s ease;
}

.primary-button {
  padding: 0 15px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(8, 127, 91, 0.22);
}

.primary-button:hover {
  background: #066b4d;
}

.ghost-button {
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.text-button {
  min-height: auto;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 48px) 48px;
}

.sidebar {
  position: sticky;
  top: 98px;
  align-self: start;
}

.nav-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--accent-soft);
}

.progress-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.progress-panel {
  margin-top: 14px;
  padding: 16px;
}

.progress-row {
  justify-content: space-between;
}

.progress-track {
  height: 10px;
  margin: 12px 0;
  overflow: hidden;
  background: #e8f0ed;
  border-radius: 99px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

#progressHint,
.section-note,
.muted {
  color: var(--muted);
}

.content-area {
  min-width: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 20px;
}

.intro-panel {
  background:
    linear-gradient(135deg, rgba(8, 127, 91, 0.1), transparent 45%),
    var(--panel);
}

.panel-heading {
  margin-bottom: 14px;
}

.panel h2,
.panel h3,
.section-title h2 {
  margin: 0;
}

.panel h2,
.section-title h2 {
  font-size: clamp(20px, 2vw, 26px);
}

.panel h3 {
  font-size: 18px;
}

.rank-list,
.link-grid,
.materials-grid {
  display: grid;
  gap: 10px;
}

.rank-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.rank-list span,
.link-grid a,
.material-card {
  padding: 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.timer {
  margin: 12px 0 16px;
  font-size: clamp(42px, 8vw, 68px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.task-list,
.day-grid,
.cheat-grid,
.template-list,
.practice-list,
.audit-grid,
.warning-list {
  display: grid;
  gap: 14px;
}

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

.day-card,
.cheat-card,
.template-card,
.practice-card,
.audit-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.day-card header,
.template-card header,
.practice-card header,
.audit-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.compact-list {
  margin: 0;
  padding-left: 20px;
}

.compact-list li + li {
  margin-top: 8px;
}

.checklist {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
}

.check-item input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.check-item.done {
  color: var(--text);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(440px, 100%);
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

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

.audit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.cheat-card h3,
.template-card h3,
.practice-card h3,
.audit-card h3 {
  margin: 0 0 10px;
}

.audit-card ul,
.cheat-card ul,
.template-card ul {
  margin: 0;
  padding-left: 19px;
}

.audit-card li + li,
.cheat-card li + li,
.template-card li + li {
  margin-top: 7px;
}

.warning-item {
  padding: 13px 14px;
  background: #fff8ed;
  border: 1px solid #f4d7ad;
  border-radius: 7px;
  color: var(--warn);
}

pre {
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  color: #f4fffb;
  background: var(--code);
  border-radius: 7px;
  line-height: 1.55;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.answer {
  display: none;
  margin-top: 14px;
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.answers-visible .answer {
  display: block;
}

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

.material-card {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.material-card strong {
  font-size: 15px;
}

.material-card span {
  color: var(--muted);
  font-size: 13px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: #fff;
}

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

th {
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.deploy-panel {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
  }

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

  .nav-item {
    text-align: center;
  }

  .dashboard-grid,
  .day-grid,
  .cheat-grid,
  .audit-grid,
  .materials-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .topbar,
  .section-title,
  .top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .panel,
  .day-card,
  .cheat-card,
  .template-card,
  .practice-card {
    padding: 16px;
  }

  .rank-list {
    grid-template-columns: 1fr;
  }
}
