:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --ink: #172033;
  --muted: #627084;
  --line: #dbe3ea;
  --line-strong: #c4ced8;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --coral: #c2410c;
  --green: #15803d;
  --shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(37, 99, 235, 0.12)),
    #f9fbfc;
}

.brand-mark span {
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 800;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(23px, 3vw, 36px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 20px;
  letter-spacing: 0;
}

h4 {
  margin-bottom: 10px;
  font-size: 15px;
}

.top-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.small-button,
.icon-button,
.tab {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

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

.ghost-button:hover,
.small-button:hover,
.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  background: #f9fbfc;
  border-color: var(--line);
  color: var(--ink);
  font-size: 13px;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: #f9fbfc;
  border-color: var(--line);
  color: var(--ink);
  font-size: 18px;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tab {
  background: transparent;
  color: var(--muted);
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.date-control,
.day-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-control label,
.day-switcher label,
.form-grid span,
.review-panel span,
.idea-card-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  min-height: 90px;
  padding: 10px 11px;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.date-control input {
  width: 160px;
}

.date-control.compact {
  align-items: end;
  flex-direction: column;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  gap: 16px;
}

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

.focus-panel {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(37, 99, 235, 0.08)),
    var(--surface);
}

.phase-line,
.panel-heading,
.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phase-line {
  justify-content: flex-start;
  color: var(--muted);
  font-weight: 800;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.focus-panel h3 {
  margin: 28px 0 8px;
  font-size: clamp(25px, 4vw, 42px);
  letter-spacing: 0;
}

.focus-panel p,
.assignment-copy,
.muted {
  color: var(--muted);
  line-height: 1.75;
}

.progress-block {
  margin-top: 20px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

.deliverable-box {
  margin-top: 18px;
  padding: 13px;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff8ed;
}

.deliverable-box span,
.weekly-note span {
  display: block;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 5px;
}

.deliverable-box strong,
.weekly-note strong {
  line-height: 1.55;
}

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

.stat-card {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  letter-spacing: 0;
}

.checklist {
  display: grid;
  gap: 9px;
}

.action-panel {
  grid-column: 1 / -1;
}

.muted-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.action-plan-block {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-list.compact {
  gap: 8px;
}

.action-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.action-item input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--teal);
}

.action-item.is-done {
  border-color: rgba(21, 128, 61, 0.24);
  background: #f0faf4;
}

.action-main {
  min-width: 0;
}

.action-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.action-time {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.action-category {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 900;
}

.action-task {
  display: block;
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.55;
}

.action-output {
  display: block;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.check-item input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(20px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.bar {
  display: grid;
  align-items: end;
  min-height: 118px;
  gap: 6px;
}

.bar-fill {
  min-height: 6px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, var(--blue), var(--teal));
}

.bar span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.weekly-note {
  margin-top: 12px;
}

.daily-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.daily-main,
.review-panel {
  min-width: 0;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form-grid label,
.textarea-grid label,
.review-panel label,
.idea-card-form label {
  display: grid;
  gap: 6px;
}

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

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

.checkbox-block {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.checkbox-block label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-weight: 800;
}

.checkbox-block input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

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

.review-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.idea-card-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.save-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.phase-strip {
  display: grid;
  grid-template-columns: 14fr 16fr 30fr 30fr;
  gap: 10px;
  margin-bottom: 16px;
}

.phase-card {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.phase-card strong {
  display: block;
  margin-bottom: 6px;
}

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

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.plan-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
}

.plan-list-panel,
.plan-detail-panel {
  min-width: 0;
}

.plan-day-list {
  display: grid;
  gap: 8px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.plan-day-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.plan-day-button:hover {
  border-color: var(--teal);
}

.plan-day-button.is-selected {
  border-color: var(--ink);
  background: #f7fafc;
  box-shadow: inset 3px 0 0 var(--ink);
}

.plan-day-button.is-current {
  border-color: var(--blue);
}

.plan-day-button.is-done {
  background: #f0faf4;
  border-color: rgba(21, 128, 61, 0.26);
}

.plan-day-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.plan-day-copy {
  min-width: 0;
}

.plan-day-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-day-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-day-progress {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.plan-progress-card {
  min-width: 118px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: right;
}

.plan-progress-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.plan-progress-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.action-list.note-mode {
  margin-top: 16px;
}

.action-note {
  grid-column: 2;
  margin-top: 8px;
}

.action-note span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.action-note textarea {
  min-height: 82px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(42px, 1fr));
  gap: 8px;
}

.day-cell {
  position: relative;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.day-cell.is-done {
  background: #eaf8ef;
  border-color: rgba(21, 128, 61, 0.28);
  color: var(--green);
}

.day-cell.is-current {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.day-cell.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.day-detail {
  align-self: start;
  position: sticky;
  top: 16px;
}

.mini-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.map-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.resource-grid,
.prompt-grid,
.backup-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.resource-card,
.prompt-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.resource-card h3,
.prompt-card h3 {
  margin-bottom: 8px;
}

.resource-card p,
.prompt-card p {
  color: var(--muted);
  line-height: 1.7;
}

.resource-links {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.prompt-text {
  min-height: 220px;
  overflow: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #243044;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.data-preview {
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.contact-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(180, 83, 9, 0.08)),
    var(--surface);
}

.wechat-card {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #fbfffd;
}

.wechat-card span,
.feedback-preview-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.wechat-card strong {
  color: var(--teal-dark);
  font-size: 30px;
  letter-spacing: 0;
}

.feedback-form-panel {
  min-width: 0;
}

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

.feedback-full {
  grid-column: 1 / -1;
}

.feedback-consent {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.feedback-consent input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.feedback-preview {
  display: grid;
  gap: 10px;
}

.feedback-preview-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.feedback-preview-card strong {
  color: var(--ink);
}

.feedback-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1040px) {
  .dashboard-grid,
  .daily-grid,
  .map-layout,
  .plan-layout {
    grid-template-columns: 1fr;
  }

  .day-detail {
    position: static;
  }

  .plan-day-list {
    max-height: 360px;
  }

  .resource-grid,
  .prompt-grid,
  .backup-layout,
  .feedback-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1420px);
    padding-top: 10px;
  }

  .topbar,
  .section-header,
  .record-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .date-control,
  .day-switcher {
    width: 100%;
  }

  .date-control input,
  .date-control.compact input,
  .day-switcher input {
    width: 100%;
  }

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

  .hours-grid,
  .metric-grid,
  .textarea-grid,
  .feedback-grid,
  .resource-grid,
  .prompt-grid,
  .backup-layout,
  .feedback-layout {
    grid-template-columns: 1fr;
  }

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

  .phase-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 460px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

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

  .stat-grid,
  .checkbox-block {
    grid-template-columns: 1fr;
  }
}
