@font-face {
  font-family: "Source Serif 4";
  src: url("./fonts/source-serif-4.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("./fonts/source-sans-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fcfcfb;
  --sidebar: #f7f5f0;
  --surface: #fffefa;
  --raised: #f4f0e9;
  --ink: #302d29;
  --muted: #696158;
  --line: #dfd9cf;
  --line-strong: #b6aea1;
  --accent: #98452f;
  --accent-hover: #803925;
  --on-accent: #fffaf4;
  --tint: #f4e8df;
  --ok: #33573f;
  --ok-line: #77907a;
  --ok-bg: #eaf0e7;
  --bad: #882e32;
  --bad-line: #b78080;
  --bad-bg: #f7e9e6;
  --warn: #91611c;
  --plate: #efe7d8;
  --plate-ink: #665542;
  --plate-edge: #d1c5ae;
  --plate-rule: #c4b29a;
  --shadow: 0 7px 17px -11px #61482c70;
  --overlay: #28221b68;
  --image-paper: #fff;
  --serif:
    "Source Serif 4", "Songti SC", "Noto Serif CJK SC", STSong, SimSun, serif;
  --sans: "Source Sans 3", "PingFang SC", "Microsoft YaHei", sans-serif;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #242320;
    --sidebar: #1b1a18;
    --surface: #2b2926;
    --raised: #322f2a;
    --ink: #f3f0e4;
    --muted: #beb6a9;
    --line: #49443c;
    --line-strong: #71685c;
    --accent: #eea182;
    --accent-hover: #f5bda4;
    --on-accent: #281c17;
    --tint: #43302a;
    --ok: #b0d2ad;
    --ok-line: #799879;
    --ok-bg: #28362b;
    --bad: #f3aca7;
    --bad-line: #a77370;
    --bad-bg: #402c2d;
    --warn: #e3b767;
    --shadow: 0 8px 18px -9px #080705a0;
    --overlay: #0b0908a8;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection {
  background: var(--tint);
  color: var(--ink);
}
.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
#sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 32px 16px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 5;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 1px 10px 43px;
  color: var(--ink);
  text-decoration: none;
  font: 520 31px/1 var(--serif);
  letter-spacing: -0.055em;
}
.brand small {
  display: block;
  margin-top: 6px;
  font: 11px/1.2 var(--sans);
  letter-spacing: 0.14em;
  color: var(--muted);
}
.monogram {
  display: grid;
  place-items: center;
  width: 37px;
  height: 41px;
  border-radius: 4px 4px 10px 2px;
  background: var(--accent);
  color: var(--on-accent);
  font: italic 29px/1 var(--serif);
  box-shadow:
    inset 0 0 0 3px var(--accent),
    inset 0 0 0 4px color-mix(in srgb, var(--on-accent) 45%, var(--accent));
}
nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--muted);
  border-radius: 6px;
  margin: 3px 0;
  font-size: 14px;
}
.nav-icon {
  width: 21px;
  text-align: center;
  font: 20px/1 var(--serif);
}
nav a:hover,
.deskitem:hover {
  background: var(--raised);
}
nav a.active {
  background: var(--tint);
  color: var(--accent);
  font-weight: 650;
}
.navdivider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 10px;
}
.sidemark {
  margin: auto 10px 0;
  border-top: 1px solid var(--line);
  padding-top: 19px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
}
.sidemark em {
  font: italic 17px var(--serif);
  letter-spacing: 0;
}
.body {
  min-width: 0;
}
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 80px);
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
#menu {
  display: none;
}
#save-sync { margin-left: auto; margin-right: .6rem; padding: .35rem .7rem; white-space: nowrap; font-size: .82rem; }
@media (max-width:650px) {
  .topbar #connection { max-width: 28vw; margin-left: 0; }
  #crumb { white-space: nowrap; }
  #save-sync { margin-right: 0; }
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 65%;
  padding: 6px 10px;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--muted);
  font-size: 12px;
}
.status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok-line);
  flex: none;
}
.status[data-pending] i {
  background: var(--warn);
}
main {
  max-width: 1170px;
  padding: clamp(25px, 3.3vw, 52px) clamp(20px, 5vw, 80px) 70px;
  margin: auto;
  outline: none;
}
main.turn {
  animation: enter 0.2s ease-out;
}
@keyframes enter {
  from {
    opacity: 0.92;
    transform: translateY(4px);
  }
}
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}
h1 {
  font-size: clamp(32px, 3vw, 44px);
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(22px, 2vw, 29px);
}
h3 {
  font-size: 20px;
}
p {
  margin: 0.4em 0;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.stack {
  display: grid;
  gap: 17px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.btn,
button.primary,
.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 7px 15px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 7px;
  text-decoration: none;
  font-weight: 550;
}
.btn:hover {
  border-color: var(--accent);
}
.primary,
button.primary,
.btn.primary,
.home-action {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.primary:hover,
.home-action:hover {
  background: var(--accent-hover);
}
button:active,
.home-action:active {
  transform: translateY(1px);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(17px, 2vw, 26px);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select {
  max-width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 9px 11px;
}
textarea {
  width: 100%;
  min-height: 86px;
}
input[type="checkbox"],
input[type="radio"],
progress {
  accent-color: var(--accent);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
}
label.field {
  display: grid;
  gap: 6px;
  margin: 0.6rem 0;
}
.home-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 21px;
}
.home-head time {
  color: var(--muted);
  font-size: 13px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 0.95fr);
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 12px;
  isolation: isolate;
  overflow: hidden;
}
.hero-copy {
  align-self: center;
  padding: clamp(23px, 3.5vw, 48px);
}
.hero-copy small {
  font: 550 15px/1.4 var(--serif);
  letter-spacing: 0.08em;
  color: var(--accent);
}
.hero-copy h2 {
  font-size: clamp(28px, 3.4vw, 48px);
  letter-spacing: -0.055em;
  margin: 8px 0 12px;
}
.hero-copy p {
  color: var(--muted);
  font-size: 15px;
}
.home-action {
  margin-top: 20px;
  padding: 9px 17px;
}
.home-action span {
  margin-left: 8px;
}
.atlas {
  position: relative;
  margin: 20px 24px 21px 0;
  padding: 12px 16px 7px;
  align-self: center;
  background: var(--plate);
  border: 1px solid var(--plate-edge);
  box-shadow:
    3px 3px 0 -1px var(--surface),
    3px 3px var(--plate-edge),
    var(--shadow);
  transform: rotate(1deg);
  color: var(--plate-ink);
}
.atlas img {
  width: 100%;
  height: clamp(145px, 13vw, 205px);
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  filter: grayscale(0.3) contrast(1.1);
}
.atlas figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--plate-rule);
  margin-top: 5px;
  padding-top: 5px;
  gap: 6px;
  font: 12px var(--serif);
}
.atlas a {
  color: var(--plate-ink);
  text-decoration: none;
}
.atlas a:hover {
  text-decoration: underline;
}
.desk-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 1fr);
  gap: clamp(24px, 4vw, 60px);
  margin-top: 32px;
}
.section-head {
  margin: 0 0 14px;
}
.section-head h2 {
  font-size: 23px;
}
.deskgrid,
.stats {
  border-top: 1px solid var(--line-strong);
}
.deskitem {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 5px;
  text-decoration: none;
  color: var(--ink);
}
.sigil {
  font: italic 23px var(--serif);
  color: var(--accent);
  text-align: center;
}
.deskitem h3 {
  font-size: 19px;
}
.deskitem p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.arrow {
  font-size: 18px;
  color: var(--muted);
}
.stats div {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 11px 3px;
}
.stats b {
  font: 430 30px/1.35 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}
.stats small {
  font-size: 14px;
}
.source {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}
.page-title {
  margin-bottom: 20px;
}
.page-title p {
  color: var(--muted);
  margin-top: 8px;
}
.task-row {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.task-row:first-of-type {
  border: 0;
}
.page-links a {
  margin-right: 12px;
}
#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  background: var(--ink);
  color: var(--paper);
  z-index: 15;
  border-radius: 8px;
  padding: 9px 17px;
  max-width: 90vw;
  display: none;
}
#shade {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: min(580px, 92vw);
  color: var(--ink);
  background: var(--surface);
  padding: 25px;
  max-height: 90dvh;
}
dialog::backdrop {
  background: var(--overlay);
}
img,
video,
audio {
  max-width: 100%;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.warn {
  color: var(--bad);
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 174px minmax(0, 1fr);
  }
  #sidebar {
    padding-inline: 12px;
  }
  main {
    padding-inline: 25px;
  }
  .hero-copy {
    padding: 24px;
  }
  .desk-lower {
    gap: 22px;
  }
}
@media (max-width: 650px) {
  .layout {
    display: block;
  }
  .topbar {
    height: 52px;
    padding: 0 14px;
    justify-content: flex-start;
    gap: 8px;
  }
  #sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 235px;
    transform: translateX(-102%);
    visibility: hidden;
    transition:
      transform 0.18s,
      visibility 0.18s;
  }
  body.navopen #sidebar {
    transform: none;
    visibility: visible;
  }
  body.navopen #shade {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 4;
  }
  #menu {
    display: block;
    background: transparent;
    border: 0;
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
  }
  .status {
    margin-left: auto;
  }
  .brand {
    margin-bottom: 25px;
  }
  main {
    padding: 22px 16px max(42px, env(safe-area-inset-bottom));
  }
  .home-head {
    margin-bottom: 17px;
  }
  .home-head time {
    font-size: 12px;
  }
  .hero {
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.92fr);
  }
  .hero-copy {
    padding: 21px 0 22px 16px;
  }
  .hero-copy small {
    font-size: 13px;
  }
  .hero-copy h2 {
    font-size: clamp(23px, 6.4vw, 33px);
    margin-block: 6px 7px;
  }
  .hero-copy p {
    font-size: 13px;
  }
  .home-action {
    margin-top: 14px;
    min-height: 44px;
  }
  .atlas {
    margin: 10px 10px 10px 5px;
    padding: 6px;
  }
  .atlas img {
    height: clamp(86px, 22vw, 140px);
  }
  .atlas figcaption {
    font-size: 9px;
    display: block;
  }
  .atlas figcaption span {
    display: none;
  }
  .desk-lower {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
  }
  .section-head {
    margin-bottom: 9px;
  }
  .deskitem {
    padding: 12px 4px;
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats div {
    align-items: flex-start;
    flex-direction: column;
    padding: 11px 3px 13px;
  }
  .stats small {
    font-size: 12px;
  }
  .btn,
  button.primary,
  nav a {
    min-height: 44px;
  }
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.interface-language { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; font: 500 .85rem var(--sans); letter-spacing:normal; }
.interface-language select { width:auto; min-height:36px; color:var(--ink); background:var(--sidebar); border:1px solid var(--line); border-radius:6px; padding:4px 8px; }
.sidemark .interface-language { margin-bottom:14px; }

.daily-desk-banner {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface) 0%, var(--raised) 100%);
  border: 1px solid var(--line);
}
.daily-desk-copy small {
  display: block;
  font: 600 11px/1.2 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.daily-desk-copy h2 {
  margin: 0 0 4px;
  font: 560 20px/1.25 var(--serif);
}
.daily-desk-copy p {
  margin: 0;
  font-size: 14px;
}

.daily-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.daily-head h1 {
  margin: 2px 0 6px;
  font: 560 32px/1.15 var(--serif);
}
.daily-head p {
  margin: 0;
}
.daily-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.daily-overview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.daily-overview-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.daily-overall-num {
  margin-left: 10px;
  font: 600 26px/1 var(--serif);
  color: var(--accent);
}
.daily-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  overflow: hidden;
}
.daily-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.daily-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.daily-card-head h2 {
  margin: 4px 0 0;
  font: 560 20px/1.25 var(--serif);
}
.daily-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 11px/1.4 var(--sans);
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--tint);
}
.daily-subtask {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daily-subtask p {
  margin: 0;
  font-size: 14px;
}
.daily-subtask-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.daily-count {
  font: 600 14px/1.2 var(--sans);
  color: var(--ink);
}
.daily-session-bar {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.daily-session-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
@media (max-width: 820px) {
  .daily-grid {
    grid-template-columns: 1fr;
  }
}

.learned-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.learned-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.learned-kpi strong {
  font: 600 28px/1.1 var(--serif);
  color: var(--ink);
}
.learned-kpi.is-active {
  border-color: var(--accent);
  background: var(--tint);
}
.learned-kpi.is-active strong {
  color: var(--accent);
}
.learned-launch {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.learned-count-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.learned-count-input {
  width: 72px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.learned-item-meta {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.learned-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 12px/1.3 var(--sans);
}
.learned-status.is-mastered {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
}
.learned-status.is-learning {
  color: var(--warn);
  background: var(--raised);
  border: 1px solid var(--line);
}
.learned-stem {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
@media (max-width: 720px) {
  .learned-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.study-lookup-badge {
  align-self: flex-start;
  margin-bottom: 4px;
}
.study-lookup-badge.is-blind {
  color: var(--ok);
  background: var(--ok-bg);
}
.study-lookup-kb {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.study-lookup-kb-item {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--raised);
}
.study-lookup-kb-item p {
  margin: 4px 0 0;
  font-size: 13.5px;
}
.study-auto-zh {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.study-lookup-static-ext {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.study-lookup-static-ext p {
  margin: 0;
}
.study-example > p {
  margin: 0;
}
