:root {
  color-scheme: light;
  --background: #f5f5f7;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #fff;
  --surface-muted: #eaeaef;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --muted-light: #8d8d93;
  --line: rgba(60, 60, 67, .15);
  --line-soft: rgba(60, 60, 67, .09);
  --blue: #0071e3;
  --blue-soft: #e8f1ff;
  --green: #34c759;
  --orange: #c97923;
  --shadow: 0 18px 55px rgba(30, 35, 44, .08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

/* ! 显式保留 hidden 属性语义，避免加载态的 display 规则把隐藏内容重新显示。 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 10% 4%, rgba(255,255,255,.9), transparent 30%), radial-gradient(circle at 90% 20%, rgba(232,241,255,.45), transparent 28%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page-width { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgba(60, 60, 67, .08);
  background: rgba(245, 245, 247, .82);
  backdrop-filter: blur(20px) saturate(140%);
}

.site-header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #fff; background: var(--ink); }
.brand-mark i { font-size: 17px; line-height: 1; }
.main-nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 12px; }
.main-nav a, .main-nav button { border: 0; padding: 8px 0; color: inherit; background: transparent; transition: color .35s cubic-bezier(.32,.72,0,1), transform .35s cubic-bezier(.32,.72,0,1); }
.main-nav a:hover, .main-nav button:hover, .main-nav a.is-current { color: var(--ink); }
.main-nav button:active { transform: scale(.97); }
.main-nav .upload-nav-button { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); }
.upload-nav-button i { font-size: 16px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 56px; align-items: center; padding: 96px 0 88px; }
.eyebrow { margin: 0 0 16px; color: var(--muted-light); font-size: 10px; font-weight: 700; letter-spacing: .13em; line-height: 1.4; text-transform: uppercase; }
.hero h1 { max-width: 690px; margin: 0; font-size: clamp(52px, 8vw, 92px); font-weight: 720; letter-spacing: -.075em; line-height: .92; text-wrap: balance; }
.hero h1 span { color: var(--blue); }
.hero-description { max-width: 460px; margin: 26px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 32px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; transition: transform .45s cubic-bezier(.32,.72,0,1), box-shadow .45s cubic-bezier(.32,.72,0,1), background-color .45s cubic-bezier(.32,.72,0,1); }
.primary-button { padding: 13px 18px 13px 20px; color: #fff; background: var(--blue); box-shadow: 0 9px 22px rgba(0, 113, 227, .19); }
.primary-button i { font-size: 18px; font-weight: 400; line-height: 1; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 13px 26px rgba(0, 113, 227, .25); }
.primary-button:active, .secondary-button:active { transform: scale(.97); }
.storage-note { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--muted-light); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52, 199, 89, .11); }

.progress-card { padding: 28px; border: 1px solid rgba(255,255,255,.9); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.progress-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.progress-card .eyebrow { margin-bottom: 9px; }
.progress-card h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.04em; }
.progress-percent { color: var(--blue); font-size: 20px; font-weight: 650; }
.progress-ring { display: grid; place-items: center; width: 174px; height: 174px; margin: 36px auto 30px; border-radius: 50%; background: conic-gradient(var(--blue) var(--progress-angle), #e5e5ea 0); transform: rotate(-90deg); transition: background .75s cubic-bezier(.32,.72,0,1); }
.progress-ring::before { width: 136px; height: 136px; border-radius: 50%; background: var(--surface-solid); content: ""; }
.progress-ring-center { position: absolute; display: grid; place-items: center; transform: rotate(90deg); }
.progress-ring-center strong { font-size: 38px; font-weight: 650; letter-spacing: -.07em; }
.progress-ring-center span { margin-top: 3px; color: var(--muted-light); font-size: 11px; }
.required-progress { display: flex; justify-content: space-between; align-items: center; padding-top: 17px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
.required-progress strong { color: var(--ink); font-size: 13px; font-weight: 600; }

.subject-section { padding: 10px 0 84px; }
.section-heading, .task-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2, .task-section-heading h2 { margin: 0; font-size: 34px; font-weight: 680; letter-spacing: -.06em; }
.section-heading > p { max-width: 250px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }
.subject-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.subject-item { padding: 20px 0 0; border-top: 1px solid var(--line); }
.subject-item-heading { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.subject-item h3 { margin: 0; font-size: 15px; font-weight: 650; }
.subject-item-count { color: var(--muted-light); font-size: 11px; }
.subject-item-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.subject-meter { height: 5px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: #e1e1e6; }
.subject-meter span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transform-origin: left center; transition: transform .65s cubic-bezier(.32,.72,0,1); }

.task-section { padding: 14px 0 110px; }
.task-section-heading { align-items: center; }
.task-section-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.filter-bar { display: grid; gap: 12px; margin-top: 26px; }
.search-field { position: relative; }
.search-field > i { position: absolute; top: 50%; left: 15px; color: var(--muted-light); font-size: 17px; transform: translateY(-50%); }
.search-field input, .filter-selects select { width: 100%; border: 0; border-radius: 13px; outline: 2px solid transparent; color: var(--ink); background: rgba(255,255,255,.76); box-shadow: inset 0 0 0 1px var(--line-soft); font-size: 13px; transition: outline-color .3s cubic-bezier(.32,.72,0,1), box-shadow .3s cubic-bezier(.32,.72,0,1); }
.search-field input { padding: 13px 14px 13px 42px; }
.search-field input::placeholder { color: #a1a1a8; }
.search-field input:focus, .filter-selects select:focus { outline-color: rgba(0, 113, 227, .35); box-shadow: inset 0 0 0 1px rgba(0,113,227,.24); }
.subject-filter { display: flex; gap: 5px; width: fit-content; max-width: 100%; overflow-x: auto; padding: 4px; border-radius: 13px; background: #e9e9ee; scrollbar-width: none; }
.subject-filter::-webkit-scrollbar { display: none; }
.subject-filter button { flex: 0 0 auto; border: 0; border-radius: 9px; padding: 8px 13px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; transition: color .35s cubic-bezier(.32,.72,0,1), background-color .35s cubic-bezier(.32,.72,0,1), box-shadow .35s cubic-bezier(.32,.72,0,1); }
.subject-filter button:hover { color: var(--ink); }
.subject-filter button.is-active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(31, 38, 48, .08); }
.filter-selects { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-selects label { flex: 0 0 auto; }
.filter-selects select { width: auto; min-width: 132px; padding: 10px 30px 10px 12px; color: var(--muted); background: rgba(255,255,255,.64); }
.clear-button { border: 0; padding: 9px 0; color: var(--blue); background: transparent; font-size: 11px; }
.clear-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.task-list-container { position: relative; min-height: 240px; margin-top: 20px; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-group-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 26px 0 11px; border-top: 1px solid var(--line); }
.task-group-heading:first-child { border-top: 0; }
.task-group-heading h3 { margin: 0; font-size: 12px; font-weight: 700; }
.task-group-heading span { color: var(--muted-light); font-size: 11px; }
.task-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line-soft); transition: transform .45s cubic-bezier(.32,.72,0,1), opacity .45s cubic-bezier(.32,.72,0,1); }
.task-row:hover { transform: translateX(4px); }
.task-row.is-done { opacity: .62; }
.task-toggle { display: block; padding-top: 2px; cursor: pointer; }
.task-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.custom-checkbox { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid #c8c8ce; border-radius: 50%; color: #fff; background: transparent; transition: border-color .35s cubic-bezier(.32,.72,0,1), background-color .35s cubic-bezier(.32,.72,0,1), transform .35s cubic-bezier(.32,.72,0,1); }
.task-toggle:hover .custom-checkbox { border-color: var(--blue); }
.task-toggle input:focus-visible + .custom-checkbox { outline: 3px solid rgba(0, 113, 227, .24); outline-offset: 3px; }
.task-toggle input:checked + .custom-checkbox { border-color: var(--blue); background: var(--blue); transform: scale(1.03); }
.custom-checkbox i { font-size: 14px; opacity: 0; transform: scale(.6); transition: opacity .35s cubic-bezier(.32,.72,0,1), transform .35s cubic-bezier(.32,.72,0,1); }
.task-toggle input:checked + .custom-checkbox i { opacity: 1; transform: scale(1); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted-light); font-size: 10px; }
.subject-pill { color: var(--blue); font-weight: 650; }
.task-content h3 { margin: 6px 0 5px; font-size: 15px; font-weight: 620; letter-spacing: -.02em; line-height: 1.45; }
.is-done .task-content h3 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: #b5b5bb; }
.task-note { max-width: 690px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.task-source { margin-top: 10px; }
.task-source summary { width: fit-content; color: var(--blue); cursor: pointer; font-size: 11px; list-style: none; }
.task-source summary::-webkit-details-marker { display: none; }
.task-source summary::after { display: inline-block; margin-left: 7px; content: "⌄"; transition: transform .3s cubic-bezier(.32,.72,0,1); }
.task-source[open] summary::after { transform: rotate(180deg); }
.task-source code { display: block; max-width: 680px; margin-top: 8px; padding: 10px; overflow-wrap: anywhere; border-radius: 9px; color: var(--muted); background: #f1f1f5; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.55; }
.task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 2px; white-space: nowrap; }
.task-status { color: var(--muted-light); font-size: 10px; }
.task-status.is-done { color: var(--green); }
.task-frequency { color: var(--muted-light); font-size: 10px; }

.loading-state { display: flex; align-items: center; gap: 10px; padding: 42px 0; color: var(--muted); font-size: 12px; }
.loading-bar { width: 28px; height: 5px; overflow: hidden; border-radius: 99px; background: #dedee4; }
.loading-bar::after { display: block; width: 50%; height: 100%; border-radius: inherit; background: var(--blue); content: ""; transform: translateX(-100%); animation: loading-slide 1.15s cubic-bezier(.32,.72,0,1) infinite; }
.empty-state { padding: 62px 24px; border-top: 1px solid var(--line); text-align: center; }
.empty-icon { display: block; color: var(--blue); font-size: 30px; line-height: 1; }
.empty-state h3 { margin: 15px 0 7px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.secondary-button { margin-top: 20px; padding: 10px 15px; color: var(--blue); background: var(--blue-soft); }
.secondary-button:hover { background: #dceaff; transform: translateY(-1px); }

.upload-section { padding: 0 0 110px; }
.upload-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 30px 0 24px; border-top: 1px solid var(--line); }
.upload-heading h2 { margin: 0; font-size: 34px; font-weight: 680; letter-spacing: -.06em; }
.upload-heading p:not(.eyebrow) { max-width: 440px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.upload-heading-action { display: grid; justify-items: end; gap: 10px; }
.upload-heading-action .primary-button { white-space: nowrap; }
.upload-heading-action .primary-button i { font-size: 17px; }
.upload-sync-label { color: var(--muted-light); font-size: 10px; }
.upload-list { min-height: 78px; }
.upload-empty { display: flex; align-items: center; gap: 10px; padding: 20px 0; border-top: 1px solid var(--line-soft); color: var(--muted-light); font-size: 12px; }
.upload-empty i { color: var(--blue); font-size: 20px; }
.upload-empty p { margin: 0; }
.upload-items { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.upload-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.upload-item-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 17px; }
.upload-item h3 { margin: 0; font-size: 13px; font-weight: 620; }
.upload-item p { margin: 4px 0 0; color: var(--muted-light); font-size: 10px; }
.upload-download { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 8px 0; color: var(--blue); background: transparent; font-size: 11px; }
.upload-download i { font-size: 15px; }
.upload-dialog { width: min(480px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--surface-solid); box-shadow: 0 28px 80px rgba(20, 25, 34, .24); }
.upload-dialog::backdrop { background: rgba(22, 25, 31, .28); backdrop-filter: blur(5px); }
.upload-form { padding: 28px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.dialog-heading h2 { margin: 0; font-size: 25px; font-weight: 680; letter-spacing: -.05em; }
.dialog-close { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-muted); font-size: 17px; transition: color .3s cubic-bezier(.32,.72,0,1), transform .3s cubic-bezier(.32,.72,0,1); }
.dialog-close:hover { color: var(--ink); transform: rotate(6deg); }
.dialog-description { margin: 18px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.upload-field { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.upload-field small { color: var(--muted-light); }
.upload-field input, .upload-field select { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 2px solid transparent; padding: 11px 12px; color: var(--ink); background: #fafafc; font-size: 12px; transition: outline-color .3s cubic-bezier(.32,.72,0,1), border-color .3s cubic-bezier(.32,.72,0,1); }
.upload-field input:focus, .upload-field select:focus { border-color: rgba(0,113,227,.35); outline-color: rgba(0,113,227,.18); }
.upload-status { min-height: 18px; margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.upload-status.is-error { color: #a34035; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 8px; }
.dialog-actions .secondary-button { margin-top: 0; }
.dialog-actions .primary-button { gap: 8px; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--muted-light); font-size: 10px; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(320px, calc(100% - 48px)); padding: 12px 15px; border-radius: 13px; color: #fff; background: rgba(29, 29, 31, .92); box-shadow: 0 10px 30px rgba(29,29,31,.18); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .4s cubic-bezier(.32,.72,0,1), transform .4s cubic-bezier(.32,.72,0,1); }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #9b3f35; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes loading-slide { to { transform: translateX(280%); } }

@media (min-width: 760px) {
  .filter-bar { grid-template-columns: minmax(240px, 1fr) auto; align-items: center; }
  .filter-selects { grid-column: 1 / -1; }
}

@media (max-width: 759px) {
  .page-width { width: min(100% - 32px, 620px); }
  .site-header-inner { min-height: 58px; }
  .main-nav { gap: 14px; }
  .main-nav a { display: none; }
  .main-nav .upload-nav-button span { display: none; }
  .main-nav .upload-nav-button i { font-size: 20px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 64px 0 62px; }
  .hero h1 { font-size: clamp(52px, 17vw, 76px); }
  .hero-description { font-size: 14px; }
  .progress-card { max-width: 430px; }
  .subject-section { padding-bottom: 70px; }
  .section-heading > p { display: none; }
  .subject-list { grid-template-columns: 1fr; gap: 19px; }
  .subject-item { padding-top: 16px; }
  .task-section { padding-bottom: 76px; }
  .task-section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .task-section-heading h2 { font-size: 31px; }
  .filter-bar { margin-top: 22px; }
  .filter-selects { gap: 8px; }
  .filter-selects select { min-width: 0; flex: 1; }
  .task-row { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .task-side { grid-column: 2; flex-direction: row; align-items: center; padding-top: 0; }
  .task-source code { max-width: 100%; }
  .upload-heading { align-items: start; flex-direction: column; gap: 20px; }
  .upload-heading-action { justify-items: start; }
  .upload-heading h2 { font-size: 31px; }
  .upload-item { grid-template-columns: 30px minmax(0, 1fr); }
  .upload-download { grid-column: 2; justify-self: start; }
  .site-footer { flex-direction: column; gap: 7px; }
  .toast { right: 16px; bottom: 16px; max-width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
