:root {
  --ink: #17233c;
  --muted: #718096;
  --line: #e7ebf2;
  --paper: #f7f9fc;
  --blue: #4f6df5;
  --blue-soft: #eef1ff;
  --green: #1d9b72;
  --orange: #e59b39;
}
.auth-page { min-height: 100vh; background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 52%, #f3f7ff 100%); }
.auth-shell { width: min(100% - 32px, 470px); margin: 0 auto; padding: 58px 0; }
.auth-brand { align-items: center; gap: 10px; color: #182641; font-size: 22px; font-weight: 800; letter-spacing: .02em; margin-bottom: 28px; }
.auth-brand small { display: block; color: #8a96aa; font-size: 11px; font-weight: 600; letter-spacing: 0; margin-top: 2px; }
.auth-card { border: 0; border-radius: 18px; box-shadow: 0 16px 44px rgba(32, 52, 110, .1); }

body { background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: .92rem; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #304ccc; }
.app-shell { min-height: 100vh; }
.sidebar { width: 240px; min-height: 100vh; background: #fff; border-right: 1px solid var(--line); position: fixed; left: 0; top: 0; z-index: 10; }
.brand { height: 76px; padding: 20px 23px; font-weight: 800; letter-spacing: .02em; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #6f82ff, #4059d8); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-right: 9px; box-shadow: 0 8px 16px rgba(79,109,245,.22); }
.brand small { display: block; margin-left: 44px; color: #a0abc0; font-size: 10px; font-weight: 500; margin-top: -5px; }
.sidebar-section { color: #a1abbb; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 19px 23px 8px; }
.side-nav { padding: 0 12px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; color: #637087; font-weight: 600; margin-bottom: 3px; }
.side-nav a:hover, .side-nav a.active { color: var(--blue); background: var(--blue-soft); }
.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.main { margin-left: 240px; min-height: 100vh; }
.topbar { height: 76px; padding: 0 38px; background: rgba(247,249,252,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-weight: 700; font-size: 15px; }
.project-switcher { min-width: 210px; }
.content { padding: 34px 38px 60px; max-width: 1540px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .16em; font-size: 10px; font-weight: 800; }
h1 { font-size: 27px; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 750; }
.text-muted { color: var(--muted) !important; }
.card { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 18px rgba(27,46,82,.025); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: 17px 20px; border-radius: 14px 14px 0 0 !important; }
.card-body { padding: 20px; }
.stat-card { padding: 19px 20px; height: 100%; background: #fff; }
.stat-icon { width: 37px; height: 37px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 16px; }
.stat-number { font-size: 25px; font-weight: 800; letter-spacing: -.03em; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 3px; }
.soft-blue { background: #eef1ff; color: #536be6; }
.soft-green { background: #e8f8f1; color: #1d9b72; }
.soft-orange { background: #fff4e4; color: #d58e2e; }
.soft-purple { background: #f2edff; color: #8564d8; }
.progress { height: 7px; border-radius: 99px; background: #edf0f6; }
.progress-bar { border-radius: 99px; background: var(--blue); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.btn { border-radius: 8px; font-weight: 650; font-size: 12px; padding: 8px 13px; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: #4059d8; border-color: #4059d8; }
.btn-light { border-color: var(--line); background: #fff; color: #65728a; }
.btn-outline-primary { border-color: #cad3ff; color: var(--blue); }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 14px 12px; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { color: #9aa5b8; font-size: 11px; font-weight: 700; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.badge { font-weight: 650; padding: 5px 8px; }
.tag { background: #f1f3f8; color: #6f7b90; border-radius: 5px; padding: 3px 7px; display: inline-block; font-size: 11px; margin: 2px; }
.literature-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: #f0f2ff; color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.paper-title { font-weight: 700; color: var(--ink); line-height: 1.4; }
.paper-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.star { color: #e5a135; letter-spacing: -2px; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; border-radius: 17px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 15px; }
.form-label { color: #637087; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.form-control, .form-select { border-color: #dfe4ee; border-radius: 8px; font-size: 13px; padding: 9px 11px; }
.form-control:focus, .form-select:focus { border-color: #aebaff; box-shadow: 0 0 0 .2rem rgba(79,109,245,.12); }
.form-check { padding-top: 30px; }
.form-check-label { font-size: 13px; color: #637087; }
.form-help { font-size: 11px; color: #9aa5b8; }
.form-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.framework-node { border-left: 2px solid #dfe4ff; padding-left: 19px; margin-left: 15px; padding-bottom: 12px; }
.framework-node:last-child { padding-bottom: 0; }
.node-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: inline-block; margin-left: -25px; margin-right: 11px; box-shadow: 0 0 0 4px #eef1ff; }
.node-dot.done { background: var(--green); box-shadow: 0 0 0 4px #e8f8f1; }
.chapter-card { padding: 17px 19px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.evidence-quote { border-left: 3px solid #c5ceff; padding: 9px 14px; color: #59677f; background: #f8f9ff; font-size: 13px; line-height: 1.7; }
.quote-meta { color: #9aa5b8; font-size: 11px; margin-top: 8px; }
.filter-bar { background: #fff; border: 1px solid var(--line); padding: 13px; border-radius: 12px; }
.filter-bar .form-control, .filter-bar .form-select { border: 0; background: #f6f8fb; }
.matrix-cell { font-size: 12px; font-weight: 700; }
.matrix-good { color: var(--green); }
.matrix-empty { color: #b5bdca; }
.task-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-status-editor { min-width: 172px; text-align: right; }
.task-status-editor form { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.task-status-select { min-width: 132px; }
.task-status-save { background: var(--blue); border-color: var(--blue); }
.task-status-save:hover, .task-status-save:focus { background: #394ec2; border-color: #394ec2; }
.task-due-date { min-width: 112px; padding-top: 3px; text-align: left; }
.chapter-tasks { border-top: 1px solid var(--line); padding-top: 16px; }
.chapter-task-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; background: #fafbfe; margin-top: 6px; font-size: 12px; }
.chapter-task-row a { color: #384760; font-weight: 650; }
.task-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #b8c1d1; }
.task-dot.writing { background: #edaf46; }
.task-dot.done { background: #36a879; }
.task-check { width: 20px; height: 20px; border: 1px solid #cdd5e4; border-radius: 6px; background: #fff; color: white; display: inline-flex; align-items: center; justify-content: center; }
.task-check.checked { background: var(--green); border-color: var(--green); }
.priority-high { color: #dd6b54; background: #fff0ed; }
.priority-medium { color: #c68a2a; background: #fff5e5; }
.priority-low { color: #6c7b93; background: #f0f3f7; }
.detail-label { color: #9aa5b8; font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.detail-value { color: #384760; line-height: 1.7; white-space: pre-line; }
.side-stat { padding: 13px 0; border-bottom: 1px solid var(--line); }
.side-stat:last-child { border-bottom: 0; }
.mobile-menu { display: none; }
.paper-hero { border: 0; overflow: hidden; background: linear-gradient(116deg, #334ec5 0%, #6879eb 52%, #8e9cf2 100%); box-shadow: 0 10px 24px rgba(67,86,211,.14); }
.paper-hero-icon { width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.17); font-size: 21px; }
.paper-hero-description { line-height: 1.1; font-size: 5px; max-width: 720px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-hero-side { background: rgba(20,37,130,.18); border: 1px 
  solid rgba(255,255,255,.16); border-radius: 12px; padding: 14px 16px; }
.paper-file-chip { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; padding: 7px 10px; font-size: 12px; }
.sync-alert { color: #73510d; background: #fff7e7; border: 1px solid #f4dfad; border-radius: 12px; padding: 12px 15px; }
.chapter-nav { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.chapter-nav a { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 8px; color: #59677f; font-size: 12px; font-weight: 650; line-height: 1.35; }
.chapter-nav a:hover { color: var(--blue); background: var(--blue-soft); }
.chapter-nav .child-nav { padding-left: 25px; color: #8994a7; font-size: 11px; font-weight: 500; }
.chapter-nav-number { color: var(--blue); min-width: 28px; font-size: 11px; font-weight: 800; }
.chapter-nav-dot { width: 5px; height: 5px; background: #b9c2d5; border-radius: 50%; flex: 0 0 auto; }
.chapter-level-label { color: #a0aabc; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 7px 3px; }
.child-section { margin-left: 28px; }
.child-section .chapter-level-label { color: #b1a6d8; }
.child-chapters summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; list-style: none; padding: 7px 0 0 22px; }
.child-chapters summary::-webkit-details-marker { display: none; }
.child-chapters[open] summary i { display: inline-block; transform: rotate(90deg); }
.child-chapters-body { padding-top: 3px; }
.chapter-work-card { border-radius: 14px; transition: box-shadow .2s, transform .2s; }
.chapter-work-card:hover { box-shadow: 0 8px 24px rgba(27,46,82,.08); transform: translateY(-1px); }
.chapter-index { min-width: 46px; height: 46px; padding: 0 7px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: #eef1ff; color: var(--blue); font-size: 12px; font-weight: 800; }
.chapter-index.done { background: #e8f8f1; color: var(--green); }
.chapter-title { font-size: 18px; }
.chapter-progress-editor .progress { min-width: 100px; }
.chapter-progress-range { width: 150px; flex: 0 0 150px; margin: 0; }
.progress-number { width: 64px; flex: 0 0 64px; }
.literature-status-form { display: flex; align-items: center; gap: 5px; min-width: 118px; }
.literature-status-form .form-select { min-width: 78px; }
.literature-status-select { font-weight: 700; }
.literature-status-select.status-unread { color: #667085; background-color: #f1f3f5; border-color: #d9dee7; }
.literature-status-select.status-reading { color: #8a5a00; background-color: #fff3cd; border-color: #ffdf85; }
.literature-status-select.status-read { color: #18704f; background-color: #d1e7dd; border-color: #9ed1b8; }
.literature-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.literature-table-wrap { overflow-x: auto; }
.literature-table { min-width: 1360px; table-layout: fixed; }
.literature-table .literature-col { width: 340px; }
.literature-table .article-number-col { width: 150px; }
.literature-table .topic-col { width: 115px; }
.literature-table .method-col { width: 220px; }
.literature-table .status-col { width: 160px; }
.literature-table .importance-col { width: 100px; }
.literature-table .evidence-col { width: 90px; }
.literature-table .actions-col { width: 185px; }
.literature-table > :not(caption) > * > * { padding: 18px 14px; }
.literature-table thead { background: #fafbff; }
.literature-table tbody tr { transition: background .15s; }
.literature-table tbody tr:hover { background: #fbfcff; }
.literature-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.literature-title-block { min-width: 0; }
.literature-title-block .paper-title { display: block; overflow-wrap: anywhere; }
.literature-title-block .paper-meta { line-height: 1.5; overflow-wrap: anywhere; }
.literature-table .literature-status-form { min-width: 0; }
.literature-table .literature-status-select { width: 84px; min-width: 84px; flex: 0 0 84px; padding-left: 8px; padding-right: 24px; }
.literature-status-save { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); background: var(--blue-soft); border: 1px solid #d9e0ff; border-radius: 50%; font-size: 12px; }
.literature-status-save:hover, .literature-status-save:focus { color: #fff; background: var(--blue); border-color: var(--blue); }
.literature-table .literature-actions .btn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.form-stack-row { padding-top: 13px; padding-bottom: 13px; border-top: 1px solid var(--line); }
.form-stack-row:first-child { margin-top: 8px; }
.chapter-materials { border-top: 1px solid var(--line); padding-top: 16px; }
.linked-literature { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; background: #fafbfe; margin-top: 6px; font-size: 12px; }
.relation-note { margin-left: auto; color: #8994a7; background: #f0f2f7; padding: 3px 7px; border-radius: 5px; font-size: 11px; }
.empty-material { color: #a0aabc; padding: 10px; background: #fafbfe; border-radius: 8px; font-size: 12px; }
.association-editor { border-top: 1px dashed #dfe4ee; padding-top: 13px; }
.association-editor summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; list-style: none; }
.association-editor summary::-webkit-details-marker { display: none; }
.association-grid { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 5px 12px; }
.association-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid #f0f2f6; }
.association-row:last-child { border-bottom: 0; }
.relation-input { width: 205px; flex: 0 0 205px; }
.upload-drop { text-align: center; padding: 38px 22px; border: 1px dashed #cbd4ee; border-radius: 14px; background: #fafbff; }
.upload-icon { width: 62px; height: 62px; border-radius: 19px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue); font-size: 28px; margin-bottom: 13px; }
.parse-points { background: #f8f9fd; border-radius: 12px; padding: 15px 17px; }
.parse-points div { display: flex; gap: 9px; align-items: center; padding: 7px 0; color: #637087; font-size: 12px; }
.upload-limit { color: #8b96a9; background: #fafbfe; border-radius: 8px; padding: 9px 11px; font-size: 11px; }
.parse-warning { color: #806016; background: #fff8e8; border: 1px solid #f7e5b5; border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; font-size: 12px; line-height: 1.55; }
.parse-success { color: #197454; background: #effaf5; border: 1px solid #d2f0e3; border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; font-size: 12px; }
.source-preview { color: #68758b; background: #fafbfe; border-radius: 8px; padding: 12px; max-height: 310px; overflow: auto; white-space: pre-line; font-size: 11px; line-height: 1.7; }
.sync-item { padding: 15px 22px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.sync-item:hover { background: #fafbff; }
.sync-item:last-child { border-bottom: 0; }
.sync-child { padding-left: 67px; background: #fcfcff; }
.sync-level { width: 32px; text-align: center; color: #8390a9; font-size: 10px; }
.sync-number { min-width: 48px; color: var(--blue); font-size: 12px; font-weight: 800; }
.sync-checkbox { width: 17px; height: 17px; }
.sync-list { max-height: 620px; overflow-y: auto; }
.sync-edit-item { display: flex; align-items: center; gap: 11px; padding: 11px 22px; border-bottom: 1px solid var(--line); transition: background .15s, opacity .15s; }
.sync-edit-item:hover { background: #fafbff; }
.sync-edit-item:last-child { border-bottom: 0; }
.sync-edit-item.sync-child { padding-left: 58px; background: #fcfcff; }
.sync-edit-item.dragging { opacity: .45; background: var(--blue-soft); }
.drag-handle { color: #a0aabc; cursor: grab; font-size: 18px; line-height: 1; }
.drag-handle:active { cursor: grabbing; }
.level-select { width: 78px; flex: 0 0 78px; }
.sync-edit-title { min-width: 180px; flex: 1 1 280px; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .content { padding: 25px 18px 50px; }
  .mobile-menu { display: inline-flex; }
  .relation-input { width: 100%; flex-basis: 100%; }
  .association-row { align-items: flex-start; flex-wrap: wrap; }
  .child-section { margin-left: 0; }
  .chapter-progress-editor > .d-flex { flex-wrap: wrap; }
  .chapter-progress-editor .progress { flex-basis: 100%; order: 2; }
  .chapter-progress-range { flex: 1 1 130px; width: auto; order: 3; }
  .progress-number, .chapter-progress-editor .btn, .chapter-progress-editor .badge { order: 3; }
  .sync-edit-item, .sync-edit-item.sync-child { padding: 10px 14px; flex-wrap: wrap; }
  .sync-edit-title { flex-basis: calc(100% - 48px); margin-left: 37px; }
  .task-status-editor { min-width: 100%; order: 3; display: flex; align-items: center; gap: 10px; }
  .task-status-editor form { margin-bottom: 0; }
  .task-due-date { order: 3; min-width: 0; margin-left: auto; }
}
