:root {
  color-scheme: light;
  --ink: #25312e;
  --muted: #7b8581;
  --line: #e4e8e5;
  --paper: #fff;
  --canvas: #f7f8f7;
  --blue: #2e6c5c;
  --blue-dark: #225446;
  --blue-light: #eef5f1;
  --mint: #dff4eb;
  --green: #2b8a65;
  --shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-width: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; padding: 30px 20px 54px; }
.topbar { max-width: 1100px; margin: 0 auto 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: white; background: linear-gradient(145deg, #5d7efa, #3659d8); box-shadow: 0 8px 18px rgba(67, 105, 232, .22); }
.brand-mark svg { width: 22px; height: 22px; }
.top-link { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #65728a; font-size: 13px; font-weight: 600; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.7); transition: .18s ease; }
.top-link svg { width: 16px; height: 16px; flex: none; }
.top-link:hover { color: var(--blue); border-color: #cbd5fa; background: white; }
.home-layout { max-width: 1100px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.hero { position: relative; overflow: hidden; min-height: 225px; padding: 32px 36px; color: white; border-radius: 24px; background: linear-gradient(120deg, #3155d3 0%, #5578ec 62%, #7d94f6 100%); box-shadow: 0 18px 36px rgba(65, 96, 215, .2); }
.hero::before, .hero::after { content: ''; position: absolute; pointer-events: none; border-radius: 50%; border: 1px solid rgba(255,255,255,.13); }
.hero::before { width: 300px; height: 300px; right: -40px; top: -160px; box-shadow: 0 0 0 35px rgba(255,255,255,.035), 0 0 0 70px rgba(255,255,255,.03); }
.hero::after { width: 180px; height: 180px; right: 95px; bottom: -130px; }
.hero-content { position: relative; z-index: 1; max-width: 610px; }
.eyebrow { margin: 0 0 11px; color: rgba(255,255,255,.73); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 500px; margin: 0; font-size: clamp(27px, 4vw, 38px); line-height: 1.25; letter-spacing: -.055em; }
.hero-sub { margin: 14px 0 0; color: rgba(255,255,255,.82); font-size: 14px; }
.date-chip { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; padding: 9px 13px; border-radius: 11px; color: white; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(10px); font-size: 13px; font-weight: 600; }
.date-chip svg { width: 16px; height: 16px; }
.card { border: 1px solid rgba(228,233,242,.88); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.assignment-panel { margin-top: 20px; padding: 24px 26px 18px; }
.panel-heading { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.count-badge { min-width: 28px; padding: 4px 9px; color: var(--blue); border-radius: 99px; background: var(--blue-light); font-size: 12px; font-weight: 700; text-align: center; }
.assignment-list { display: grid; gap: 10px; }
.assignment { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 14px; align-items: start; padding: 16px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .18s ease, background .18s ease, transform .18s ease; cursor: pointer; }
.assignment:hover { border-color: #cbd5fa; transform: translateY(-1px); }
.assignment.is-complete { background: #f8fcfa; border-color: #d3ecdf; }
.check { position: relative; width: 21px; height: 21px; margin-top: 1px; border: 1.5px solid #c5ccda; border-radius: 7px; background: white; transition: .18s ease; }
.is-complete .check { border-color: var(--green); background: var(--green); }
.is-complete .check::after { content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.assignment-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.is-complete .assignment-title { color: #75877f; text-decoration: line-through; text-decoration-color: #adcbbd; }
.assignment-description { margin: 7px 0 0; color: #69758b; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.assignment-state { display: inline-block; margin-top: 10px; color: #929db0; font-size: 11px; font-weight: 600; }
.is-complete .assignment-state { color: var(--green); }
.panel-footnote { margin: 17px 2px 0; color: #929db0; font-size: 11px; line-height: 1.65; }
.side-column { display: grid; gap: 18px; }
.calendar-card { padding: 22px 20px 20px; }
.calendar-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-title h2 { margin: 0; font-size: 15px; }
.calendar-icon { display: grid; place-items: center; width: 32px; height: 32px; color: var(--blue); border-radius: 10px; background: var(--blue-light); }
.calendar-icon svg { width: 17px; height: 17px; }
.date-control { width: 100%; padding: 12px 13px; color: #34425e; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fbfcfe; font-weight: 600; }
.date-control:focus { border-color: #97aaf5; box-shadow: 0 0 0 3px rgba(67,105,232,.1); }
.calendar-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.button-quiet { padding: 9px 10px; color: #606d84; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 12px; font-weight: 600; transition: .18s ease; }
.button-quiet:hover { color: var(--blue); border-color: #c7d2fb; }
.today-button { width: 100%; margin-top: 9px; padding: 9px; color: var(--blue); border: 0; border-radius: 10px; background: var(--blue-light); font-size: 12px; font-weight: 700; }
.today-button:hover { background: #e4eaff; }
.calendar-note { margin: 13px 1px 0; color: #929db0; font-size: 11px; line-height: 1.7; }
.month-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 10px; font-size: 13px; }
.month-heading button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #69758b; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.calendar-weekdays { color: #97a1b3; font-size: 10px; margin-bottom: 5px; }
.calendar-weekdays span { padding: 5px 0; }
.calendar-day { position: relative; min-width: 0; height: 33px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #54627b; font-size: 12px; }
.calendar-day:hover { background: var(--blue-light); color: var(--blue); }
.calendar-day.weekend { color: #a2abbb; }
.calendar-day.selected { background: var(--blue); color: white; font-weight: 700; }
.calendar-day.has-homework::after { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 50%; bottom: 3px; left: calc(50% - 1.5px); background: var(--blue); }
.calendar-day.selected::after { background: white; }
.calendar-legend { margin: 8px 0 0; color: #98a2b4; font-size: 10px; }
.calendar-legend::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); margin-right: 5px; vertical-align: middle; }
.password-card { margin-top: 18px; padding: 18px 22px; }
.password-card summary { cursor: pointer; color: #63718b; font-size: 13px; font-weight: 600; }
.password-card form { max-width: 420px; margin-top: 18px; }
.assignment:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #9eb1fa; outline-offset: 3px; }
[hidden] { display: none !important; }
.tip-card { padding: 18px 19px; background: linear-gradient(135deg,#eaf7f1,#f5fbf8); border-color: #e0f0e8; box-shadow: none; }
.tip-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: #2f7156; font-size: 13px; font-weight: 700; }
.tip-heading span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: #d4efe2; }
.tip-heading svg { width: 15px; height: 15px; }
.tip-card p { margin: 0; color: #698575; font-size: 11px; line-height: 1.8; }
.empty-state { padding: 36px 20px; text-align: center; border: 1px dashed #dce2ec; border-radius: 15px; background: #fbfcfe; }
.empty-illustration { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px; color: #7188e9; border-radius: 16px; background: #eef2ff; }
.empty-illustration svg { width: 23px; height: 23px; }
.empty-state h3 { margin: 0; font-size: 14px; }
.empty-state p { margin: 7px 0 0; color: #919cb0; font-size: 12px; }
.loading { color: #8d98ab; padding: 30px; text-align: center; font-size: 13px; }
.admin-wrap { max-width: 930px; margin: auto; }
.admin-title { margin: 0; font-size: clamp(26px,4vw,34px); letter-spacing: -.055em; }
.admin-intro { margin: 8px 0 24px; color: var(--muted); font-size: 14px; }
.login-card { max-width: 460px; margin: 10vh auto 0; padding: 34px; }
.login-icon { display: grid; place-items: center; width: 49px; height: 49px; margin-bottom: 20px; color: var(--blue); border-radius: 16px; background: var(--blue-light); }
.login-icon svg { width: 23px; height: 23px; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.login-card p { margin: 8px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { color: #56637a; font-size: 12px; font-weight: 700; }
.field input, .field textarea { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid #dfe5ef; border-radius: 10px; outline: none; background: #fcfdff; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus { border-color: #97aaf5; box-shadow: 0 0 0 3px rgba(67,105,232,.1); }
.button-primary { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 43px; padding: 0 17px; color: white; border: 0; border-radius: 10px; background: var(--blue); box-shadow: 0 7px 15px rgba(67,105,232,.18); font-size: 13px; font-weight: 700; transition: .18s ease; }
.button-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.button-primary:disabled { opacity: .65; cursor: wait; transform: none; }
.button-primary svg { width: 16px; height: 16px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: #c34d55; font-size: 12px; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.admin-actions { display: flex; gap: 8px; }
.admin-grid { display: grid; grid-template-columns: minmax(270px,.9fr) minmax(0,1.1fr); gap: 18px; align-items: start; }
.editor-card, .manage-card { padding: 22px; }
.editor-card h2, .manage-card h2 { margin: 0 0 18px; font-size: 16px; }
.form-actions { display: flex; gap: 9px; align-items: center; }
.button-secondary { min-height: 41px; padding: 0 14px; color: #64718a; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 12px; font-weight: 700; }
.button-secondary:hover { border-color: #cbd5fa; color: var(--blue); }
.admin-list { display: grid; gap: 10px; }
.admin-item { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.admin-item-title { margin: 0; font-size: 14px; line-height: 1.5; }
.admin-item-description { margin: 6px 0 0; color: #78849a; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-item-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.text-button { padding: 6px 9px; color: var(--blue); border: 0; border-radius: 7px; background: #f0f3ff; font-size: 11px; font-weight: 700; }
.text-button.danger { color: #bd5960; background: #fff1f1; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 25px; padding: 11px 16px; color: white; border-radius: 11px; background: #26334d; box-shadow: 0 9px 28px rgba(20,30,52,.2); font-size: 12px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.site-footer { max-width: 1100px; margin: 24px auto 0; color: #a0aabc; text-align: center; font-size: 10px; }

@media (max-width: 800px) {
  .home-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .tip-card { display: flex; flex-direction: column; justify-content: center; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .app-shell { padding: 18px 13px 36px; }
  .topbar { margin-bottom: 18px; }
  .brand { font-size: 15px; gap: 9px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .top-link { padding: 8px 9px; font-size: 11px; }
  .hero { min-height: 205px; padding: 25px 22px; border-radius: 19px; }
  .hero h1 { font-size: 29px; }
  .hero-sub { font-size: 12px; }
  .date-chip { margin-top: 20px; }
  .assignment-panel { padding: 19px 15px 15px; }
  .assignment { gap: 11px; padding: 14px 12px; }
  .side-column { grid-template-columns: 1fr; gap: 12px; }
  .calendar-card { padding: 18px; }
  .tip-card { display: block; }
  .login-card { margin-top: 5vh; padding: 25px 21px; }
  .admin-head { align-items: center; }
  .admin-actions { flex-direction: column; }
  .editor-card, .manage-card { padding: 18px 15px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* A quiet, compact layout for reading daily homework. */
.app-shell { padding-top: 25px; }
.topbar { max-width: 1040px; padding-bottom: 20px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.brand { gap: 10px; font-size: 17px; font-weight: 650; letter-spacing: 0; }
.brand-mark { width: 31px; height: 31px; background: #304a40; border-radius: 6px; box-shadow: none; }
.brand-mark svg { width: 18px; height: 18px; }
.topbar-note { color: #8a938e; font-size: 12px; }
.top-link { border: 0; background: transparent; padding-right: 0; }
.home-layout { max-width: 1040px; grid-template-columns: minmax(0, 1fr) 292px; gap: 36px; }
.day-heading { margin: 2px 0 20px; }
.day-heading h1 { margin: 0 0 10px; font-size: 24px; line-height: 1.45; font-weight: 650; letter-spacing: 0; }
.day-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.publication-notice { padding: 11px 14px; color: #737d78; background: #eef0ee; border-left: 3px solid #a8b0ab; border-radius: 3px; font-size: 13px; line-height: 1.7; }
.publication-notice.draft { color: #8b692b; background: #faf5e9; border-color: #b89b59; }
.publication-notice.complete { color: #35684d; background: #edf5ee; border-color: #6b9e78; }
.publication-notice.none { color: #526a62; background: #edf2ef; border-color: #8da69b; }
.assignment-panel { margin-top: 20px; padding: 20px 22px 15px; }
.panel-heading h2 { font-size: 15px; letter-spacing: 0; font-weight: 650; }
.count-badge { color: #7d8881; background: transparent; font-weight: 400; padding: 0; }
.assignment-list { gap: 0; }
.assignment { border: 0; border-top: 1px solid #edf0ed; padding: 18px 2px; border-radius: 0; background: white; }
.assignment:hover { background: #fafcfb; transform: none; }
.assignment.is-complete { background: #fafcfb; border-color: #edf0ed; }
.check { border-radius: 4px; border-color: #bac6bf; }
.assignment-title { font-weight: 600; }
.assignment-state { margin-top: 8px; font-weight: 400; }
.assignment-description { color: #707c74; }
.panel-footnote { border-top: 1px solid #edf0ed; margin-top: 0; padding-top: 14px; }
.empty-state { padding: 40px 12px; background: white; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.empty-state h3 { font-weight: 500; color: #717e76; }
.side-column { grid-template-columns: 1fr; }
.calendar-card { padding: 20px 18px; }
.calendar-title h2 { font-size: 14px; font-weight: 600; }
.calendar-icon { background: transparent; color: #84948a; width: 24px; height: 24px; }
.date-control, .field input, .field textarea { border-radius: 5px; background: white; padding: 10px 11px; font-weight: 400; }
.month-heading button, .calendar-day { border-radius: 5px; }
.calendar-day { height: 31px; }
.button-quiet, .today-button, .button-primary, .button-secondary { border-radius: 5px; box-shadow: none; font-weight: 500; }
.button-primary:hover { transform: none; }
.button-quiet:hover, .button-secondary:hover { border-color: #b3c8ba; }
.today-button:hover { background: #e3ede6; }
.site-footer { margin-top: 36px; color: #a0aaa3; }
.admin-title { font-size: 26px; letter-spacing: 0; font-weight: 650; }
.admin-intro { font-size: 12px; margin-bottom: 0; }
.admin-grid { gap: 24px; }
.admin-item { border-radius: 5px; }
.admin-item-title { font-weight: 600; }
.text-button { background: #eef4ef; border-radius: 4px; color: var(--blue); }
.login-card { max-width: 400px; margin-top: 7vh; padding: 30px; }
.login-icon { background: #f0f4f0; color: var(--blue); border-radius: 8px; width: 40px; height: 40px; }
.login-card h1 { font-size: 22px; font-weight: 600; letter-spacing: 0; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: #536459; font-size: 13px; line-height: 1.6; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--blue); }
.field-note { margin: 8px 0 15px; color: #8a948c; font-size: 11px; line-height: 1.7; }
.day-status-form { padding: 14px; background: #f8faf8; border: 1px solid var(--line); border-radius: 5px; margin-bottom: 20px; }
.day-status-form h3 { margin: 0; font-size: 13px; font-weight: 600; }
.day-status-form .button-secondary { margin-top: 6px; min-height: 35px; background: white; }
.day-status-form .form-error:empty { display: none; }

@media (max-width: 800px) {
  .home-layout { grid-template-columns: 1fr; gap: 20px; }
  .side-column { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { min-height: 100dvh; }
  .app-shell { padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 14px; margin-bottom: 20px; }
  .brand { min-height: 44px; font-size: 17px; white-space: nowrap; }
  .topbar-note { font-size: 11px; line-height: 1.5; }
  .top-link { min-height: 44px; font-size: 12px; }
  .home-layout, .admin-grid { gap: 16px; }
  .main-column, .side-column, .field { min-width: 0; }
  .day-heading { margin-bottom: 16px; }
  .day-heading h1 { font-size: clamp(18px, 5.2vw, 22px); }
  .day-heading p { font-size: 13px; }
  .publication-notice { padding: 12px; font-size: 14px; }
  .assignment-panel { margin-top: 16px; padding: 17px 14px 14px; }
  .panel-heading { align-items: flex-start; gap: 8px; }
  .panel-heading h2 { font-size: 16px; }
  .count-badge { flex: none; white-space: nowrap; line-height: 1.6; }
  .assignment { min-height: 60px; grid-template-columns: 22px minmax(0, 1fr); gap: 11px; padding: 16px 0; }
  .assignment-title { font-size: 16px; }
  .assignment-description { font-size: 14px; line-height: 1.75; }
  .assignment-state, .panel-footnote, .calendar-note { font-size: 12px; }
  .calendar-card { padding: 18px 14px; }
  .calendar-title h2 { font-size: 16px; }
  .date-control, .field input, .field textarea { min-width: 0; max-width: 100%; min-height: 46px; font-size: 16px; }
  .field textarea { min-height: 136px; }
  .month-heading { margin-top: 12px; font-size: 15px; }
  .month-heading button { width: 44px; height: 44px; font-size: 20px; }
  .calendar-weekdays { font-size: 12px; }
  .calendar-days { gap: 2px; }
  .calendar-day { height: 44px; font-size: 14px; }
  .calendar-legend { font-size: 11px; }
  .button-quiet, .today-button { min-height: 44px; font-size: 14px; }
  .admin-title { font-size: 23px; }
  .admin-head { gap: 12px; }
  .editor-card, .manage-card { padding: 18px 14px; min-width: 0; }
  .field label { font-size: 14px; }
  .checkbox-row { min-height: 44px; font-size: 14px; margin: 6px 0; }
  .checkbox-row input { width: 20px; height: 20px; }
  .field-note { font-size: 12px; color: #6d786f; }
  .form-actions { flex-wrap: wrap; }
  .form-actions > button { flex: 1 1 130px; }
  .button-primary, .button-secondary { min-height: 46px; font-size: 14px; }
  .day-status-form .button-secondary { width: 100%; min-height: 46px; }
  .admin-item-title { overflow-wrap: anywhere; font-size: 15px; }
  .admin-item-description { font-size: 14px; }
  .text-button { min-width: 50px; min-height: 44px; font-size: 13px; }
  .login-card { padding: 24px 18px; margin-top: 20px; }
  .login-card .button-primary { width: 100%; }
  .password-card { padding: 12px 14px; }
  .password-card summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  .password-card form { margin-top: 10px; }
  .password-card .button-primary { width: 100%; }
  .empty-state { padding: 30px 8px; }
  .empty-state p { line-height: 1.7; }
  .form-error { overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
  .toast { max-width: calc(100% - 32px); width: max-content; bottom: calc(16px + env(safe-area-inset-bottom)); font-size: 14px; line-height: 1.5; text-align: center; }
  button, .assignment, .checkbox-row { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}
