:root {
    --paper: #fbfbfa;
    --surface: #ffffff;
    --ink: #262827;
    --muted: #737772;
    --faint: #9ca09b;
    --line: #dedfda;
    --line-strong: #c8cac4;
    --indigo: #506482;
    --indigo-dark: #3f526f;
    --indigo-soft: #edf0f4;
    --vermilion: #a84f43;
    --vermilion-soft: #f7eeec;
    --success: #526d5c;
    --success-soft: #edf3ef;
    --warning: #8a6a3c;
    --radius: 8px;
    --shadow: 0 18px 50px rgba(30, 34, 31, .055);
    --content: 1240px;
    --font-sans: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
    --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(80, 100, 130, .28); outline-offset: 3px; }

.site-header {
    width: min(var(--content), calc(100% - 64px));
    height: 92px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-word { font-family: var(--font-serif); font-size: 25px; font-weight: 700; letter-spacing: .15em; }
.brand-seal { position: relative; width: 22px; height: 22px; display: block; background: var(--vermilion); }
.brand-seal::before { content: ''; position: absolute; left: 10px; top: 5px; width: 2px; height: 12px; background: #fff; }
.brand-seal::after { content: ''; position: absolute; left: 7px; top: 5px; width: 7px; height: 7px; border-top: 2px solid #fff; border-left: 2px solid #fff; transform: rotate(45deg); }
.brand-seal span { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 1px; background: rgba(255,255,255,.72); }
.header-nav { display: flex; align-items: center; gap: 28px; color: var(--muted); font-size: 13px; letter-spacing: .08em; }
.header-nav form { margin: 0; }
.header-nav a, .text-button { transition: color .18s ease; }
.header-nav a:hover, .text-button:hover { color: var(--indigo-dark); }
.text-button, .link-button { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }

.home-shell { width: min(var(--content), calc(100% - 64px)); margin: 0 auto; padding: 76px 0 120px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr); gap: 110px; align-items: end; padding-bottom: 78px; border-bottom: 1px solid var(--line-strong); }
.section-number { margin: 0 0 18px; color: var(--vermilion); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.hero-main h1, .auth-intro h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(38px, 5vw, 66px); font-weight: 650; letter-spacing: .015em; line-height: 1.2; }
.hero-description { max-width: 660px; margin: 22px 0 50px; color: var(--muted); font-size: 17px; }
.overall-progress { max-width: 740px; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.progress-copy strong { font-family: var(--font-serif); font-size: 34px; font-weight: 650; color: var(--indigo-dark); }
.progress-copy span { color: var(--muted); font-size: 13px; }
.progress-track { overflow: hidden; background: #e8e9e5; }
.progress-track span { display: block; width: var(--progress); height: 100%; background: var(--indigo); transition: width .42s cubic-bezier(.2,.7,.2,1); }
.progress-track-large { height: 9px; }
.progress-track-thin { height: 2px; }
.next-panel { padding: 0 0 6px 34px; border-left: 2px solid var(--indigo); }
.next-panel h2 { margin: 6px 0 12px; font-family: var(--font-serif); font-size: 23px; line-height: 1.5; }
.next-panel > p:not(.section-number):not(.context-meta) { margin: 0 0 18px; color: var(--muted); }
.context-meta { margin: 0; color: var(--indigo); font-size: 12px; letter-spacing: .06em; }
.quiet-link { display: inline-block; color: var(--indigo-dark); font-size: 13px; border-bottom: 1px solid var(--indigo); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 104px; padding-top: 12px; }
.chapter { padding: 66px 0 10px; }
.chapter-header { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 27px; }
.chapter-header h2 { margin: 0; font-family: var(--font-serif); font-size: 29px; font-weight: 650; }
.chapter-header p:not(.section-number) { margin: 8px 0 0; color: var(--muted); }
.chapter-state { flex: 0 0 auto; text-align: right; }
.chapter-state span, .chapter-state strong { display: block; }
.chapter-state span { color: var(--muted); font-size: 12px; }
.chapter-state strong { margin-top: 5px; color: var(--indigo-dark); font-size: 12px; letter-spacing: .08em; }
.task-list { margin-top: 14px; }
.task-row { position: relative; min-height: 88px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px 10px 17px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .2s ease, opacity .2s ease, transform .24s ease; }
.task-row:hover { background: rgba(80,100,130,.035); }
.task-row.is-completed { opacity: .67; }
.task-row.is-completed .task-title { text-decoration: line-through; text-decoration-color: #aeb1ac; }
.task-row.is-paused { opacity: .52; cursor: not-allowed; }
.task-row.is-readonly { cursor: default; }
.readonly-check { width: 22px; height: 22px; display: block; border: 1px solid var(--line-strong); background: var(--surface); }
.readonly-check.is-checked { position: relative; border-color: var(--indigo); background: var(--indigo); }
.readonly-check.is-checked::after { content: ''; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checkbox-wrap { position: relative; width: 24px; height: 24px; display: block; }
.checkbox-wrap input { position: absolute; inset: 0; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: inherit; }
.custom-check { position: absolute; inset: 1px; border: 1px solid var(--line-strong); background: var(--surface); transition: background-color .18s ease, border-color .18s ease, transform .18s ease; }
.custom-check::after { content: ''; position: absolute; left: 6px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(.6); opacity: 0; transition: opacity .15s ease, transform .18s ease; }
.checkbox-wrap input:checked + .custom-check { background: var(--indigo); border-color: var(--indigo); }
.checkbox-wrap input:checked + .custom-check::after { opacity: 1; transform: rotate(45deg) scale(1); }
.checkbox-wrap input:focus-visible + .custom-check { outline: 3px solid rgba(80,100,130,.25); outline-offset: 3px; }
.task-body { display: block; min-width: 0; }
.task-title { display: block; font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.task-description { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.task-meta { display: flex; align-items: center; gap: 15px; color: var(--faint); font-size: 11px; white-space: nowrap; }
.level { position: relative; padding-left: 12px; }
.level::before { content: ''; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; background: var(--line-strong); transform: translateY(-50%); }
.level-minimum::before { background: var(--success); }
.level-standard::before { background: var(--indigo); }
.level-accelerated::before { background: var(--vermilion); }
.task-empty { margin: 22px 0 0; color: var(--muted); }

.recent-rail { align-self: start; margin-top: 68px; padding-top: 2px; }
.recent-item { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 0 0 24px; }
.recent-mark { width: 6px; height: 6px; margin-top: 9px; border: 1px solid var(--vermilion); }
.recent-item strong { display: block; font-size: 13px; line-height: 1.55; }
.recent-item span:not(.recent-mark) { display: block; margin-top: 5px; color: var(--faint); font-size: 11px; }
.rail-note { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--font-serif); font-size: 13px; line-height: 2; }
.muted { color: var(--muted); }

.notice { margin: 0 0 28px; padding: 12px 15px; border-left: 3px solid var(--indigo); background: var(--indigo-soft); color: var(--indigo-dark); font-size: 13px; }
.notice-success { border-color: var(--success); background: var(--success-soft); color: #3f5b48; }
.notice-error { border-color: var(--vermilion); background: var(--vermilion-soft); color: #813e35; }

.empty-state { max-width: 720px; padding: 68px 0; }
.empty-state h1, .empty-state h2 { margin: 0 0 18px; font-family: var(--font-serif); font-size: 42px; }
.empty-state p { margin: 0 0 30px; color: var(--muted); }
.inline-empty { padding: 72px 0 30px; }
.inline-empty h2 { font-size: 28px; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 650; letter-spacing: .04em; cursor: pointer; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--indigo); color: #fff; }
.button-primary:hover { background: var(--indigo-dark); }
.button-quiet { border-color: var(--line-strong); color: var(--muted); background: transparent; }
.button-quiet:hover { color: var(--ink); border-color: var(--ink); }

.auth-shell { width: min(1040px, calc(100% - 64px)); min-height: calc(100vh - 92px); margin: 0 auto; padding: 100px 0; display: grid; grid-template-columns: 1.1fr .72fr; gap: 130px; align-items: start; }
.auth-shell-compact { padding-top: 140px; }
.auth-intro h1 { font-size: clamp(40px, 5vw, 58px); }
.auth-intro > p:not(.section-number) { max-width: 560px; margin: 25px 0; color: var(--muted); font-size: 16px; }
.setup-notes { margin: 45px 0 0; padding: 27px 0 0 22px; border-top: 1px solid var(--line); color: var(--muted); }
.setup-notes li { margin: 8px 0; padding-left: 8px; }
.auth-form-wrap { padding: 34px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.auth-form-wrap h2, .editor-panel h2 { margin: 0 0 28px; font-family: var(--font-serif); font-size: 25px; }

.form-stack { display: grid; gap: 18px; }
.form-stack label, .inline-filter label { display: grid; gap: 7px; }
.form-stack label > span, .inline-filter label > span { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); transition: border-color .18s ease, box-shadow .18s ease; }
input, select { min-height: 44px; padding: 0 12px; }
textarea { resize: vertical; padding: 10px 12px; line-height: 1.65; }
input:hover, select:hover, textarea:hover { border-color: #aeb1ab; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); outline: 0; box-shadow: 0 0 0 3px rgba(80,100,130,.12); }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.admin-shell { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 90px; display: grid; grid-template-columns: 180px minmax(0, 1fr) 330px; gap: 44px; align-items: start; }
.admin-sidebar { position: sticky; top: 24px; min-height: calc(100vh - 140px); padding: 21px 24px 24px 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.admin-sidebar h1 { margin: 0; font-family: var(--font-serif); font-size: 23px; }
.admin-sidebar nav { display: grid; gap: 1px; margin-top: 46px; }
.admin-sidebar nav a { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 10px 0 18px; color: var(--muted); font-size: 13px; }
.admin-sidebar nav a::before { content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: 2px; background: transparent; }
.admin-sidebar nav a.is-active { color: var(--ink); font-weight: 700; }
.admin-sidebar nav a.is-active::before { background: var(--indigo); }
.admin-sidebar nav span { color: var(--faint); font-size: 11px; }
.sidebar-note { margin-top: auto; padding: 24px 8px 0 18px; border-top: 1px solid var(--line); }
.sidebar-note span { color: var(--vermilion); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.sidebar-note p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.admin-workspace { min-width: 0; padding-top: 15px; }
.workspace-header { min-height: 112px; display: flex; align-items: start; justify-content: space-between; gap: 30px; padding-bottom: 27px; border-bottom: 1px solid var(--line-strong); }
.workspace-header h2 { margin: 0; font-family: var(--font-serif); font-size: 31px; }
.workspace-header > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.inline-filter { min-width: 210px; }
.admin-list { display: grid; }
.admin-row { display: grid; align-items: center; gap: 18px; min-height: 108px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.admin-row-line { grid-template-columns: 32px minmax(0, 1fr) 78px auto; }
.admin-row-chapter { grid-template-columns: 32px 32px minmax(0, 1fr) 78px auto; }
.admin-row.is-current { box-shadow: inset 2px 0 var(--indigo); padding-left: 14px; }
.sort-controls { display: grid; gap: 4px; }
.sort-controls.horizontal { display: flex; }
.sort-controls form { margin: 0; }
.sort-controls button { width: 25px; height: 25px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; font-size: 11px; }
.sort-controls button:hover { border-color: var(--indigo); color: var(--indigo); }
.admin-row-main { min-width: 0; }
.admin-row-main h3, .row-title-line h3 { margin: 0; font-size: 14px; }
.admin-row-main p { margin: 5px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title-line { display: flex; align-items: center; gap: 11px; }
.current-mark { color: var(--vermilion); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.admin-row-index { color: var(--faint); font-family: var(--font-serif); font-size: 13px; }
.row-progress { text-align: right; }
.row-progress strong, .row-progress span { display: block; }
.row-progress strong { color: var(--indigo-dark); font-family: var(--font-serif); font-size: 20px; }
.row-progress span { color: var(--faint); font-size: 10px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 13px; color: var(--indigo-dark); font-size: 11px; white-space: nowrap; }
.row-actions form { margin: 0; }
.danger { color: var(--vermilion); }
.editor-panel { position: sticky; top: 24px; padding: 31px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.editor-panel .button { width: 100%; }
.admin-empty { padding: 70px 10px; text-align: center; }
.admin-empty h3 { margin: 0; font-family: var(--font-serif); font-size: 25px; }
.admin-empty p { color: var(--muted); }
.chapter-filter { display: flex; gap: 23px; overflow-x: auto; padding: 17px 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.chapter-filter a { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.chapter-filter a.is-active { color: var(--indigo-dark); font-weight: 700; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th { padding: 15px 9px; border-bottom: 1px solid var(--line-strong); color: var(--muted); text-align: left; font-weight: 650; white-space: nowrap; }
.admin-table td { padding: 16px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table td:nth-child(2) { min-width: 220px; }
.admin-table td > strong, .admin-table td > span { display: block; }
.admin-table td > span { margin-top: 3px; max-width: 300px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { width: max-content; padding-left: 10px; position: relative; }
.status::before { content: ''; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; transform: translateY(-50%); background: var(--indigo); }
.status-completed::before { background: var(--success); }
.status-paused::before { background: var(--warning); }
.table-empty { height: 160px; text-align: center; color: var(--muted); }

/* Shared navigation, selectors and motion */
.header-nav a { position: relative; padding: 8px 0; }
.header-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: var(--indigo); transition: right .22s ease; }
.header-nav a:hover::after, .header-nav a.is-active::after { right: 0; }
.header-nav a.is-active { color: var(--ink); font-weight: 700; }
.admin-header-nav { gap: 21px; }
.admin-header-nav form { margin-left: 4px; }
.hero-kicker-row { display: flex; align-items: center; gap: 18px; }
.edit-state { margin: 0 0 18px; color: var(--success); font-size: 11px; letter-spacing: .06em; }
.line-view-selector { width: min(340px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin: 0 0 26px; }
.line-view-selector label span { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.line-view-selector select { min-height: 40px; border-width: 0 0 1px; border-radius: 0; padding: 0 28px 0 0; background-color: transparent; color: var(--indigo-dark); font-size: 13px; font-weight: 650; }
.line-view-selector select:focus { box-shadow: none; border-color: var(--indigo); }
.line-view-selector.is-switching, .selector-cluster.is-switching { opacity: .58; pointer-events: none; }
.selector-cluster { display: flex; align-items: end; gap: 12px; min-width: min(440px, 100%); }
.selector-cluster label { flex: 1; }
.selector-cluster select { min-width: 180px; }
.site-footer { width: min(var(--content), calc(100% - 64px)); margin: 0 auto; padding: 28px 0 42px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.site-footer div { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px 22px; }
.site-footer a { transition: color .18s ease; }
.site-footer a:hover { color: var(--indigo-dark); }

/* Utility admin pages */
.utility-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; padding: 72px 0 110px; }
.narrow-utility { max-width: 840px; }
.utility-heading { max-width: 760px; margin-bottom: 50px; }
.utility-heading h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(36px, 5vw, 54px); line-height: 1.22; }
.utility-heading > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.settings-layout { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.settings-section { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.35fr); gap: 74px; padding: 44px 0; border-bottom: 1px solid var(--line); }
.settings-section h2 { margin: 0; font-family: var(--font-serif); font-size: 25px; }
.settings-section > div:first-child > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.switch-row { display: flex !important; grid-template-columns: 22px 1fr; align-items: center; gap: 12px !important; min-height: 38px; }
.switch-row input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--indigo); }
.switch-row span { color: var(--ink) !important; font-size: 13px !important; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 28px; }
.account-panel { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 66px; padding: 40px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.account-meta { padding-right: 30px; border-right: 1px solid var(--line); }
.account-meta span, .account-meta strong, .account-meta small { display: block; }
.account-meta span { color: var(--vermilion); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.account-meta strong { margin-top: 13px; font-family: var(--font-serif); font-size: 23px; }
.account-meta small { margin-top: 7px; color: var(--muted); }
.form-stack small { color: var(--faint); font-size: 10px; }
.password-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 10px; }
.password-divider::before, .password-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.import-intro, .upload-panel, .preview-summary { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 31px 34px; border: 1px solid var(--line); background: var(--surface); }
.import-intro h2, .preview-summary h2 { margin: 0; font-family: var(--font-serif); font-size: 24px; }
.import-intro p { margin: 6px 0 0; color: var(--muted); }
.upload-panel { margin-top: 24px; display: block; }
.file-drop { padding: 28px; border: 1px dashed var(--line-strong); background: var(--paper); }
.file-drop input { padding: 8px; background: transparent; }
.preview-summary { margin-top: 28px; border-left: 3px solid var(--success); }
.preview-summary.has-errors { border-left-color: var(--vermilion); }
.summary-counts { display: flex; gap: 28px; }
.summary-counts span { display: grid; text-align: center; color: var(--muted); font-size: 10px; }
.summary-counts strong { color: var(--indigo-dark); font-family: var(--font-serif); font-size: 27px; line-height: 1.2; }
.validation-errors { margin-top: 22px; padding: 24px 28px; border-left: 3px solid var(--vermilion); background: var(--vermilion-soft); }
.validation-errors h3 { margin: 0; font-size: 14px; }
.validation-errors ol { margin: 12px 0 0; padding-left: 22px; color: #813e35; font-size: 12px; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.preview-grid section { min-width: 0; padding: 25px; border-top: 2px solid var(--indigo); background: var(--surface); box-shadow: 0 10px 30px rgba(30,34,31,.04); }
.preview-grid h3 { margin: 0 0 18px; font-family: var(--font-serif); font-size: 20px; }
.preview-row { padding: 12px 0; border-top: 1px solid var(--line); }
.preview-row strong, .preview-row span { display: block; }
.preview-row strong { font-size: 12px; }
.preview-row span { margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.preview-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.preview-actions form { margin: 0; }

/* Motion system */
.page-enter { animation: pageEnter .42s cubic-bezier(.2,.7,.2,1) both; }
[data-reveal] { animation: revealEnter .48s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--reveal-order, 0) * 65ms); }
.is-route-switching main { opacity: .72; transform: translateY(2px); transition: opacity .16s ease, transform .16s ease; }
.notice { transition: opacity .2s ease, transform .2s ease; }
.toast-enter { animation: toastEnter .32s cubic-bezier(.2,.8,.2,1) both; }
.notice.is-leaving { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.task-row.is-saving { opacity: .54; }
.task-row.is-feedback { animation: taskFeedback .58s ease; }
.next-panel.content-updated { animation: contentUpdate .38s ease; }
.recent-item-enter { animation: recentEnter .32s ease both; animation-delay: calc(var(--item-order, 0) * 55ms); }
.admin-row.is-moved, .admin-table tr.is-moved { animation: rowMoved 1.1s ease both; }
.editor-panel, .account-panel, .upload-panel { animation: panelEnter .42s cubic-bezier(.2,.7,.2,1) both; }
form.is-submitting button[type="submit"] { opacity: .68; cursor: wait; }
form.is-submitting button[type="submit"]::after { content: ''; width: 11px; height: 11px; margin-left: 9px; border: 1px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes revealEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastEnter { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes taskFeedback { 0% { background: rgba(80,100,130,.11); transform: translateX(0); } 55% { transform: translateX(3px); } 100% { background: transparent; transform: translateX(0); } }
@keyframes contentUpdate { from { opacity: .58; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes recentEnter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rowMoved { 0%, 100% { background: transparent; } 18% { background: var(--indigo-soft); } }
@keyframes panelEnter { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
    .admin-shell { grid-template-columns: 150px minmax(0, 1fr); }
    .editor-panel { grid-column: 2; position: static; }
    .admin-sidebar { grid-row: span 2; }
    .hero-grid { gap: 60px; }
    .content-grid { gap: 60px; }
}

@media (max-width: 820px) {
    .site-header { width: min(100% - 36px, var(--content)); height: 72px; }
    .brand-word { font-size: 21px; }
    .brand-seal { width: 20px; height: 20px; }
    .home-shell { width: min(100% - 36px, var(--content)); padding: 48px 0 80px; }
    .hero-grid { grid-template-columns: 1fr; gap: 48px; padding-bottom: 54px; }
    .hero-main h1 { font-size: 41px; }
    .hero-description { margin: 18px 0 36px; font-size: 15px; }
    .next-panel { padding-left: 22px; }
    .content-grid { grid-template-columns: 1fr; gap: 38px; }
    .recent-rail { margin-top: 10px; padding: 27px 0 4px; border-top: 1px solid var(--line); }
    .recent-rail [data-recent-list] { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
    .rail-note { grid-column: 1 / -1; }
    .chapter { padding-top: 52px; }
    .task-row { grid-template-columns: 34px minmax(0, 1fr); }
    .task-meta { grid-column: 2; margin-top: -8px; justify-content: flex-start; }
    .auth-shell { width: min(100% - 36px, 1040px); grid-template-columns: 1fr; gap: 60px; padding: 66px 0 80px; }
    .auth-form-wrap { max-width: 520px; width: 100%; }
    .admin-shell { width: min(100% - 28px, 1500px); grid-template-columns: 1fr; gap: 24px; padding-top: 20px; }
    .admin-sidebar { position: static; min-height: 0; padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
    .admin-sidebar > div:first-child, .sidebar-note { display: none; }
    .admin-sidebar nav { display: flex; margin-top: 0; }
    .admin-sidebar nav a { flex: 1; justify-content: center; gap: 8px; padding: 0 10px; }
    .admin-sidebar nav a::before { left: 18%; right: 18%; top: auto; bottom: -19px; width: auto; height: 2px; }
    .admin-workspace, .editor-panel { grid-column: 1; }
    .editor-panel { position: static; }
    .admin-page .site-header { height: auto; min-height: 92px; align-items: flex-start; flex-direction: column; gap: 12px; padding: 18px 0; }
    .admin-header-nav { width: 100%; overflow-x: auto; gap: 20px; padding-bottom: 3px; scrollbar-width: none; }
    .admin-header-nav::-webkit-scrollbar { display: none; }
    .admin-header-nav a, .admin-header-nav form { flex: 0 0 auto; }
    .utility-shell { width: min(100% - 36px, 1120px); padding: 54px 0 80px; }
    .settings-section { grid-template-columns: 1fr; gap: 25px; }
    .account-panel { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
    .account-meta { padding: 0 0 24px; border-right: 0; border-bottom: 1px solid var(--line); }
    .preview-grid { grid-template-columns: 1fr; }
    .site-footer { width: min(100% - 36px, var(--content)); }
}

@media (max-width: 560px) {
    .header-nav { gap: 17px; font-size: 12px; }
    .home-shell { padding-top: 40px; }
    .section-number { margin-bottom: 13px; }
    .hero-grid { gap: 40px; }
    .hero-main h1 { font-size: 34px; line-height: 1.27; }
    .hero-description { margin-bottom: 30px; }
    .progress-copy strong { font-size: 29px; }
    .next-panel h2 { font-size: 20px; }
    .recent-rail [data-recent-list] { grid-template-columns: 1fr; }
    .chapter-header { align-items: start; gap: 20px; }
    .chapter-header h2 { font-size: 24px; }
    .chapter-header p:not(.section-number) { font-size: 12px; }
    .task-row { min-height: 96px; padding-right: 2px; }
    .task-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .task-meta { gap: 12px; }
    .auth-intro h1 { font-size: 36px; }
    .auth-form-wrap, .editor-panel { padding: 25px 20px; }
    .form-pair { grid-template-columns: 1fr; }
    .workspace-header { display: grid; }
    .inline-filter { min-width: 0; width: 100%; }
    .admin-row-line, .admin-row-chapter { grid-template-columns: 27px minmax(0, 1fr) auto; gap: 11px; }
    .admin-row-index { display: none; }
    .row-progress { grid-column: 3; }
    .row-actions { grid-column: 2 / -1; justify-content: flex-start; }
    .admin-row-main p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .hero-kicker-row { align-items: flex-start; justify-content: space-between; }
    .edit-state { max-width: 130px; text-align: right; }
    .line-view-selector { grid-template-columns: 1fr; gap: 3px; margin-bottom: 22px; }
    .selector-cluster { min-width: 0; width: 100%; display: grid; grid-template-columns: 1fr; }
    .selector-cluster select { min-width: 0; }
    .import-intro, .preview-summary { align-items: flex-start; flex-direction: column; padding: 25px 20px; }
    .summary-counts { width: 100%; justify-content: space-between; }
    .preview-actions { align-items: stretch; flex-direction: column; }
    .preview-actions .button { width: 100%; }
}

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