/* ─────────────────────────────────────────────────────
   MBA 每日打卡 — Premium Minimal Design
   ───────────────────────────────────────────────────── */

:root {
  --bg:           #EAE5DC;
  --surface:      #FFFFFF;
  --surface-2:    #F8F5F1;
  --ink:          #1A1714;
  --ink-2:        #6A6258;
  --ink-3:        #A29890;
  --border:       #DDD6CA;
  --border-light: #ECE8E1;
  --accent:       #B53B2C;
  --accent-pale:  #FEF2EF;
  --accent-mid:   rgba(181, 59, 44, 0.15);
  --ok:           #2D7A32;
  --ok-pale:      #ECF7ED;
  --radius:       18px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.07);
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.05);
}

/* ── Reset ─────────────────────────────────────────── */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

/* ── Base ──────────────────────────────────────────── */

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #F4F0E8 0%, #E2DDD4 100%);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

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

h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.subtext {
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Layout ────────────────────────────────────────── */

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

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

.login-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Header ────────────────────────────────────────── */

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-pale);
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 10px;
}

.hero-account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.hero-account .auth-user {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Panels ────────────────────────────────────────── */

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

.login-panel {
  width: min(500px, 100%);
  padding: 36px 32px 32px;
}

/* ── Login page brand block ─────────────────────────── */

.login-brand {
  margin-bottom: 28px;
}

.login-title {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 8px 0 6px;
}

.login-desc {
  font-size: 14px;
  color: var(--ink-2);
}

/* ── Auth steps ─────────────────────────────────────── */

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-step-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.auth-sep {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

/* ── Nav ────────────────────────────────────────────── */

.nav-panel {
  padding: 10px;
  height: fit-content;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.13s ease, color 0.13s ease;
}

.nav-btn:hover:not(.is-active) {
  background: var(--surface-2);
  color: var(--ink);
  transform: none;
}

.nav-btn.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ── Panel header ──────────────────────────────────── */

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

/* ── Buttons ────────────────────────────────────────── */

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

button:hover { transform: translateY(-1px); }

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.ghost-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
}

.ghost-btn:hover { background: var(--border-light); }

.quick-btn {
  background: var(--accent-pale);
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  font-weight: 500;
}

/* ── Today status card ─────────────────────────────── */

.today-status-card {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
}

.today-status-label {
  margin: 0 0 4px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-complete-state {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.today-complete-state.pending { color: var(--accent); }
.today-complete-state.done    { color: var(--ok); }

.today-status-detail {
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Assignment card ───────────────────────────────── */

.assignment-card {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
}

.assignment-top,
.assignment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.assignment-top { margin-bottom: 12px; }

.assignment-label {
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assignment-top h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.subject-pill {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent-pale);
  border: 1px solid var(--accent-mid);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.assignment-meta {
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 13px;
  gap: 6px;
}

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

.assignment-body > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
}

.assignment-body strong,
.assignment-start strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assignment-body ul {
  margin: 0;
  padding-left: 17px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.assignment-body li + li { margin-top: 5px; }

.assignment-start {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
}

.assignment-start p {
  color: var(--ink-2);
  font-size: 13.5px;
}

/* ── Auth card ──────────────────────────────────────── */

.auth-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-card {
  margin-top: 0;
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.auth-actions { margin-top: 2px; }

.auth-user {
  font-size: 13px;
  color: var(--ink-2);
}

/* ── Status / hints ─────────────────────────────────── */

.status,
.hint,
.empty-state {
  color: var(--ink-2);
  font-size: 14px;
}

.status { min-height: 22px; }

/* ── Form ───────────────────────────────────────────── */

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

label span {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 59, 44, 0.09);
}

input[readonly] {
  color: var(--ink-2);
  background: var(--bg);
  border-color: var(--border-light);
}

textarea { resize: vertical; }

.full { width: 100%; }

.form-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Stats grid ─────────────────────────────────────── */

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

.stats-grid article {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}

.stats-grid span {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stats-grid strong {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ── Records ────────────────────────────────────────── */

.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  transition: box-shadow 0.14s ease;
}

.record-card:hover { box-shadow: var(--shadow-sm); }

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  align-items: flex-start;
}

.record-title {
  font-weight: 700;
  font-size: 14px;
}

.record-meta { color: var(--ink-2); font-size: 13px; }

.record-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--border-light);
  color: var(--ink-2);
  flex-shrink: 0;
}

.record-badge.done {
  background: var(--ok-pale);
  color: var(--ok);
}

.record-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.empty-state {
  padding: 24px 0;
  text-align: center;
  color: var(--ink-3);
}

/* ── Stats enhancements ─────────────────────────────── */

.stats-section-label {
  margin: 22px 0 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.stats-grid--summary article {
  background: var(--accent-pale);
  border-color: var(--accent-mid);
}

.stats-grid--summary strong {
  color: var(--accent);
  font-size: 1.45rem;
}

.overall-progress-wrap {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}

.overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--ink-2);
}

.progress-pct-label {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.025em;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

.progress-note {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  text-align: center;
}

.subject-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subject-row {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.13s ease;
}

.subject-row:hover { box-shadow: var(--shadow-sm); }

.subject-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.subject-row-name {
  font-weight: 700;
  font-size: 14px;
}

.subject-row-stats {
  font-size: 13px;
  color: var(--ink-2);
}

.subject-mini-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
  margin-bottom: 6px;
}

.subject-mini-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.85;
}

.subject-row-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 920px) {
  .hero,
  .app-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero { align-items: center; }

  .nav-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 640px) {
  .page { padding: 16px 14px 32px; }

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

  .auth-row { grid-template-columns: 1fr; }

  .assignment-body { grid-template-columns: 1fr; }

  .stats-grid--summary { grid-template-columns: 1fr; }

  h1 {
    font-size: 2rem;
    line-height: 1.05;
  }
}
