:root {
    color: #17223b;
    background: #f3f6fa;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #17223b;
    --muted: #718096;
    --line: #dfe5ee;
    --soft-line: #e9edf3;
    --paper: #ffffff;
    --canvas: #f3f6fa;
    --navy: #10233f;
    --blue: #315ff4;
    --blue-dark: #2449c9;
    --blue-soft: #edf2ff;
    --teal: #11856f;
    --amber: #b7791f;
    --danger: #c74b50;
    --shadow: 0 16px 48px rgb(33 48 78 / 8%);
    --front-color-primary: #3157f6;
    --front-color-primary-lighter: #a5b4fc;
    --front-color-primary-darker: #1e3a8a;
    --front-color-accent: #6b48ff;
    --front-color-primary-soft: #eef2ff;
    --front-color-primary-border: #dfe3ff;
    --front-color-success: #0f9f6e;
    --front-color-text-primary: #0f172a;
    --front-color-text-regular: #334155;
    --front-color-text-secondary: #64748b;
    --front-color-text-placeholder: #94a3b8;
    --front-color-text-disabled: #cbd5e1;
    --front-color-border: #e2e8f0;
    --front-color-border-light: #f1f5f9;
    --front-color-page: #f6f8fc;
    --front-color-surface: #ffffff;
    --front-color-surface-muted: #fafafa;
    --front-font-display: Inter, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --front-font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --front-font-size-xs: 12px;
    --front-font-size-sm: 13px;
    --front-font-size-base: 14px;
    --front-font-size-lg: 18px;
    --front-radius-pill: 9999px;
    --front-shadow-sm: 0 1px 2px rgb(0 0 0 / 5%);
    --front-shadow-card: 0 8px 26px rgb(15 23 42 / 4%);
    --front-transition-fast: 180ms ease;
    --front-page-min-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 1180px;
    background: var(--canvas);
}

body {
    margin: 0;
    min-width: 1180px;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgb(31 50 85 / 2%) 1px, transparent 1px) 0 0 / 36px 36px,
        var(--canvas);
    color: var(--ink);
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgb(49 95 244 / 24%);
    outline-offset: 2px;
} */

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-areas:
        'header header header'
        'sidebar main inspector';
    grid-template-columns: 224px minmax(680px, 1fr) 286px;
    grid-template-rows: 68px calc(100vh - 68px);
    min-width: 1180px;
    min-height: 100vh;
}

.top-bar {
    position: relative;
    z-index: 20;
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #dce3ec;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(14px);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-symbol {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px 3px 10px 3px;
    background: var(--navy);
    color: white;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 18px;
    box-shadow: 5px 5px 0 #dce6ff;
}

.brand-mark div {
    display: flex;
    flex-direction: column;
}

.brand-mark strong {
    font-size: 15px;
    letter-spacing: 0.02em;
}

.brand-mark small {
    color: #8a96aa;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.top-actions,
.proposal-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.top-action,
.icon-button,
.account-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.top-action {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    color: #5e6c81;
    font-size: 12px;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: #607087;
}

.account-button {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: 4px;
    padding: 5px 8px;
}

.account-button > span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.account-button strong {
    font-size: 12px;
}

.account-button small {
    color: var(--teal);
    font-size: 10px;
}

.side-bar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 23px 14px 18px;
    border-right: 1px solid #dce3ec;
    background: #f8fafc;
}

.side-section-label,
.rail-caption {
    padding: 0 10px 8px;
    color: #9aa6b8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.side-section-label--spaced {
    margin-top: 24px;
}

.side-navigation {
    display: grid;
    gap: 4px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 11px;
    border-radius: 8px;
    color: #66758b;
    font-size: 12px;
    font-weight: 600;
    transition: 160ms ease;
}

.side-link:hover {
    background: #eef2f7;
    color: var(--navy);
}

.side-link--active {
    position: relative;
    background: var(--navy);
    color: white;
    box-shadow: 0 9px 24px rgb(16 35 63 / 18%);
}

.side-link--active:hover {
    background: var(--navy);
    color: white;
}

.side-link--active::after {
    position: absolute;
    right: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8caffe;
    content: '';
}

.side-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.plan-card {
    padding: 13px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    background: white;
}

.plan-card span,
.plan-card strong {
    display: block;
}

.plan-card span {
    color: #8a97aa;
    font-size: 9px;
}

.plan-card strong {
    margin-top: 3px;
    font-size: 11px;
}

.plan-card div {
    height: 3px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 9px;
    background: #e8edf4;
}

.plan-card i {
    display: block;
    width: 68%;
    height: 100%;
    background: var(--blue);
}

.workspace-main {
    grid-area: main;
    min-width: 0;
    overflow-y: auto;
}

.project-inspector {
    grid-area: inspector;
    overflow-y: auto;
    padding: 22px 18px;
    border-left: 1px solid #dce3ec;
    background: #fbfcfe;
}

.inspector-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--soft-line);
}

.inspector-heading > span {
    color: #8e9bae;
    font-family: Georgia, serif;
    font-size: 9px;
    letter-spacing: 0.16em;
}

.inspector-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.paper-stack {
    position: relative;
    display: grid;
    width: 64px;
    height: 78px;
    margin-bottom: 20px;
    place-items: center;
    border: 1px solid #cad4e2;
    background: white;
    color: var(--blue);
    box-shadow: 7px 7px 0 #e3e9f2;
}

.paper-stack i {
    position: absolute;
    left: 12px;
    width: 22px;
    height: 1px;
    background: #d9e1eb;
}

.paper-stack i:first-child {
    top: 15px;
}

.paper-stack i:nth-child(2) {
    top: 21px;
}

.inspector-empty strong {
    font-size: 13px;
}

.inspector-empty p {
    max-width: 190px;
    margin: 7px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.dossier-title {
    padding: 21px 0 18px;
    border-bottom: 1px solid var(--soft-line);
}

.dossier-code {
    color: var(--blue);
    font-family: Georgia, serif;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.dossier-title h2 {
    margin: 8px 0 7px;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 18px;
    line-height: 1.5;
}

.dossier-title p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.fact-list {
    padding: 12px 0;
}

.fact-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e2e7ee;
}

.fact-row span {
    color: #8390a3;
    font-size: 10px;
}

.fact-row strong {
    max-width: 150px;
    font-size: 10px;
    text-align: right;
}

.fact-row .fact-missing {
    color: var(--amber);
}

.inspector-note {
    margin-top: 12px;
    padding: 13px;
    border-left: 3px solid var(--blue);
    background: var(--blue-soft);
}

.inspector-note span {
    color: var(--blue-dark);
    font-size: 9px;
    font-weight: 800;
}

.inspector-note p {
    margin: 5px 0 0;
    color: #5e6e87;
    font-size: 10px;
    line-height: 1.65;
}

.page {
    width: min(1120px, calc(100% - 52px));
    margin: 0 auto;
    padding: 4px 0 18px;
}

.page-heading,
.compact-heading,
.proposal-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-heading {
    padding-bottom: 25px;
    border-bottom: 1px solid #dce3ec;
}

.eyebrow,
.section-kicker,
.stage-heading > span,
.demo-stage > span {
    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-heading h1,
.compact-heading h1,
.proposal-header h1 {
    margin: 6px 0 6px;
    color: var(--navy);
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-heading p,
.compact-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.heading-date {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    column-gap: 8px;
    min-width: 92px;
    padding-left: 18px;
    border-left: 1px solid #d9e0e9;
}

.heading-date span,
.heading-date small {
    color: #8794a7;
    font-family: Georgia, serif;
    font-size: 9px;
}

.heading-date strong {
    grid-row: 1 / 3;
    grid-column: 2;
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 400;
}

.launch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.launch-card {
    position: relative;
    min-height: 200px;
    overflow: hidden;
    padding: 24px;
    border: 1px solid #dbe2eb;
    border-radius: 4px 18px 4px 18px;
    background: white;
    box-shadow: var(--shadow);
    transition: 180ms ease;
}

.launch-card:hover {
    transform: translateY(-2px);
    border-color: #bac9ee;
}

.launch-card--primary {
    border-color: var(--navy);
    background: var(--navy);
    color: white;
}

.launch-index {
    position: absolute;
    right: 18px;
    top: 8px;
    color: rgb(86 108 145 / 22%);
    font-family: Georgia, serif;
    font-size: 72px;
    line-height: 1;
}

.launch-card--primary .launch-index {
    color: rgb(255 255 255 / 7%);
}

.launch-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #dce4ee;
    border-radius: 10px 3px 10px 3px;
    color: var(--blue);
}

.launch-card--primary .launch-icon {
    border-color: rgb(255 255 255 / 22%);
    color: #9bb7ff;
}

.launch-card h2 {
    margin: 20px 0 7px;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 20px;
}

.launch-card p {
    max-width: 400px;
    margin: 0;
    color: #738197;
    font-size: 11px;
    line-height: 1.7;
}

.launch-card--primary p {
    color: #aebbd0;
}

.launch-card > span:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
}

.launch-card--primary > span:last-child {
    color: #a9c1ff;
}

.dashboard-section {
    margin-top: 30px;
}

.section-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.section-title-row h2 {
    margin: 3px 0 0;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 19px;
}

.text-link,
.row-action,
.history-card-foot a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
}

.project-table {
    margin-top: 13px;
    overflow: hidden;
    border: 1px solid #dde4ed;
    border-radius: 4px 12px 4px 12px;
    background: white;
}

.project-table-head,
.project-table-row {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) 84px 140px 80px 54px;
    align-items: center;
    gap: 14px;
}

.project-table-head {
    padding: 10px 15px;
    border-bottom: 1px solid #e5eaf1;
    background: #f8fafc;
    color: #8c98a9;
    font-size: 9px;
}

.project-table-row {
    min-height: 70px;
    padding: 10px 15px;
    border-bottom: 1px solid #edf0f4;
}

.project-table-row:last-child {
    border-bottom: 0;
}

.project-name-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.project-type-icon {
    display: grid;
    width: 31px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #d8e0ec;
    background: #f8faff;
    color: var(--blue);
    font-family: 'Songti SC', serif;
    font-size: 12px;
}

.project-name-cell div {
    min-width: 0;
}

.project-name-cell strong,
.project-name-cell small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-name-cell strong {
    font-size: 11px;
}

.project-name-cell small {
    margin-top: 3px;
    color: #8a96a7;
    font-size: 9px;
}

.status-badge {
    display: inline-flex;
    width: max-content;
    align-items: center;
    padding: 3px 7px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
}

.status-badge--draft {
    background: #edf0f4;
    color: #6f7b8d;
}

.status-badge--generating {
    background: #edf2ff;
    color: var(--blue);
}

.status-badge--reviewing {
    background: #fff5df;
    color: var(--amber);
}

.status-badge--ready {
    background: #e9f8f3;
    color: var(--teal);
}

.status-badge--archived {
    background: #eef0f7;
    color: #57627a;
}

.progress-cell {
    display: flex;
    align-items: center;
    gap: 7px;
}

.progress-cell > div,
.history-progress > div {
    height: 3px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8edf3;
}

.progress-cell > div {
    width: 88px;
}

.progress-cell i,
.history-progress i {
    display: block;
    height: 100%;
    background: var(--blue);
}

.progress-cell span,
.updated-cell {
    color: #8490a2;
    font-size: 9px;
}

.dashboard-foot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr auto;
    gap: 10px;
    margin-top: 18px;
}

.metric-card,
.quick-add {
    min-height: 76px;
    border: 1px solid #dde4ed;
    border-radius: 4px 10px 4px 10px;
    background: white;
}

.metric-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px 10px;
    padding: 13px;
    color: var(--blue);
}

.metric-card > span {
    color: #8491a3;
    font-size: 9px;
}

.metric-card > strong {
    grid-column: 1 / 3;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 500;
}

.metric-card strong small {
    color: #8491a3;
    font-family: inherit;
    font-size: 9px;
}

.metric-card--note {
    display: flex;
    background: #f7f9fd;
}

.metric-card--note strong,
.metric-card--note span {
    display: block;
}

.metric-card--note strong {
    color: var(--ink);
    font-size: 10px;
}

.metric-card--note span {
    margin-top: 4px;
    color: #7d899b;
    font-size: 9px;
}

.quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 18px;
    border-style: dashed;
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
}

.compact-heading,
.proposal-header {
    min-height: 74px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dce3ec;
}

.compact-heading h1,
.proposal-header h1 {
    font-size: 27px;
}

.draft-state,
.save-state {
    color: var(--teal);
    font-size: 9px;
    font-weight: 700;
}

.draft-state::before,
.save-state::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--teal);
    content: '';
}

.workflow-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 570px;
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid #dbe2eb;
    border-radius: 4px 14px 4px 14px;
    background: white;
    box-shadow: var(--shadow);
}

.step-rail {
    padding: 24px 13px;
    border-right: 1px solid #e2e7ee;
    background: #f8fafc;
}

.step-item {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a0b2;
    text-align: left;
}

.step-item > span {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dce3ec;
    border-radius: 50%;
    background: white;
    font-family: Georgia, serif;
    font-size: 9px;
}

.step-item strong,
.step-item small {
    display: block;
}

.step-item strong {
    color: inherit;
    font-size: 11px;
}

.step-item small {
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.5;
}

.step-item--active {
    background: var(--navy);
    color: white;
}

.step-item--active > span {
    border-color: #7188b0;
    background: #223a5f;
}

.step-item--done {
    color: #55657c;
    cursor: pointer;
}

.step-item--done > span {
    border-color: #b8ddd3;
    background: #e7f6f2;
    color: var(--teal);
}

.stage-panel {
    padding: 34px 40px;
}

.stage-heading h2,
.demo-stage h2 {
    margin: 7px 0 8px;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 25px;
}

.stage-heading p,
.demo-stage > p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 28px;
}

.field {
    display: grid;
    gap: 7px;
}

.field--wide {
    grid-column: 1 / 3;
}

.field > span {
    font-size: 10px;
    font-weight: 700;
}

.field input,
.field select,
.history-tools input {
    width: 100%;
    height: 42px;
    border: 1px solid #dce3ec;
    border-radius: 7px;
    background: #fbfcfe;
    font-size: 11px;
}

.field input,
.field select {
    padding: 0 12px;
}

.field small {
    min-height: 13px;
    color: var(--danger);
    font-size: 8px;
}

.stage-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 17px;
    border-top: 1px solid #e6eaf0;
}

.stage-actions > span {
    color: #8a96a8;
    font-size: 9px;
}

.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: var(--navy);
    color: white;
    box-shadow: 0 8px 18px rgb(16 35 63 / 14%);
}

.button--secondary {
    border-color: #d9e1eb;
    background: white;
    color: #56667e;
}

.demo-stage {
    display: flex;
    min-height: 470px;
    flex-direction: column;
    justify-content: center;
}

.ai-orbit {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    place-items: center;
    border: 1px solid #cbd8f5;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    box-shadow: 0 0 0 9px #f5f7ff;
}

.demo-result-card {
    margin-top: 25px;
    padding: 18px;
    border: 1px solid #dbe3ef;
    border-left: 3px solid var(--blue);
    background: #fbfcff;
}

.demo-result-card strong,
.demo-result-card span {
    display: block;
}

.demo-result-card strong {
    font-family: 'Songti SC', serif;
    font-size: 15px;
}

.demo-result-card span {
    margin-top: 6px;
    color: var(--teal);
    font-size: 9px;
}

.demo-result-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.proposal-page {
    min-width: 960px;
    min-height: 100%;
    background: #eef2f6;
}

.proposal-header {
    min-height: 86px;
    padding: 16px 22px;
    background: white;
}

.editor-layout {
    display: grid;
    grid-template-columns: 164px minmax(430px, 1fr) 286px;
    height: calc(100vh - 154px);
    min-height: 570px;
}

.chapter-panel,
.ai-panel {
    overflow-y: auto;
    background: white;
}

.chapter-panel {
    padding: 18px 11px;
    border-right: 1px solid #dce3ec;
}

.chapter-panel-title {
    padding: 0 8px 14px;
}

.chapter-panel-title span,
.chapter-panel-title strong {
    display: block;
}

.chapter-panel-title span {
    color: #9aa6b8;
    font-family: Georgia, serif;
    font-size: 8px;
    letter-spacing: 0.12em;
}

.chapter-panel-title strong {
    margin-top: 5px;
    font-size: 11px;
}

.chapter-item {
    display: grid;
    width: 100%;
    grid-template-columns: 23px 1fr 6px;
    align-items: center;
    gap: 6px;
    padding: 10px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.chapter-item > span {
    color: #a2adbc;
    font-family: Georgia, serif;
    font-size: 9px;
}

.chapter-item strong,
.chapter-item small {
    display: block;
}

.chapter-item strong {
    font-size: 9px;
}

.chapter-item small {
    margin-top: 3px;
    color: #909cad;
    font-size: 7px;
}

.chapter-item--active {
    background: var(--blue-soft);
}

.chapter-item--active strong {
    color: var(--blue-dark);
}

.chapter-state {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1d8e1;
}

.chapter-state--generated,
.chapter-state--confirmed {
    background: var(--teal);
}

.chapter-state--generating {
    background: var(--blue);
    box-shadow: 0 0 0 3px #dfe7ff;
}

.add-chapter {
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    border: 1px dashed #cdd6e2;
    background: transparent;
    color: #78869a;
    font-size: 8px;
    cursor: pointer;
}

.document-editor {
    overflow-y: auto;
}

.editor-toolbar {
    position: sticky;
    z-index: 3;
    top: 0;
    display: flex;
    height: 44px;
    align-items: center;
    gap: 9px;
    padding: 0 15px;
    border-bottom: 1px solid #dce3ec;
    background: white;
}

.editor-toolbar > div {
    display: flex;
    gap: 2px;
    padding-right: 8px;
    border-right: 1px solid #e1e6ec;
}

.editor-toolbar button {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748a;
}

.editor-toolbar > span {
    margin-left: auto;
    color: #8a97aa;
    font-size: 8px;
}

.paper-editor {
    width: min(620px, calc(100% - 34px));
    min-height: 760px;
    margin: 24px auto 50px;
    padding: 44px 46px;
    background: white;
    box-shadow: 0 5px 26px rgb(39 52 73 / 10%);
}

.paper-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--navy);
    font-family: 'Songti SC', serif;
    font-size: 9px;
}

.paper-meta small {
    color: #8b96a6;
    font-family: sans-serif;
    font-size: 7px;
}

.paper-editor h2 {
    margin: 34px 0 18px;
    font-family: 'Songti SC', serif;
    font-size: 17px;
    text-align: center;
}

.paper-editor > textarea {
    width: 100%;
    min-height: 420px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Songti SC', 'STSong', serif;
    font-size: 12px;
    line-height: 2.1;
    text-align: justify;
}

.citation-line {
    padding-top: 13px;
    border-top: 1px solid #e3e7ec;
    color: #788496;
    font-family: 'Songti SC', serif;
    font-size: 8px;
}

.ai-panel {
    padding: 18px 13px;
    border-left: 1px solid #dce3ec;
}

.ai-panel-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e7ee;
}

.ai-clear-button {
    display: grid;
    width: 26px;
    height: 26px;
    margin-left: auto;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #8b97a9;
    cursor: pointer;
}

.ai-clear-button:hover {
    background: #eef2f7;
    color: var(--navy);
}

.ai-icon {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border-radius: 8px;
    background: var(--navy);
    color: #a9c0ff;
}

.ai-panel-heading strong,
.ai-panel-heading span {
    display: block;
}

.ai-panel-heading strong {
    font-size: 10px;
}

.ai-panel-heading span {
    margin-top: 2px;
    color: #8b97a9;
    font-size: 7px;
}

.ai-context-card {
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #dce5f8;
    background: #f4f7ff;
}

.ai-context-card span,
.ai-context-card strong {
    display: block;
}

.ai-context-card span {
    color: var(--blue);
    font-size: 7px;
    font-weight: 800;
}

.ai-context-card strong {
    margin-top: 4px;
    font-size: 9px;
}

.ai-context-card p {
    margin: 6px 0 0;
    color: #728098;
    font-size: 8px;
    line-height: 1.6;
}

.ai-actions-list {
    display: grid;
    gap: 6px;
    margin-top: 14px;
}

.ai-actions-list button {
    padding: 10px;
    border: 1px solid #e0e5ec;
    border-radius: 5px;
    background: white;
    text-align: left;
    cursor: pointer;
}

.ai-actions-list b,
.ai-actions-list span {
    display: block;
}

.ai-actions-list b {
    font-size: 9px;
}

.ai-actions-list span {
    margin-top: 2px;
    color: #8d98a8;
    font-size: 7px;
}

.ai-prompt-box {
    display: block;
    margin-top: 16px;
    padding: 10px;
    border: 1px solid #d9e1eb;
    background: #fbfcfe;
}

.ai-message-list {
    display: grid;
    max-height: calc(100vh - 430px);
    min-height: 180px;
    gap: 9px;
    margin: 14px -4px 0;
    padding: 0 4px 5px;
    overflow-y: auto;
}

.ai-message {
    width: fit-content;
    max-width: 94%;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 8px;
    line-height: 1.7;
}

.ai-message p,
.ai-message ol,
.ai-message ul {
    margin: 0;
}

.ai-message p + p,
.ai-message ol,
.ai-message ul {
    margin-top: 6px;
}

.ai-message ol,
.ai-message ul {
    padding-left: 16px;
}

.ai-message--user {
    margin-left: auto;
    border-radius: 7px 7px 2px 7px;
    background: var(--navy);
    color: white;
}

.ai-message--assistant {
    border: 1px solid #dde5ef;
    border-radius: 7px 7px 7px 2px;
    background: white;
    color: #425168;
}

.ai-message--streaming {
    border-color: #cfdafa;
    box-shadow: inset 2px 0 0 var(--blue);
}

.ai-message--error,
.ai-message--cancelled {
    border-color: #f0d6d6;
    background: #fffafa;
}

.ai-message-placeholder {
    color: #8b97a9;
}

.ai-message-error {
    margin-top: 5px;
    color: #b45353;
}

.ai-citations {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px dashed #dce3ec;
}

.ai-citations span {
    color: var(--blue-dark);
    font-size: 7px;
}

.ai-apply-button {
    margin-top: 8px;
    padding: 5px 7px;
    border: 1px solid #cdd9f6;
    border-radius: 4px;
    background: #eef3ff;
    color: var(--blue-dark);
    font-size: 7px;
    font-weight: 700;
    cursor: pointer;
}

.ai-stream-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #78869a;
    font-size: 7px;
}

.ai-stream-status i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 3px #dfe7ff;
    animation: ai-pulse 900ms ease-in-out infinite alternate;
}

@keyframes ai-pulse {
    to {
        opacity: 0.35;
    }
}

.ai-prompt-box > span {
    font-size: 8px;
    font-weight: 700;
}

.ai-prompt-box textarea {
    width: 100%;
    height: 76px;
    margin-top: 7px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 8px;
    line-height: 1.6;
}

.ai-prompt-box > small {
    display: block;
    margin: 2px 0 7px;
    color: #9aa5b4;
    font-size: 6px;
    text-align: right;
}

.ai-prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.ai-prompt-actions button {
    display: flex;
    min-width: 76px;
    height: 29px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 5px;
    background: var(--navy);
    color: white;
    font-size: 8px;
    cursor: pointer;
}

.ai-prompt-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ai-prompt-actions .ai-retry-button {
    border: 1px solid #d9e1eb;
    background: white;
    color: #5d6a7e;
}

.app-error {
    display: grid;
    min-height: 100vh;
    place-content: center;
    padding: 40px;
    background: #f4f7fb;
    color: var(--navy);
    text-align: center;
}

.app-error span {
    color: var(--blue);
    font-family: Georgia, serif;
    font-size: 11px;
    letter-spacing: 0.12em;
}

.app-error h1 {
    margin: 10px 0 6px;
    font-size: 28px;
}

.app-error p {
    margin: 0;
    color: #738096;
    font-size: 13px;
}

.app-error button {
    width: max-content;
    margin: 20px auto 0;
    padding: 10px 18px;
    border: 0;
    border-radius: 6px;
    background: var(--navy);
    color: white;
    cursor: pointer;
}

.route-loading {
    display: grid;
    min-height: 55vh;
    place-items: center;
    background: #f4f7fb;
    color: #768399;
    font-size: 12px;
}

.history-tools {
    display: flex;
    gap: 9px;
    margin: 18px 0;
}

.history-tools label {
    display: flex;
    width: 320px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid #dce3ec;
    border-radius: 7px;
    background: white;
    color: #8490a3;
}

.history-tools input {
    height: 36px;
    border: 0;
    outline: 0;
    background: transparent;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.history-card {
    padding: 19px;
    border: 1px solid #dce3ec;
    border-radius: 4px 12px 4px 12px;
    background: white;
}

.history-card-top,
.history-card-foot,
.history-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-card-top > span,
.history-card-foot > span {
    color: #8c98aa;
    font-family: Georgia, serif;
    font-size: 8px;
}

.history-card h2 {
    min-height: 48px;
    margin: 20px 0 6px;
    font-family: 'Songti SC', serif;
    font-size: 16px;
    line-height: 1.5;
}

.history-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.history-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 20px;
    font-size: 9px;
}

.history-progress > div {
    grid-column: 1 / 3;
}

.history-card-foot {
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid #e8ecf1;
}

.not-found-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--canvas);
}

.not-found-page > span {
    color: #dce4ef;
    font-family: Georgia, serif;
    font-size: 100px;
}

.not-found-page h1 {
    margin: -20px 0 5px;
    font-family: 'Songti SC', serif;
}

.not-found-page p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 11px;
}

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