:root {
  --bg: #F3F5F5;
  --paper: #FFFFFF;
  --ink: #16343A;
  --text: #2A3B3F;
  --muted: #5E7074;
  --line: #E1E7E8;
  --field: #CBD5D7;
  --brass: #94703C;
  --hot: #B0412A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.error { color: var(--hot); font-size: 13px; }

.mark { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.mark span { color: var(--muted); font-weight: 400; margin-left: 6px; }

/* Login */
.login-form { max-width: 320px; margin: 0 auto; padding: 32vh 20px 40px; }
.login-form h1 { font-size: 22px; color: var(--ink); line-height: 1.3; }
.login-form .muted { margin-top: 8px; }
.login-form label { display: block; font-size: 13px; margin: 0 0 8px; }
.login-form input {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 12px;
  border: 1px solid var(--field); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.login-form input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.login-form .error { margin-top: 8px; }
.go {
  width: 100%; margin-top: 12px; padding: 12px; border: 0; border-radius: 6px;
  background: var(--ink); color: #fff; font-weight: 600;
}
.go:disabled { opacity: .6; }
.hint { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* Layout */
.app { display: grid; grid-template-columns: 200px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; min-height: 100vh; }
.aside { padding: 28px 12px 28px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.toc { margin-top: 36px; }
.toc h2 { font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.toc .week + .week { margin-top: 20px; }
.toc a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 10px; margin: 0 0 2px -10px; border-radius: 6px;
}
.toc a:hover { background: #EAEFEF; color: var(--ink); }
.toc a[aria-current="page"] { background: #E2E9E9; color: var(--ink); font-weight: 600; }
.toc a span { color: var(--muted); font-weight: 400; font-size: 12px; }

.main { padding: 28px 24px 72px 32px; min-width: 0; }
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 32px 36px 40px; }
.hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.hd h1 { font-size: 26px; line-height: 1.3; color: var(--ink); font-weight: 600; }
.hd h1 small { font-size: 16px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.highlight { font-size: 19px; line-height: 1.65; color: var(--ink); font-weight: 500; margin-top: 12px; max-width: 36em; }
.count { font-size: 13px; color: var(--muted); margin-top: 8px; }
.agreed { margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.agreed h2 { margin-bottom: 10px; }
.agreed li { list-style: none; display: grid; grid-template-columns: 22px minmax(0, 1fr); font-size: 14px; line-height: 1.65; color: var(--text); }
.agreed li + li { margin-top: 4px; }
.agreed .icon { width: 14px; height: 14px; margin-top: 4px; fill: none; stroke: var(--brass); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.work-hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.copy { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.copy:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
.copy:disabled { opacity: .5; cursor: default; text-decoration: none; }
.loading { padding: 30vh 20px; text-align: center; color: var(--muted); }
.sheet > .error { margin-top: 12px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; margin-top: 36px; align-items: start; }
.label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.group { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.group h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.group h3 .icon { width: 18px; height: 18px; fill: none; stroke: var(--brass); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.group h3 > span { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.group ol { list-style: none; }
.group li { display: grid; grid-template-columns: 32px minmax(0, 1fr); }
.group li .no {
  width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; text-align: center;
}
.group li .body { min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.group li .t { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.group li .d { display: block; font-size: 14px; color: #3E5054; line-height: 1.7; margin-top: 3px; }
.group li .gain {
  display: flex; gap: 10px; align-items: baseline; margin-top: 8px; padding: 7px 12px;
  background: #EFF4F4; border-radius: 6px; font-size: 13.5px; line-height: 1.6; color: var(--text);
}
.group li .gain b { flex: none; font-size: 12px; font-weight: 600; color: var(--brass); }
.group li a.view {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; vertical-align: 1px;
  font-size: 13px; font-weight: 400; color: var(--brass); white-space: nowrap;
}
.group li a.view .icon { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.group li a.view:hover { text-decoration: underline; text-underline-offset: 3px; }
.group li + li { margin-top: 22px; }
.empty { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); }

details summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 10px 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "＋"; margin-right: 6px; }
details[open] summary::before { content: "－"; }

.follow { scroll-margin-top: 16px; }
.item { padding: 11px 0; border-top: 1px solid var(--line); }
.item b { display: block; font-weight: 500; color: var(--ink); line-height: 1.5; }
.st { display: inline-block; font-size: 11px; font-weight: 500; line-height: 18px; padding: 0 6px; border-radius: 4px; margin: 0 6px 2px 0; vertical-align: 1px; }
.st-doing { background: #E2E9E9; color: var(--ink); }
.st-wait { background: #F3ECDF; color: #7A5B2E; }
.st-watch { background: #EEF1F1; color: var(--muted); }
.item p { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.item time { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.follow details { border-top: 1px solid var(--line); }
.follow details .item b { color: var(--muted); }

.facts { margin-top: 28px; padding: 24px 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; scroll-margin-top: 16px; }
.facts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { color: var(--ink); word-break: break-word; }
.facts dd small { display: block; font-size: 12px; color: var(--muted); }
.tech { margin-top: 18px; border-top: 1px solid var(--line); }
.tech dl { padding-bottom: 4px; }
.tech dd { color: var(--text); }
.foot { margin-top: 20px; font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .aside { position: static; height: auto; padding: 16px 12px 0 16px; overflow: visible; }
  .toc { margin-top: 12px; }
  .toc h2 { display: none; }
  #dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  #dates .week { display: contents; }
  .toc a {
    flex: 0 0 auto; margin: 0; padding: 6px 12px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--paper); white-space: nowrap;
  }
  .toc a[aria-current="page"] { border-color: var(--ink); background: var(--paper); }
  .main { padding: 16px 12px 48px; }
  .sheet { padding: 22px 18px 28px; }
  .hd { flex-direction: column; gap: 12px; }
  .hd h1 { font-size: 22px; }
  .cols { grid-template-columns: 1fr; gap: 32px; margin-top: 24px; }
  .highlight { font-size: 17px; }
  .facts { padding: 20px 18px; }
  .facts dl { grid-template-columns: 1fr; }
}
