:root {
  --ink: #152b36;
  --ink-soft: #435b66;
  --muted: #71848c;
  --navy: #123746;
  --navy-deep: #0b2732;
  --teal: #147d78;
  --teal-soft: #e5f5f2;
  --coral: #d86b4b;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #dce7e5;
  --line-strong: #bfd2cf;
  --green: #25815f;
  --red: #b54b42;
  --amber: #a96820;
  --shadow: 0 16px 44px rgba(17, 50, 61, .08);
  --radius: 18px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(20,125,120,.08), transparent 26rem),
    linear-gradient(180deg, #f7f8f4 0, #fbfaf6 420px);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--navy); }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 7px 18px rgba(20,125,120,.18);
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
  flex-shrink: 0;
}
button:hover, .button:hover { color: #fff; background: #116b67; }
button.secondary, .button.secondary {
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
button.secondary:hover, .button.secondary:hover { background: var(--teal-soft); }
button.small, .button.small { min-height: 34px; padding: 7px 13px; font-size: 13px; }
.link-button {
  min-height: auto;
  padding: 4px 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
.link-button:hover { color: var(--red); background: transparent; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fff;
  padding: 11px 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20,125,120,.11);
}
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--teal); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 10px max(24px, 4vw);
  color: #eef8f6;
  background: rgba(11,39,50,.96);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark, .login-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--navy-deep);
  background: #d4efea;
  font-family: "Songti SC", serif;
  font-size: 23px;
  font-weight: 900;
}
.brand strong, .brand small, .account-chip strong, .account-chip small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .03em; }
.brand small { color: #96b2b7; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: #bad0d3;
  font-size: 13px;
  font-weight: 650;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.account-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.account-chip > span:nth-child(2) { min-width: 88px; }
.account-chip small { color: #8fa9ae; font-size: 10px; }
.account-chip a { color: #bad0d3; }
.role-tag {
  padding: 4px 8px;
  border: 1px solid rgba(216,107,75,.45);
  border-radius: 999px;
  color: #ffc3ad;
  font-size: 10px;
  font-weight: 800;
}
.account-chip form { margin: 0; }

.page {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 64px;
}
.panel {
  padding: 24px;
  border: 1px solid rgba(184,205,201,.72);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-block;
  color: var(--coral);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.muted, .empty { color: var(--muted); }
.empty { padding: 22px; text-align: center; }
.ok-text { color: var(--green); font-weight: 800; }
.alert {
  margin: 0 0 18px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
}
.alert.success { color: #176347; background: #e8f7ef; border: 1px solid #bde5d1; }
.alert.error { color: #913c35; background: #fff0ee; border: 1px solid #f2c8c3; }
.alert.error span { display: block; margin-top: 4px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: "Songti SC", "STSong", serif; font-size: clamp(30px, 3.1vw, 48px); line-height: 1.12; letter-spacing: -.025em; }
h2 { margin: 5px 0 12px; font-size: 21px; letter-spacing: -.01em; }
h3 { margin-bottom: 8px; font-size: 16px; }

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  min-height: 220px;
  margin-bottom: 20px;
  padding: 36px 40px;
  overflow: hidden;
  border-radius: 26px;
  color: #ecf8f6;
  background:
    radial-gradient(circle at 82% 0, rgba(226,147,102,.22), transparent 20rem),
    linear-gradient(135deg, var(--navy-deep), #165160);
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -185px;
  width: 410px;
  height: 410px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(255,255,255,.035), 0 0 0 126px rgba(255,255,255,.025);
}
.hero > * { position: relative; z-index: 1; }
.hero p { max-width: 690px; margin-bottom: 0; color: #b8d1d2; font-size: 15px; }
.hero h1 { margin: 8px 0 12px; color: #fff; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .button { color: var(--navy-deep); background: #d8f0eb; box-shadow: none; }
.hero .button.secondary { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.24); }
.student-hero { min-height: 180px; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metric-grid article {
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.88);
}
.metric-grid article span, .metric-grid article small { display: block; color: var(--muted); font-size: 11px; }
.metric-grid article strong { display: block; margin: 6px 0 4px; color: var(--navy); font-family: "Songti SC", serif; font-size: 34px; line-height: 1.05; }
.metric-grid article strong.text-value { font-family: inherit; font-size: 18px; line-height: 1.5; }
.compact-metrics article { min-height: 98px; }

.section-head, .page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}
.section-head h2 { margin-bottom: 0; }
.section-head small { color: var(--muted); }
.page-heading { align-items: flex-end; margin: 8px 0 22px; }
.page-heading h1 { margin: 5px 0 6px; font-size: 37px; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions, .form-action { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.text-link { font-weight: 800; font-size: 13px; }

.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 790px; }
th {
  padding: 11px 13px;
  color: var(--muted);
  background: #f3f7f5;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 14px 13px;
  border-bottom: 1px solid #edf2f0;
  font-size: 13px;
  vertical-align: middle;
}
tbody tr:hover { background: #fbfdfc; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.check-col { width: 34px; }
.is-disabled { opacity: .56; }
.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid #c6ded9;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.muted-pill { color: var(--muted); background: #f1f4f3; border-color: #dfe6e3; }
.inline-search { display: flex; gap: 8px; align-items: center; }
.inline-search input { min-width: 250px; }
.inline-search select { min-width: 150px; }
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--muted);
  background: #f5f8f6;
  font-size: 11px;
}
.bulk-bar span { flex: 1; }
.bulk-bar select { width: auto; min-width: 130px; padding: 7px 10px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.span-two { grid-column: 1 / -1; }
.stack-form { display: grid; gap: 14px; }
.compact-form { margin-top: 16px; }
.create-panel { margin-top: 18px; padding: 0; overflow: hidden; }
.create-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  padding: 20px 24px;
  cursor: pointer;
}
.create-panel summary::-webkit-details-marker { display: none; }
.create-panel summary span, .create-panel summary small { display: block; }
.create-panel summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.create-panel summary i { color: var(--teal); font-size: 12px; font-style: normal; font-weight: 800; }
.create-panel .form-grid { padding: 0 24px 24px; border-top: 1px solid var(--line); padding-top: 20px; }

.credential-card {
  margin-bottom: 20px;
  padding: 22px 26px;
  border: 1px solid #e6bc74;
  border-radius: var(--radius);
  background: #fff9e9;
}
.credential-card.inset { box-shadow: none; }
.credential-card h2 { margin-bottom: 12px; }
.credential-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.credential-line span { color: var(--muted); font-size: 12px; }
code { padding: 5px 8px; border-radius: 7px; color: #fff; background: var(--navy); font-family: "SFMono-Regular", Consolas, monospace; }
.credential-card p { margin: 0; color: #816424; font-size: 12px; }
.credential-table { display: grid; gap: 7px; margin-bottom: 12px; }
.credential-table > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.7); }

.student-stage-grid { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px; }
.stage-card h2 { font-size: 27px; }
.stage-card p { color: var(--muted); }
.stage-track { display: grid; grid-template-columns: repeat(7,1fr); gap: 0; margin-top: 28px; }
.stage-track > div { position: relative; display: grid; justify-items: center; gap: 8px; color: #9aa9ac; font-size: 10px; text-align: center; }
.stage-track > div::before { content: ""; position: absolute; top: 5px; left: 0; width: 100%; height: 2px; background: #e2e9e7; }
.stage-track > div:first-child::before { left: 50%; width: 50%; }
.stage-track > div:last-child::before { width: 50%; }
.stage-track i { position: relative; z-index: 1; width: 12px; height: 12px; border: 2px solid #cbd8d5; border-radius: 50%; background: #fff; }
.stage-track .done i, .stage-track .active i { border-color: var(--teal); background: var(--teal); box-shadow: 0 0 0 4px rgba(20,125,120,.1); }
.stage-track .done::before, .stage-track .active::before { background: var(--teal); }
.stage-track .active { color: var(--navy); font-weight: 850; }
.compact-stat { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-content: center; }
.compact-stat span { color: var(--muted); font-size: 12px; }
.compact-stat strong { color: var(--navy); text-align: right; }

.paper-hero {
  display: flex;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 18px;
  padding: 28px 32px;
  border-radius: 23px;
  color: #fff;
  background: linear-gradient(135deg, #123746, #1a5b66);
}
.paper-hero h1 { max-width: 920px; margin: 7px 0 14px; color: #fff; font-size: 34px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-row span { padding: 5px 9px; border-radius: 999px; color: #c4d7d8; background: rgba(255,255,255,.08); font-size: 11px; }
.paper-state { display: grid; justify-items: end; align-content: center; min-width: 160px; }
.paper-state small, .paper-state span { color: #aac4c7; font-size: 11px; }
.paper-state strong { margin: 5px 0; color: #effaf7; font-size: 21px; }
.paper-main-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 16px; align-items: start; }
.paper-content { display: grid; gap: 16px; }
.paper-sidebar { display: grid; gap: 16px; position: sticky; top: 96px; }
.paper-sidebar .panel { padding: 20px; }
.info-list { display: grid; grid-template-columns: 78px 1fr; gap: 9px 12px; margin: 15px 0 0; font-size: 12px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 650; text-align: right; }

.version-card { padding: 18px 0; border-top: 1px solid var(--line); }
.version-head { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; }
.version-number { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--teal); background: var(--teal-soft); font-weight: 900; }
.version-head h3 { margin: 0 0 3px; }
.version-head p, .checksum { margin: 0; color: var(--muted); font-size: 10px; }
.version-note { display: grid; grid-template-columns: 75px 1fr; gap: 12px; margin: 12px 0; padding: 11px 13px; border-radius: 10px; background: #f4f8f6; font-size: 12px; }
.version-note b { color: var(--muted); }
.checksum { font-family: monospace; word-break: break-all; }
.annotation-entry { margin-top: 12px; }
.annotation-entry summary { color: var(--teal); cursor: pointer; font-size: 12px; font-weight: 800; }
.annotation-entry form { margin-top: 14px; padding: 15px; border-radius: 12px; background: #f5f9f7; }
.upload-card {
  display: grid;
  gap: 13px;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #f8fbfa;
}
.upload-card h3 { margin-bottom: 0; }
.file-drop { padding: 15px; border: 1px dashed #b8cfcb; border-radius: 11px; background: #fff; }
.file-drop input { margin-top: 6px; padding: 0; border: 0; }
.locked-note { margin-top: 14px; padding: 12px 14px; border-radius: 10px; color: var(--muted); background: #f2f5f4; font-size: 12px; }

.annotation-list { display: grid; gap: 12px; }
.annotation-card {
  padding: 16px;
  border: 1px solid #dfe9e6;
  border-left: 4px solid var(--coral);
  border-radius: 12px;
  background: #fff;
}
.annotation-card.resolved { border-left-color: var(--green); background: #fbfdfc; }
.annotation-card header, .annotation-card footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.annotation-card h3 { margin: 10px 0 7px; }
.annotation-card p { color: var(--ink-soft); }
.annotation-card footer { padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.tag { display: inline-block; margin-right: 5px; padding: 3px 7px; border-radius: 6px; color: var(--teal); background: var(--teal-soft); font-size: 9px; font-weight: 800; }
.severity-重要 { color: #a84438; background: #fff0ee; }
.severity-建议 { color: #52706d; background: #eef4f2; }
.resolved-line { display: block; margin-top: 7px; color: var(--green); }
.annotation-card form { margin-top: 9px; }

.conversation {
  display: grid;
  gap: 10px;
  max-height: 480px;
  min-height: 150px;
  padding: 14px;
  overflow-y: auto;
  border-radius: 14px;
  background: #f3f7f5;
}
.message-row { display: flex; }
.message-row.mine { justify-content: flex-end; }
.message-bubble { max-width: 72%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #fff; }
.message-row.mine .message-bubble { border-color: #b9ddd8; border-radius: 15px 15px 4px 15px; background: #e1f4f0; }
.message-bubble strong { color: var(--teal); font-size: 10px; }
.message-bubble p { margin: 4px 0; white-space: pre-wrap; }
.message-bubble small { color: var(--muted); font-size: 9px; }
.message-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }

.mini-timeline { display: grid; gap: 0; }
.mini-timeline article { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 9px; padding-bottom: 16px; }
.mini-timeline article > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.mini-timeline article:not(:last-child)::before { content: ""; position: absolute; top: 12px; bottom: 0; left: 3.5px; border-left: 1px solid var(--line); }
.mini-timeline p { margin: 3px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.mini-timeline small { color: #97a5a6; font-size: 9px; }

.audit-list { display: grid; }
.audit-list article { display: grid; grid-template-columns: 34px 1fr; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); }
.audit-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-size: 12px; font-weight: 900; }
.audit-list p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.audit-list small { color: #94a3a3; font-size: 10px; }

.import-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); gap: 16px; margin-bottom: 18px; }
.field-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: fields; }
.field-list li { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.field-list span { color: var(--muted); }

.auth-form-card { max-width: 560px; margin: 36px auto; }
.login-body { min-height: 100vh; background: #0b2732; }
.login-shell { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(340px,.65fr); width: min(1180px, calc(100% - 40px)); min-height: 680px; margin: 6vh auto; overflow: hidden; border-radius: 30px; background: #f8f8f3; box-shadow: 0 35px 90px rgba(0,0,0,.3); }
.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 18%, rgba(216,107,75,.28), transparent 22rem),
    linear-gradient(140deg, #102f3b, #175765);
}
.login-story::after { content: "论"; position: absolute; right: -40px; bottom: -120px; color: rgba(255,255,255,.035); font-family: "Songti SC", serif; font-size: 430px; line-height: 1; }
.login-kicker { margin-bottom: 24px; color: #84c3bb; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.login-story h1 { max-width: 650px; color: #fff; font-size: clamp(44px, 5vw, 72px); }
.login-story p { max-width: 580px; color: #b9d4d4; font-size: 16px; line-height: 1.9; }
.login-flow { display: flex; align-items: center; gap: 10px; margin-top: 38px; color: #cfe4e2; font-size: 11px; }
.login-flow i { width: 30px; height: 1px; background: rgba(255,255,255,.25); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 52px; }
.login-card h2 { font-size: 27px; }
.login-card .login-logo { margin-bottom: 27px; color: #fff; background: var(--teal); }
.login-note { color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .topbar { gap: 16px; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .paper-main-grid { grid-template-columns: 1fr; }
  .paper-sidebar { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .page { width: min(100% - 28px, 1480px); padding-top: 16px; }
  .topbar { position: static; padding: 12px 16px; }
  .account-chip .role-tag, .account-chip > span:nth-child(2) { display: none; }
  .hero { min-height: auto; padding: 28px 24px; flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 35px; }
  .metric-grid, .metric-grid.three, .metric-grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid article { min-height: 105px; }
  .page-heading, .section-head { flex-direction: column; align-items: stretch; }
  .heading-actions { justify-content: flex-start; }
  .inline-search { flex-wrap: wrap; }
  .inline-search input { min-width: 0; flex: 1; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar select { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .student-stage-grid, .import-grid { grid-template-columns: 1fr; }
  .stage-track { grid-template-columns: repeat(3,1fr); gap: 20px 0; }
  .stage-track > div::before { display: none; }
  .paper-hero { flex-direction: column; padding: 24px; }
  .paper-hero h1 { font-size: 28px; }
  .paper-state { justify-items: start; }
  .paper-sidebar { grid-template-columns: 1fr; }
  .version-head { grid-template-columns: auto 1fr; }
  .version-head .button { grid-column: 2; justify-self: start; }
  .message-bubble { max-width: 88%; }
  .message-form { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; margin: 20px auto; }
  .login-story { display: none; }
  .login-card { min-height: 620px; padding: 34px 26px; }
}
