:root {
  --ink: #17243c;
  --muted: #66738b;
  --navy: #243d72;
  --blue: #315fbd;
  --blue-dark: #204997;
  --blue-soft: #edf3ff;
  --cyan: #38a5b8;
  --green: #2d9974;
  --green-soft: #e8f7f1;
  --amber: #c8811d;
  --amber-soft: #fff4df;
  --red: #b74357;
  --red-soft: #fff0f3;
  --border: #dce3ef;
  --surface: #fff;
  --bg: #f4f7fb;
  --shadow: 0 14px 38px rgba(27, 50, 93, .10);
  --radius: 22px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { touch-action: manipulation; }

.site-header {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 76px; padding: 11px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(218, 225, 239, .9); background: rgba(255, 255, 255, .94); backdrop-filter: blur(15px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark, .login-logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: linear-gradient(145deg, var(--navy), var(--blue)); font: 800 24px "STKaiti", "KaiTi", serif; box-shadow: 0 9px 22px rgba(36, 61, 114, .25); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.site-header nav { display: flex; align-items: center; gap: 10px; }
.site-header nav a, .link-button { min-height: 42px; padding: 10px 14px; border: 0; border-radius: 12px; background: transparent; color: #52627d; font-weight: 750; cursor: pointer; }
.site-header nav a:hover, .link-button:hover { background: var(--blue-soft); color: var(--blue-dark); }
.site-header .primary-link { background: var(--navy); color: #fff; }
.site-header nav form { margin: 0; }

.page-shell { width: min(1240px, calc(100% - 36px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 34px 0 64px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 20px 0 34px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.login-page { display: grid; place-items: center; width: 100%; min-height: 100vh; padding: 30px 18px; background: radial-gradient(circle at 15% 10%, #dce9ff, transparent 34rem), radial-gradient(circle at 90% 90%, #d9f2f0, transparent 30rem), #f7f9fd; }
.login-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 28px; background: #fff; box-shadow: 0 24px 70px rgba(31, 52, 94, .16); }
.login-logo { width: 62px; height: 62px; margin-bottom: 22px; border-radius: 19px; font-size: 30px; }
.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.login-card > p { margin: 0 0 25px; color: var(--muted); line-height: 1.7; }
.login-card > small { display: block; margin-top: 18px; color: var(--muted); line-height: 1.6; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 19px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 9px 20px rgba(49, 95, 189, .18); font-weight: 800; cursor: pointer; }
.button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.button.ghost { color: var(--blue-dark); background: var(--blue-soft); box-shadow: none; }
.button.small { min-height: 38px; padding: 0 13px; font-size: 13px; }
.button.full { width: 100%; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: #eef1f6; color: #63708a; cursor: pointer; }
.icon-button.danger:hover { color: var(--red); background: var(--red-soft); }
.text-link, .back-link { color: var(--blue); font-weight: 800; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 13px; }

.dashboard-hero { display: grid; grid-template-columns: 1.4fr .6fr; gap: 30px; padding: 42px; border-radius: 30px; color: #fff; background: radial-gradient(circle at 88% 14%, rgba(255,255,255,.16), transparent 18rem), linear-gradient(135deg, #213868, #315fbd 62%, #2f98aa); box-shadow: 0 24px 60px rgba(34, 62, 119, .22); }
.eyebrow { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: #2a59ac; background: var(--blue-soft); font-size: 12px; font-weight: 850; }
.dashboard-hero .eyebrow { color: #fff; background: rgba(255,255,255,.15); }
.dashboard-hero h1 { max-width: 720px; margin: 17px 0 12px; font-size: clamp(32px, 5vw, 50px); line-height: 1.2; letter-spacing: -.03em; }
.dashboard-hero > div > p { max-width: 680px; margin: 0 0 25px; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.8; }
.dashboard-hero .button { color: #203b75; background: #fff; box-shadow: none; }
.hero-card { align-self: center; padding: 25px; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: rgba(255,255,255,.1); }
.hero-card strong { font-size: 18px; }
.hero-card ol { display: grid; gap: 11px; margin: 16px 0 0; padding-left: 22px; color: rgba(255,255,255,.86); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0 36px; }
.stats-grid article { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(30,53,94,.06); }
.stats-grid span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.stats-grid strong { font-size: 29px; }
.stats-grid small { margin-left: 4px; color: var(--muted); }
.section-heading, .page-heading, .project-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading { margin: 24px 0 16px; }
.section-heading h2, .page-heading h1, .project-heading h1 { margin: 0; }
.section-heading p, .page-heading p, .project-heading p { margin: 6px 0 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card, .form-card, .wizard-aside article, .meta-card, .editor-main, .section-nav, .support-card, .paper-preview, .check-card, .export-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.project-card { padding: 24px; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.type-badge, .count-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: #2b569f; background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.project-card h3 { min-height: 54px; margin: 18px 0 8px; font-size: 21px; line-height: 1.4; }
.project-card > p { color: var(--muted); font-size: 13px; }
.progress-label { display: flex; justify-content: space-between; margin: 18px 0 7px; font-size: 12px; }
progress { overflow: hidden; width: 100%; height: 10px; border: 0; border-radius: 999px; background: #e9edf5; }
progress::-webkit-progress-bar { background: #e9edf5; }
progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
progress::-moz-progress-bar { background: var(--blue); }
.project-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.project-actions form { margin-left: auto; }
.empty-state { padding: 60px 24px; border: 2px dashed #ccd6e7; border-radius: 24px; text-align: center; }
.empty-state > span { font-size: 48px; }
.empty-state h2 { margin: 10px 0 6px; }
.empty-state p { color: var(--muted); }

.page-heading, .project-heading { margin-bottom: 24px; }
.page-heading h1, .project-heading h1 { font-size: clamp(27px, 4vw, 38px); }
.project-heading .type-badge { margin-bottom: 8px; }
.heading-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.wizard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.form-card { padding: 30px; }
.form-card h2 { display: flex; align-items: center; gap: 10px; margin: 5px 0 18px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 21px; }
.form-card h2:first-of-type { padding-top: 0; border-top: 0; }
.form-card h2 > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #fff; background: var(--navy); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 22px; }
.field-grid.compact { margin: 20px 0 0; }
.field-grid label, .stack-form label, .asset-form label, .reference-form label, .writing-area { display: grid; gap: 7px; color: #41516d; font-size: 13px; font-weight: 750; }
.field-grid .wide, .asset-form .wide, .reference-form .wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e5; border-radius: 11px; background: #fff; color: var(--ink); }
input, select { min-height: 44px; padding: 9px 11px; }
textarea { padding: 16px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(49,95,189,.14); border-color: var(--blue); }
label small { color: var(--muted); font-weight: 500; line-height: 1.5; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 25px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card > span { display: block; min-height: 88px; padding: 16px; border: 2px solid var(--border); border-radius: 15px; cursor: pointer; }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 6px; color: var(--muted); }
.choice-card input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.checkbox-card { display: flex !important; align-items: flex-start; gap: 11px !important; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: #fafcff; }
.checkbox-card input, .check-inline input { flex: 0 0 auto; width: 20px; min-height: 20px; height: 20px; margin-top: 2px; }
.checkbox-card strong, .checkbox-card small { display: block; }
.wizard-aside { position: sticky; top: 98px; display: grid; gap: 15px; }
.wizard-aside article { padding: 22px; }
.wizard-aside h3 { margin: 10px 0; }
.wizard-aside ul { display: grid; gap: 9px; padding-left: 20px; color: var(--muted); line-height: 1.5; }
.aside-icon { font-size: 32px; }
.wizard-aside .tip-card { background: var(--amber-soft); }
.tip-card strong { color: #8e5c14; }
.tip-card p { margin: 8px 0 0; color: #795f37; line-height: 1.6; }
.validation, [data-valmsg-for]:not(:empty) { color: var(--red); font-size: 12px; }

.notice { margin-bottom: 18px; padding: 13px 15px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-dark); }
.notice.success { background: var(--green-soft); color: #236f56; }
.notice.danger { background: var(--red-soft); color: var(--red); }
.overall-progress { margin-bottom: 18px; padding: 17px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--border); }
.overall-progress > div { display: flex; justify-content: space-between; margin-bottom: 8px; }
.meta-card { margin-bottom: 20px; padding: 0 22px 20px; box-shadow: 0 8px 22px rgba(30,53,94,.06); }
.meta-card summary { padding: 17px 0; cursor: pointer; font-weight: 800; }
.meta-card summary span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; }
.editor-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.section-nav { position: sticky; top: 96px; overflow: hidden; padding: 10px; box-shadow: 0 8px 24px rgba(30,53,94,.07); }
.section-nav-title { padding: 13px 12px 10px; }
.section-nav-title strong, .section-nav-title small { display: block; }
.section-nav-title small { margin-top: 3px; color: var(--muted); }
.section-nav > a { display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: center; padding: 10px; border-radius: 12px; }
.section-nav > a:hover, .section-nav > a.active { background: var(--blue-soft); }
.section-nav > a.active strong { color: var(--blue-dark); }
.section-nav > a strong, .section-nav > a small { display: block; }
.section-nav > a strong { font-size: 13px; line-height: 1.4; }
.section-nav > a small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.section-state { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: #6d7b91; background: #edf0f5; font-size: 12px; font-weight: 850; }
.section-state.done { color: #fff; background: var(--green); }
.reference-count { display: flex; justify-content: space-between; margin: 10px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.editor-main { padding: 26px; }
.editor-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.editor-title h2 { margin: 8px 0 0; font-size: 27px; }
.word-target { text-align: right; }
.word-target strong { font-size: 30px; }
.word-target span { color: var(--muted); }
.guidance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.guidance-grid article { display: flex; gap: 10px; padding: 15px; border-radius: 15px; background: #f5f8fd; }
.guidance-grid article:nth-child(2) { background: var(--amber-soft); }
.guidance-grid article:nth-child(3) { background: var(--green-soft); }
.guidance-grid strong { font-size: 13px; }
.guidance-grid p { margin: 5px 0 0; color: #586780; font-size: 12px; line-height: 1.65; }
.writing-area > span { font-size: 14px; }
.writing-area textarea { min-height: 520px; border-radius: 16px; font-size: 16px; line-height: 1.9; }
.save-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.save-bar > span { min-width: 125px; }
.mini-progress { overflow: hidden; flex: 1; height: 6px; border-radius: 999px; background: #e9edf5; }
.mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s; }

.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.support-card { padding: 22px; }
.support-card .section-heading { margin-top: 0; }
.asset-form, .reference-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 15px; border-radius: 15px; background: #f6f8fc; }
.check-inline { display: flex !important; align-items: center; gap: 8px !important; }
.item-list, .reference-list { display: grid; gap: 9px; margin: 15px 0 0; padding: 0; }
.list-item, .reference-list li { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border-bottom: 1px solid var(--border); }
.list-item > div, .reference-list li > div { flex: 1; min-width: 0; }
.list-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.asset-type { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 800; }
.reference-list { list-style-position: inside; }
.reference-list li { font-size: 12px; line-height: 1.6; }
.reference-list form { margin-left: auto; }
.verify { display: inline-flex; margin-right: 6px; padding: 2px 6px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 9px; }
.verify.ok { color: var(--green); background: var(--green-soft); }
.muted-empty { padding: 18px; color: var(--muted); text-align: center; font-size: 12px; }

.paper-preview { width: min(900px, 100%); margin: 0 auto; padding: 70px 78px; font-family: "SimSun", "宋体", serif; }
.paper-preview > h1 { margin: 0 0 18px; font: 700 26px "SimHei", "黑体", sans-serif; line-height: 1.5; text-align: center; }
.paper-authors, .paper-organization { margin: 7px 0; text-align: center; }
.paper-organization { margin-bottom: 25px; font-size: 13px; }
.paper-preview h2 { margin: 24px 0 10px; font: 700 18px "SimHei", "黑体", sans-serif; }
.paper-preview p { margin: 0 0 10px; font-size: 15px; line-height: 1.9; text-align: justify; text-indent: 2em; }
.paper-preview .abstract, .paper-preview .keywords { text-indent: 0; }
.paper-preview .english-title { text-align: center; }
.placeholder { color: var(--red); }
.asset-placeholder { display: grid; gap: 4px; margin: 16px 0; padding: 16px; border: 1px dashed #9eadc4; border-radius: 10px; color: #50607b; text-align: center; font-size: 12px; }
.paper-references { display: grid; gap: 7px; padding-left: 26px; font-size: 13px; line-height: 1.6; }

.review-hero { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 28px; margin-bottom: 20px; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #993f50, #cb7043); }
.review-hero.medium { background: linear-gradient(135deg, #886022, #d49a39); }
.review-hero.good { background: linear-gradient(135deg, #276b60, #36a480); }
.score-ring { display: grid; place-items: center; width: 130px; height: 130px; border: 10px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(255,255,255,.1); }
.score-ring strong, .score-ring span { display: block; text-align: center; }
.score-ring strong { font-size: 43px; }
.score-ring span { margin-top: -22px; font-size: 11px; }
.review-hero .eyebrow { color: #fff; background: rgba(255,255,255,.14); }
.review-hero h2 { margin: 10px 0 6px; }
.review-hero p { margin: 0; color: rgba(255,255,255,.82); }
.blocking-card { margin-bottom: 20px; padding: 22px; border: 1px solid #efc7ce; border-radius: 18px; background: var(--red-soft); }
.blocking-card h2 { margin-top: 0; color: #94384a; }
.blocking-card li { margin: 7px 0; }
.blocking-card p { margin-bottom: 0; color: var(--muted); }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.check-card { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 18px; box-shadow: 0 8px 22px rgba(30,53,94,.06); }
.check-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--amber); background: var(--amber-soft); font-weight: 900; }
.check-card.passed .check-icon { color: var(--green); background: var(--green-soft); }
.check-title { display: flex; justify-content: space-between; gap: 12px; }
.check-title h3 { margin: 0; font-size: 16px; }
.check-title strong { color: var(--blue); }
.check-card p { margin: 6px 0; color: #4d5c74; font-size: 13px; }
.check-card small { color: var(--muted); line-height: 1.5; }
.export-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 22px; }
.export-card > div { display: flex; align-items: center; gap: 15px; }
.export-card h2 { margin: 0 0 5px; }
.export-card p { margin: 0; color: var(--muted); }
.export-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; color: #fff; background: #2457a6; font: 800 28px Georgia, serif; }

@media (max-width: 950px) {
  .dashboard-hero, .wizard-grid, .editor-layout { grid-template-columns: 1fr; }
  .wizard-aside, .section-nav { position: static; }
  .section-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .section-nav-title, .reference-count { grid-column: 1 / -1; }
  .guidance-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header { position: static; display: block; padding: 13px 16px; }
  .brand { justify-content: center; }
  .site-header nav { margin-top: 11px; justify-content: center; }
  .site-header nav a, .link-button { padding: 8px 9px; font-size: 12px; }
  .page-shell { width: min(100% - 22px, 1240px); padding-top: 20px; }
  .dashboard-hero { padding: 27px 22px; }
  .dashboard-hero h1 { font-size: 31px; }
  .hero-card { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .project-grid, .field-grid, .choice-grid, .check-grid { grid-template-columns: 1fr; }
  .project-heading, .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .form-card, .editor-main, .support-card { padding: 18px; }
  .field-grid .wide, .asset-form .wide, .reference-form .wide { grid-column: auto; }
  .section-nav { grid-template-columns: 1fr; }
  .section-nav-title, .reference-count { grid-column: auto; }
  .editor-title { align-items: flex-start; }
  .word-target strong { font-size: 25px; }
  .writing-area textarea { min-height: 430px; }
  .asset-form, .reference-form { grid-template-columns: 1fr; }
  .paper-preview { padding: 34px 22px; }
  .review-hero { grid-template-columns: 1fr; text-align: center; }
  .score-ring { margin: auto; }
  .export-card, .export-card > div { align-items: flex-start; flex-direction: column; }
  .export-card .button { width: 100%; }
  .site-footer { flex-direction: column; }
}

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