:root {
  color-scheme: light;
  --paper: #f1f3f5;
  --paper-deep: #e5e9ee;
  --ink: #172033;
  --muted: #6c7484;
  --line: rgba(23, 32, 51, 0.15);
  --blue: #2868d7;
  --serif: ui-serif, "Songti SC", "STSong", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.brand-mark { display: inline-block; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(90deg, transparent 46%, var(--paper) 46% 54%, transparent 54%), var(--blue); }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; }

.login-view { display: grid; grid-template-columns: minmax(340px, 1.05fr) minmax(420px, .95fr); min-height: 100svh; }
.login-identity { position: relative; display: flex; min-height: 100svh; padding: clamp(36px, 6vw, 88px); flex-direction: column; overflow: hidden; background: var(--ink); color: white; }
.login-identity::after { content: "15"; position: absolute; right: clamp(-18px, -1vw, 0px); bottom: clamp(-76px, -7vw, -30px); color: rgba(255,255,255,.045); font-family: var(--serif); font-size: clamp(280px, 38vw, 620px); font-weight: 700; line-height: .7; }
.login-identity .brand-mark { background: linear-gradient(90deg, transparent 46%, var(--ink) 46% 54%, transparent 54%), #6e9ef2; }
.login-identity > p { margin: 28px 0 auto; color: rgba(255,255,255,.54); font-size: 11px; letter-spacing: .17em; }
.login-identity > strong { position: relative; z-index: 1; font-family: var(--serif); font-size: clamp(74px, 10vw, 148px); font-weight: 700; line-height: .88; letter-spacing: -.07em; }
.login-edition { position: relative; z-index: 1; margin-top: 32px; color: rgba(255,255,255,.58); font-size: 13px; letter-spacing: .14em; }
.login-form { align-self: center; width: min(440px, calc(100% - 64px)); margin: auto; padding: 48px 0; animation: form-in 520ms cubic-bezier(.22,1,.36,1) both; }
.login-form h1 { margin: 16px 0 14px; font-family: var(--serif); font-size: clamp(36px, 4vw, 54px); line-height: 1.1; letter-spacing: -.035em; }
.login-copy { max-width: 390px; margin: 0 0 48px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.login-form > label:not(.remember-row) { display: block; margin-top: 26px; }
.login-form > label > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; height: 52px; padding: 0; border: 0; border-bottom: 1px solid var(--line); outline: none; background: transparent; color: var(--ink); font-size: 17px; transition: border-color 160ms ease; }
.login-form input:focus { border-color: var(--blue); }
.remember-row { display: flex; align-items: center; gap: 9px; margin: 22px 0 28px; color: var(--muted); font-size: 13px; }
.remember-row input { width: 17px; height: 17px; accent-color: var(--blue); }
.remember-row span { margin: 0 !important; }
.login-form button { width: 100%; height: 52px; border: 0; border-radius: 999px; background: var(--blue); color: white; font-weight: 700; transition: transform 160ms ease, background 160ms ease; }
.login-form button:hover { background: #1e57b7; }
.login-form button:active { transform: scale(.985); }
.login-form button:disabled { cursor: wait; opacity: .65; }
.login-error { min-height: 20px; margin: 14px 0 0; color: #b74343; font-size: 12px; }
.login-version { margin: 8px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-align: center; }

.archive-view { min-height: 100svh; animation: archive-in 360ms ease-out both; }
.archive-head { position: sticky; z-index: 5; top: 0; display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 76px); border-bottom: 1px solid var(--line); background: rgba(241,243,245,.92); backdrop-filter: blur(18px); }
.archive-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.archive-brand > span:last-child { display: grid; gap: 2px; }
.archive-brand strong { font-size: 15px; }
.archive-brand small { color: var(--muted); font-size: 10px; }
.archive-actions { display: flex; align-items: center; gap: 14px; }
.archive-actions > span { color: var(--muted); font-size: 11px; }
.archive-actions button { padding: 7px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; }
.archive-actions button:hover { border-color: var(--ink); color: var(--ink); }
.archive-main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: clamp(50px, 8vw, 104px) 0 100px; }
.archive-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 390px); gap: 56px; align-items: end; padding-bottom: 48px; }
.archive-intro h1 { margin: 14px 0 0; font-family: var(--serif); font-size: clamp(42px, 6vw, 76px); line-height: 1; letter-spacing: -.055em; }
.archive-intro > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.dataset-overviews { margin-bottom: clamp(32px, 4vw, 46px); border-top: 1px solid var(--ink); }
.dataset-overview { border-bottom: 1px solid var(--line); }
.dataset-heading { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 24px; }
.dataset-heading .eyebrow { font-size: 8px; letter-spacing: .13em; }
.dataset-heading h2 { margin: 4px 0 0; font-family: var(--serif); font-size: clamp(19px, 2.2vw, 25px); line-height: 1; letter-spacing: -.03em; }
.dataset-total { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 6px 0 6px 12px; border: 0; background: transparent; color: var(--ink); }
.dataset-total:hover { color: var(--blue); }
.dataset-total strong { font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; }
.dataset-total span { color: var(--muted); font-size: 11px; }
.dataset-total i { margin-left: 3px; color: var(--muted); font-size: 15px; font-style: normal; transition: transform 180ms ease; }
.dataset-total[aria-expanded="true"] i { transform: rotate(180deg); }
.dataset-details { border-top: 1px solid var(--line); animation: collection-in 180ms ease-out both; }
.dataset-export { margin: 10px 0 14px; padding: 6px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.dataset-export:hover { border-color: var(--ink); color: var(--ink); }
.dataset-loading { margin: 0; padding: 16px 0; color: var(--muted); font-size: 11px; }
.dataset-loading.error { color: #b74343; }
.priority-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.priority-label { display: grid; min-width: 0; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 12px 14px; border-right: 1px solid var(--line); }
.priority-label:first-child { padding-left: 0; }
.priority-label:last-child { border-right: 0; }
.priority-label > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 800; }
.priority-label strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.priority-label small { color: var(--muted); font-size: 10px; }
.rework-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.rework-label { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 11px 12px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; transition: background 160ms ease, color 160ms ease; }
.rework-label:nth-child(3n) { border-right: 0; }
.rework-label:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
.rework-label:first-child { padding-left: 0; }
.rework-label:last-child { border-right: 0; }
.rework-label:hover, .rework-label.active { background: rgba(255,255,255,.55); color: var(--blue); }
.rework-label:disabled { cursor: default; opacity: .38; }
.rework-label span { font-size: 11px; font-weight: 800; }
.rework-label strong { font-size: 11px; overflow-wrap: anywhere; }
.rework-label small { color: var(--muted); font-size: 10px; }
.rework-collection { padding: 4px 0 30px; border-top: 1px solid var(--ink); animation: collection-in 220ms ease-out both; }
.rework-collection-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; }
.rework-collection-head strong { font-size: 13px; }
.rework-collection-head > div { display: flex; gap: 18px; }
.rework-collection-head button { padding: 6px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; }
.rework-collection-head button:hover { border-color: var(--ink); color: var(--ink); }
.rework-items { display: grid; }
.rework-item { border-bottom: 1px solid var(--line); }
.rework-item summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 0; cursor: pointer; list-style: none; }
.rework-item summary::-webkit-details-marker { display: none; }
.rework-item-code { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 11px; font-weight: 800; }
.rework-item-title { min-width: 0; }
.rework-item-title strong, .rework-item-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rework-item-title strong { font-family: var(--serif); font-size: 17px; }
.rework-item-title small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.rework-item-arrow { color: var(--muted); font-size: 15px; transition: transform 160ms ease; }
.rework-item[open] .rework-item-arrow { transform: rotate(90deg); }
.rework-item-body { padding: 4px 44px 24px; }
.rework-item-body p { margin: 0; color: #30384a; font-family: var(--serif); font-size: 16px; line-height: 1.85; white-space: pre-wrap; }
.rework-item-actions { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.rework-item-actions a, .rework-item-actions button { padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; text-decoration: none; }
.rework-item-actions a:hover { color: var(--blue); }
.rework-item-actions button:hover { color: #b74343; }
.rework-loading { padding: 30px 0; color: var(--muted); font-size: 12px; }
.archive-days { border-top: 1px solid var(--ink); }
.archive-day { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding: 34px 0 40px; border-bottom: 1px solid var(--line); animation: day-in 420ms cubic-bezier(.22,1,.36,1) both; animation-delay: calc(var(--day-index) * 45ms); }
.day-date { position: sticky; top: 106px; align-self: start; }
.day-date time { display: block; font-family: var(--serif); font-size: 29px; font-weight: 700; letter-spacing: -.035em; }
.day-date span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.day-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.day-content { min-width: 0; }
.dedup-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; padding: 13px 0 2px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: color 160ms ease, transform 180ms ease; }
.dedup-entry:hover { color: var(--blue); transform: translateX(4px); }
.dedup-entry.disabled { pointer-events: none; opacity: .38; }
.dedup-entry strong, .dedup-entry small { display: block; }
.dedup-entry strong { font-size: 12px; }
.dedup-entry small, .dedup-entry > span:last-child { margin-top: 3px; color: var(--muted); font-size: 10px; }
.label-entry { position: relative; display: grid; min-width: 0; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 15px 0 17px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: color 160ms ease, transform 180ms ease; }
.label-entry:hover { color: var(--blue); transform: translateX(4px); }
.label-entry.disabled { pointer-events: none; opacity: .38; }
.label-code { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 800; }
.label-copy { min-width: 0; }
.label-copy strong, .label-copy small { display: block; }
.label-copy strong { overflow-wrap: anywhere; }
.label-copy strong { font-size: 12px; }
.label-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.label-arrow { font-size: 16px; }
.label-progress { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; overflow: hidden; }
.label-progress span { display: block; width: var(--progress); height: 100%; background: var(--blue); }
.empty-state { padding: 80px 0; border-top: 1px solid var(--ink); text-align: center; }
.empty-state strong { font-family: var(--serif); font-size: 28px; }
.empty-state p { color: var(--muted); }
.archive-footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px clamp(22px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 11px 15px; border-radius: 999px; background: var(--ink); color: white; font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@keyframes form-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes archive-in { from { opacity: 0; } }
@keyframes day-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes collection-in { from { opacity: 0; transform: translateY(-5px); } }

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-identity { min-height: 34svh; padding: 28px 24px 32px; }
  .login-identity > p { margin: 16px 0 36px; }
  .login-identity > strong { font-size: 64px; line-height: .9; }
  .login-edition { margin-top: 18px; }
  .login-identity::after { right: -8px; bottom: -35px; font-size: 230px; }
  .login-form { width: min(440px, calc(100% - 40px)); padding: 42px 0 34px; }
  .login-copy { margin-bottom: 34px; }
  .archive-intro { grid-template-columns: 1fr; gap: 24px; }
  .rework-labels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .archive-day { grid-template-columns: 150px minmax(0, 1fr); }
  .day-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .rework-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rework-label:nth-child(3n) { border-right: 1px solid var(--line); }
  .rework-label:nth-child(2n) { border-right: 0; }
  .rework-label:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .archive-head { height: 68px; padding: 0 16px; }
  .archive-actions { gap: 10px; }
  .archive-actions > span { display: none; }
  .archive-main { width: calc(100% - 32px); padding: 48px 0 70px; }
  .archive-intro { padding-bottom: 34px; }
  .archive-intro h1 { font-size: 46px; }
  .dataset-heading { min-height: 56px; gap: 12px; }
  .dataset-heading h2 { font-size: 20px; }
  .dataset-total { flex: 0 0 auto; }
  .dataset-total span { display: none; }
  .priority-label { grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding: 10px 8px; }
  .priority-label:first-child { padding-left: 0; }
  .priority-label > span { width: 22px; height: 22px; }
  .priority-label small { grid-column: 2; }
  .rework-label { grid-template-columns: auto 1fr; padding: 10px 9px; }
  .rework-label small { grid-column: 2; }
  .rework-label:first-child { padding-left: 9px; }
  .rework-item summary { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; }
  .rework-item-title strong { font-size: 15px; }
  .rework-item-body { padding: 2px 0 22px; }
  .archive-day { grid-template-columns: 1fr; gap: 18px; padding: 28px 0 34px; }
  .day-date { position: static; display: flex; align-items: baseline; justify-content: space-between; }
  .day-date time { font-size: 26px; }
  .day-date span { margin: 0; }
  .day-labels { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .dedup-entry { margin-top: 10px; padding-top: 12px; }
  .label-entry { grid-template-columns: 27px minmax(0, 1fr); gap: 8px; padding: 14px 0 16px; }
  .label-arrow { display: none; }
  .archive-footer { display: grid; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
