:root {
  --paper: #f6f0e6;
  --paper-2: #fffaf3;
  --desk: #e6dccb;
  --ink: #241c16;
  --soft: #6d6258;
  --line: #e3d6c4;
  --seal: #a33b32;
  --seal-soft: #f8ebe7;
  --moss: #2d6a4f;
  --moss-soft: #e7f2eb;
  --wait: #8a5a12;
  --wait-soft: #f8efd8;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--desk);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.shell {
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
}
.view { padding: 22px 20px 108px; }
.kicker {
  margin: 0 0 4px;
  color: var(--seal);
  font-size: 13px;
  letter-spacing: 0.08em;
}
h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
.lead { margin: 8px 0 0; color: var(--soft); }
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.top h1 { font-size: 28px; }
.date { margin: 2px 0 0; color: var(--soft); font-size: 14px; }
.panel, .card, .auth-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.auth-card { padding: 16px; margin-top: 22px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
}
.btn, .nav button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fffaf3;
}
.btn.secondary, .nav button { background: transparent; color: var(--ink); }
.btn.seal { background: var(--seal); }
.btn.ghost, .text-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.45; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.linkish {
  border: 0;
  background: transparent;
  color: var(--seal);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gap {
  padding: 14px 14px 8px;
  margin-bottom: 14px;
}
.gap ul { list-style: none; padding: 0; margin: 8px 0 0; }
.gap li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.gap li strong { font-weight: 600; }
.gap li.done strong { color: var(--moss); }
.gap li.block { display: block; }
.gap li.block strong { display: block; text-align: left; font-size: 14px; font-weight: 600; }
.subject {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.subject small { display: block; color: var(--soft); margin-top: 2px; }
.mark {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--soft);
}
.mark.done { color: var(--seal); transform: rotate(-8deg); background: var(--seal-soft); }
.mark.wait { color: var(--wait); border-style: dashed; background: var(--wait-soft); }
.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 240, 230, 0.96);
  border-top: 1px solid var(--line);
}
.nav button { border-radius: 12px; padding: 8px 0; font-size: 14px; position: relative; }
.nav button.active { background: var(--ink); color: #fffaf3; }
.dot {
  position: absolute;
  top: 4px;
  right: 18px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--seal);
  color: white;
  font-size: 11px;
  line-height: 16px;
}
.seg { display: flex; padding: 4px; background: #efe6d8; border-radius: 999px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px; }
.seg button.active { background: var(--paper-2); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person { padding: 12px; }
.person h2 { margin: 0 0 8px; font-size: 18px; }
.person p { margin: 0 0 8px; color: var(--soft); }
.person li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; }
.person ul { list-style: none; margin: 0; padding: 0; }
.section-title { margin: 18px 0 8px; font-size: 15px; }
.entry, .award, .setting {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.entry div, .award div { min-width: 0; }
.muted { color: var(--soft); font-size: 13px; }
.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--wait-soft);
  color: var(--wait);
  font-size: 12px;
}
.tag.ok { background: var(--moss-soft); color: var(--moss); }
.weeks { width: 100%; border-collapse: collapse; font-size: 14px; }
.weeks th, .weeks td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.weeks td:not(:first-child), .weeks th:not(:first-child) { text-align: right; }
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(36, 28, 22, 0.28);
  display: grid;
  place-items: end center;
}
.modal {
  width: min(440px, 100%);
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  width: min(400px, calc(100% - 32px));
  margin: 0;
  padding: 10px 12px;
  background: var(--ink);
  color: #fffaf3;
  border-radius: 12px;
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button, .mini {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  min-width: 36px;
  height: 36px;
}
.locked {
  padding: 28px 8px;
  text-align: center;
}
h2 { font-size: 18px; font-weight: 650; }
.off { opacity: 0.55; }
