:root {
  --bg: #ececec;
  --paper: #f8f8f8;
  --card: #ffffff;
  --ink: #252525;
  --muted: #6b6f76;
  --line: #dedede;
  --deep-red: #b60d1d;
  --red: #c5162b;
  --red-soft: #f9e8eb;
  --gray-dark: #4b4f55;
  --gray: #8d9299;
  --gray-soft: #f1f2f3;
  --orange: #f28c28;
  --orange-soft: #fff1df;
  --blue: #2878d7;
  --blue-soft: #e8f2ff;
  --green: #16a36a;
  --green-soft: #e5f7ef;
  --purple: #7c4dff;
  --shadow: 0 16px 38px rgba(35, 35, 35, 0.1);
  --header-height: 84px;
  --overview-height: 330px;
  --side-width: 190px;
}

.title-actions button.danger,
button.danger {
  color: #a41427;
  border-color: #d9a5ad;
  background: #fff;
}

button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 24, 32, .56);
}

.selection-modal {
  width: min(780px, 96vw);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head p {
  margin-top: 5px;
  color: #666;
  font-size: 13px;
}

.modal-check-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.modal-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dedede;
  border-radius: 7px;
  cursor: pointer;
}

.modal-check-list span,
.modal-check-list small {
  display: block;
}

.modal-check-list small {
  margin-top: 3px;
  color: #777;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(182, 13, 29, 0.05), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.login-view,
.app-shell,
.admin-shell {
  display: none;
}

body.login-mode .login-view {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}

body.app-mode .app-shell {
  display: grid;
}

body.admin-mode .admin-shell {
  display: grid;
}

.login-card {
  width: min(900px, 92vw);
  min-height: 520px;
  background: #f8f8f8;
  border: 1px solid #d4d7dc;
  box-shadow: 0 22px 60px rgba(35, 35, 35, 0.16);
  padding: 34px 38px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-rows: auto auto auto 1fr;
  gap: 18px 36px;
}

.login-brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 900;
}

.login-brand strong {
  display: block;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.1;
}

.login-brand span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 1px;
}

.login-title {
  grid-row: 2 / 5;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(197, 22, 43, 0.12), transparent 50%),
    #fff;
  border-left: 7px solid var(--red);
  display: grid;
  align-content: center;
  gap: 12px;
}

.login-title h1 {
  margin: 0;
  color: var(--deep-red);
  font-size: 34px;
  line-height: 1.2;
}

.login-title p {
  margin: 0;
  color: var(--gray-dark);
  font-size: 15px;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  font-weight: 800;
}

.login-tab.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.login-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.login-form label {
  display: grid;
  gap: 5px;
}

.login-form span {
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  font: inherit;
}

.login-form button {
  min-height: 42px;
  border: 0;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.login-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  gap: 12px;
  padding: 14px 20px;
  overflow: hidden;
}

.side-nav {
  min-width: 0;
  min-height: 0;
  background: #f6f6f6;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px 10px;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr);
  gap: 12px;
}

.side-mark {
  border-left: 5px solid var(--red);
  background: #fff;
  padding: 12px 10px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.side-mark strong {
  color: var(--deep-red);
  font-size: 18px;
  line-height: 1.15;
}

.side-mark span {
  color: var(--muted);
  font-size: 12px;
}

.side-mark em {
  width: fit-content;
  padding: 3px 7px;
  color: #fff;
  background: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.home-view {
  min-height: 0;
  display: grid;
  grid-template-rows: var(--overview-height) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.module-view {
  min-height: 0;
  overflow: hidden;
  display: none;
}

.module-view:not([hidden]) {
  display: block;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  background: #f5f5f5;
  border: 1px solid #d7d7d7;
  box-shadow: var(--shadow);
}

.title-block {
  text-align: center;
}

.title-block p {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.title-block h1 {
  margin: 0;
  color: var(--deep-red);
  font-size: clamp(23px, 2.45vw, 31px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions button,
.mini-button,
.year-filter select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  min-height: 32px;
  padding: 0 12px;
}

.user-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--deep-red);
  background: var(--red-soft);
  border: 1px solid #efc8ce;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.year-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-dark);
  font-size: 13px;
  font-weight: 700;
}

.year-filter select {
  min-width: 92px;
  font: inherit;
}

#saveBtn {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.upper-layer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  height: var(--overview-height);
  min-height: 0;
  overflow: hidden;
}

.hero-card,
.process-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  overflow: hidden;
}

.category-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.category-button {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--gray-dark);
  font-weight: 700;
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.hero-content {
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.hero-summary {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.summary-block {
  min-height: 0;
  padding: 12px 14px;
  background: var(--red-soft);
  border-left: 5px solid var(--red);
  display: grid;
  align-content: center;
  gap: 5px;
}

.summary-block.light {
  background: var(--gray-soft);
  border-left-color: var(--gray);
}

.summary-block strong {
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-block small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 9px;
  width: fit-content;
  background: #fff;
  color: var(--deep-red);
  font-weight: 700;
  font-size: 12px;
}

.section-kicker.gray {
  color: var(--gray-dark);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-self: stretch;
  min-height: 0;
}

.metric {
  min-height: 0;
  padding: 14px 10px;
  display: grid;
  align-content: center;
  gap: 10px;
  border-left: 6px solid currentColor;
  background: var(--gray-soft);
}

.metric span {
  color: var(--gray-dark);
  font-size: 12px;
  white-space: nowrap;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric.red {
  color: var(--red);
  background: var(--red-soft);
}

.metric.orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.metric.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.metric.green {
  color: var(--green);
  background: var(--green-soft);
}

.process-card,
.panel {
  padding: 10px;
  min-width: 0;
  min-height: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
}

.panel-title h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.panel-title .hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.color-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.color-dot.red {
  background: var(--red);
}

.process-line {
  height: calc(100% - 32px);
  display: grid;
  gap: 3px;
  align-content: stretch;
}

.process-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 50px;
  gap: 6px;
  align-items: center;
  padding: 3px 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  min-height: 27px;
}

.step-number {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.process-step strong {
  display: block;
  font-size: 12px;
}

.process-step small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.process-step span:last-child {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.lower-layer {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.02fr 1.16fr 1.08fr 0.98fr;
  gap: 14px;
  align-self: stretch;
  overflow: hidden;
}

.module-tabs {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.module-tab,
.nav-primary,
.nav-child {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  font-weight: 800;
  min-height: 38px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-tab.active,
.nav-primary.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.home-tab {
  min-height: 42px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-primary {
  min-height: 40px;
  background: var(--gray-soft);
  color: var(--ink);
}

.nav-children {
  display: none;
  gap: 4px;
  padding-left: 10px;
  border-left: 3px solid #d7d7d7;
}

.nav-group.open .nav-children {
  display: grid;
}

.nav-child {
  min-height: 30px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 0 8px;
  background: #fff;
}

.nav-child.active {
  border-color: var(--red);
  color: var(--deep-red);
  background: var(--red-soft);
}

.module-content {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.module-grid {
  height: 100%;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.module-grid.wide {
  grid-template-columns: minmax(0, 1fr);
}

.module-side,
.module-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.module-title {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 32px;
  margin-bottom: 10px;
}

.module-title > .icon-bubble {
  flex: 0 0 30px;
  align-self: flex-start;
  margin: 0;
}

.module-title > h3,
.module-title > div {
  padding-top: 4px;
}

.module-title > .field,
.module-title > .hint,
.module-title > .title-actions,
.module-title > .status {
  align-self: flex-start;
}

.module-title h3 {
  margin: 0;
  font-size: 17px;
}

.module-title .hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.title-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.title-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  padding: 0 12px;
  font-weight: 700;
}

.title-actions .primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.warning-title-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.title-actions .platform-jump-button {
  border-color: #2f70c9;
  background: #edf5ff;
  color: #1e5eae;
  white-space: nowrap;
}

.title-actions .platform-jump-button:hover {
  background: #dcecff;
}

.staff-source-card,
.staff-roster-card { grid-column: 1 / -1; min-width: 0; }
.staff-roster-table th:nth-child(1) { width: 54px; }
.staff-roster-table th:nth-child(2) { width: 105px; }
.staff-roster-table th:nth-child(3) { width: 82px; }
.staff-roster-table th:nth-child(4) { width: 130px; }
.staff-roster-table th:nth-child(5) { width: 110px; }
.staff-roster-table th:nth-child(7) { width: 90px; }
.staff-roster-table td { vertical-align: middle; }
.staff-source-note { min-height: 120px; padding: 20px; line-height: 1.8; text-align: left; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.form-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

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

.field span {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea,
.inline-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  font: inherit;
}

.field textarea {
  min-height: 54px;
  padding: 8px 9px;
  resize: none;
}

.field select[multiple] {
  min-height: 98px;
  padding: 6px 9px;
}

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

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.action-row button,
.tool-button,
.tool-link {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  padding: 0 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.action-row button:disabled,
.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-row .primary,
.tool-button.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.plan-form textarea {
  min-height: 78px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  background: var(--gray-soft);
  color: var(--gray-dark);
  font-weight: 800;
}

.table-select {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 6px;
  font-weight: 700;
}

.table-select.active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--deep-red);
}

.table-wrap {
  min-height: 0;
  overflow: auto;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 260px));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--gray-soft);
  border: 1px solid var(--line);
}

.warning-filter-bar {
  grid-template-columns: minmax(120px, 180px) minmax(240px, 1fr) minmax(220px, 1fr) auto;
}

.warning-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.warning-filter-actions button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  font-weight: 700;
  cursor: pointer;
}

.warning-filter-actions .primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

@media (max-width: 1100px) {
  .warning-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.empty-panel {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  font-size: 14px;
}

.row-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.workpaper-list-table th:nth-child(2) {
  width: 140px;
}

.workpaper-select-all-radio {
  margin-left: 6px;
  vertical-align: middle;
  accent-color: var(--red);
}

.workpaper-list-table th:nth-child(5) {
  width: 110px;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.tool-button.danger {
  color: #fff;
  border-color: var(--gray);
  background: #7f8790;
}

.tool-button.danger:hover {
  border-color: var(--deep-red);
  background: var(--deep-red);
}

.workpaper-template-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px) minmax(220px, 280px) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.workpaper-template-panel h4 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 16px;
}

.workpaper-template-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

.workpaper-template-panel.category-mode {
  grid-template-columns: minmax(240px, 260px) minmax(320px, 1fr) auto;
  grid-template-areas:
    "intro intro action"
    "category list list";
  gap: 8px 12px;
  align-items: start;
  padding: 10px;
}

.workpaper-intro {
  grid-area: intro;
}

.category-field {
  grid-area: category;
  align-self: start;
}

.category-field select {
  width: 240px;
  min-width: 240px;
  height: 32px;
  min-height: 32px;
  padding: 0 28px 0 10px;
  font-size: 14px;
  line-height: 32px;
}

.add-workpaper-button {
  grid-area: action;
  align-self: start;
  width: auto;
  min-width: 112px;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  line-height: 30px;
  white-space: nowrap;
  justify-self: end;
  margin-top: 0;
}

.workpaper-check-list {
  grid-area: list;
  min-height: 74px;
  max-height: 156px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.check-list-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: #eef2f5;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.workpaper-check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f2;
  cursor: pointer;
}

.workpaper-check-row:last-child {
  border-bottom: 0;
}

.workpaper-check-row:hover {
  background: #fff8f8;
}

.workpaper-check-row.disabled {
  background: #f3f5f6;
  color: #8a9299;
  cursor: not-allowed;
}

.workpaper-check-row.disabled:hover {
  background: #f3f5f6;
}

.workpaper-check-row.disabled strong,
.workpaper-check-row.disabled small {
  color: #8a9299;
}

.workpaper-check-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--red);
}

.workpaper-check-row > span {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.workpaper-check-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
}

.workpaper-check-row small {
  min-width: 0;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid #d7dde2;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
  white-space: normal;
  text-align: left;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.pm-workpaper-editor {
  width: min(980px, 100%);
  margin: 0 auto 28px;
  background: #fff;
  border: 1px solid #cfd6dc;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.pm-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
}

.pm-editor-head small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pm-editor-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.pm-editor-head > span {
  flex: 0 0 auto;
  border: 1px solid #f0c8ce;
  background: var(--red-soft);
  color: var(--deep-red);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
}

.pm-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.pm-editor-grid label,
.pm-editor-form label {
  display: grid;
  gap: 6px;
}

.pm-editor-grid span,
.pm-editor-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pm-editor-grid input,
.pm-editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.pm-editor-grid input {
  min-height: 34px;
  padding: 0 10px;
}

.pm-template-notice {
  margin: 16px 20px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  background: #f8fafb;
}

.pm-template-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.pm-template-notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.pm-editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 20px;
}

.pm-editor-form textarea {
  padding: 10px;
  resize: vertical;
  line-height: 1.55;
}

.excel-template-window {
  width: min(1120px, 100%);
  margin: 0 auto 28px;
  background: #fff;
  border: 1px solid #cfd6dc;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.excel-template-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.excel-template-meta small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.excel-template-meta h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.excel-template-meta > span {
  flex: 0 0 auto;
  color: var(--deep-red);
  background: var(--red-soft);
  border: 1px solid #f0c8ce;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.excel-template-scroll {
  overflow: auto;
  max-height: calc(100vh - 184px);
  padding: 16px;
  background: #f1f2f4;
}

.excel-template-table {
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  margin: 0 auto;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.excel-template-canvas {
  position: relative;
  margin: 0 auto;
}

.excel-template-image {
  position: absolute;
  z-index: 2;
  object-fit: contain;
  pointer-events: none;
}

.excel-template-cell {
  min-width: 34px;
  height: 24px;
  border: 1px solid #2f2f2f;
  padding: 2px 4px;
  color: #000;
  background: #fff;
  font-family: SimSun, "宋体", serif;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  vertical-align: middle;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.excel-template-cell.excel-title {
  background: #d9eef2;
  font-weight: 700;
  letter-spacing: 2px;
}

.excel-template-cell.title {
  font-weight: 700;
  letter-spacing: 8px;
}

.excel-template-cell.excel-label {
  background: #e2f3f6;
  font-weight: 700;
}

.excel-template-cell.fill {
  background: #e2f3f6;
}

.excel-template-cell.bold {
  font-weight: 700;
}

.excel-template-cell.h-left {
  text-align: left;
}

.excel-template-cell.h-right {
  text-align: right;
}

.excel-template-cell.h-center {
  text-align: center;
}

.excel-template-cell.v-top {
  vertical-align: top;
}

.excel-template-cell.v-center {
  vertical-align: middle;
}

.excel-template-cell.v-bottom {
  vertical-align: bottom;
}

.excel-template-cell.wrap {
  white-space: pre-wrap;
}

.excel-template-cell.excel-blank {
  background: #fff;
}

.excel-template-cell.no-border {
  border-color: transparent;
  background: transparent !important;
}

.excel-editable-cell {
  background: #fff;
  outline-color: var(--red);
}

.excel-template-footer {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.api-reserve-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.api-reserve-grid .field {
  margin: 0;
}

.api-status-field {
  grid-column: 1 / -1;
}

.muted-cell {
  color: var(--muted);
  text-align: center;
}

.workpaper-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 18px;
  background: rgba(20, 20, 20, 0.58);
}

.workpaper-modal.open {
  display: grid;
  place-items: center;
}

.workpaper-dialog {
  width: min(1280px, calc(100vw - 54px));
  height: min(860px, calc(100vh - 54px));
  min-width: 0;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.workpaper-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}

.workpaper-dialog-head span {
  color: var(--muted);
  font-size: 12px;
}

.workpaper-dialog-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
}

.workpaper-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 24px;
  background: #ededed;
}

.print-sheet-area {
  width: max-content;
  min-height: auto;
  margin: 0 auto;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.workpaper-template-sheet {
  border: 1px solid #cfcfcf;
  border-top: 4px solid var(--red);
  transform: scale(1.28);
  transform-origin: top left;
  margin: 0 0 240px 0;
}

.workpaper-template-sheet::after {
  content: "";
  display: block;
  width: 18%;
  height: 1px;
}

.vb-workpaper-window {
  width: min(1060px, 100%);
  min-height: 0;
  margin: 0 auto 30px;
  padding: 14px;
  background: #f6f6f6;
  border: 1px solid #b9c0c7;
  border-top: 4px solid var(--red);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  display: grid;
  gap: 12px;
}

.vb-titlebar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(180deg, #5c646d 0%, #3d434a 100%);
  border: 1px solid #30363d;
}

.vb-titlebar strong {
  font-size: 18px;
}

.vb-titlebar span {
  font-size: 13px;
  opacity: 0.9;
}

.vb-panel {
  position: relative;
  padding: 18px 12px 12px;
  background: #fff;
  border: 1px solid #c9cdd2;
}

.vb-panel-title {
  position: absolute;
  top: -10px;
  left: 12px;
  padding: 0 8px;
  color: var(--deep-red);
  background: #fff;
  font-weight: 800;
  font-size: 14px;
}

.vb-form-grid {
  display: grid;
  gap: 10px;
}

.vb-form-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vb-form-grid .span-2 {
  grid-column: span 2;
}

.vb-form-grid .span-4 {
  grid-column: 1 / -1;
}

.vb-form-grid label,
.vb-check-grid label {
  display: grid;
  gap: 4px;
}

.vb-form-grid span,
.vb-check-grid span {
  color: #4c535a;
  font-size: 12px;
  font-weight: 700;
}

.vb-form-grid input,
.vb-form-grid select,
.vb-form-grid textarea,
.vb-check-grid input,
.vb-check-grid select,
.vb-textarea {
  width: 100%;
  border: 1px solid #aeb5bc;
  background: #fff;
  color: #151515;
  font: inherit;
  font-size: 14px;
}

.vb-form-grid input,
.vb-form-grid select,
.vb-check-grid input,
.vb-check-grid select {
  height: 36px;
  padding: 0 9px;
}

.vb-form-grid input[readonly],
.vb-textarea.fixed {
  background: #e8f3f5;
  color: #1e3940;
  font-weight: 700;
}

.project-name-input {
  font-weight: 800;
}

.vb-input-area,
.vb-textarea {
  min-height: 74px;
  padding: 9px;
  resize: vertical;
  line-height: 1.55;
}

.vb-textarea.fixed {
  min-height: 72px;
  resize: none;
}

.vb-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.vb-statusbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  color: #4c535a;
  background: #e6e7e9;
  border: 1px solid #c9cdd2;
  font-size: 12px;
}

.excel-like-window {
  width: 760px;
}

.excel-form-sheet {
  --sheet-cell-h: 30px;
  --sheet-date-h: 24px;
  --sheet-procedure-h: 62px;
  --sheet-other-h: 78px;
  --sheet-review-h: 36px;
  --sheet-sign-h: 36px;
  padding: 10px;
  background: #fff;
  border: 1px solid #b8c0c7;
  display: grid;
  gap: 0;
}

.sheet-print-head {
  position: relative;
  min-height: 68px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #9fb2ba;
  border-bottom: 0;
}

.sheet-print-head img {
  position: absolute;
  left: 16px;
  top: 9px;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.sheet-caption {
  height: 38px;
  display: grid;
  place-items: center;
  color: #111;
  background: transparent;
  border: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 8px;
}

.excel-row {
  display: grid;
  height: var(--sheet-cell-h);
  min-height: var(--sheet-cell-h);
}

.excel-row.two {
  grid-template-columns: 1fr 1fr;
}

.excel-row.price-row {
  grid-template-columns: 1fr 1fr;
}

.excel-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.excel-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.excel-row.label-wide {
  grid-template-columns: 150px minmax(0, 1fr);
}

.excel-row.matter-row {
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
}

.excel-row label,
.excel-row .excel-label {
  min-width: 0;
}

.excel-row label {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
}

.excel-row label span,
.excel-label,
.excel-side-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #1a353d;
  background: #e5f3f5;
  border: 1px solid #aeb8bf;
  font-weight: 800;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  min-height: var(--sheet-cell-h);
}

.excel-row input,
.excel-row select,
.excel-block textarea,
.conclusion-main > input,
.excel-fixed-heading {
  min-width: 0;
  min-height: var(--sheet-cell-h);
  border: 1px solid #aeb8bf;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.excel-row input,
.procedure-block textarea,
.conclusion-main .large-area,
.review-fixed-row,
.review-sign-row span {
  text-align: left;
}

.excel-row input {
  padding-left: 8px;
}

.excel-row input[readonly] {
  text-align: left;
}

.excel-row input.center-value {
  text-align: center;
}

.excel-row input.locked-field {
  background: #f8fbfc;
  font-weight: 700;
  cursor: default;
}

.excel-row label span,
.excel-label,
.excel-side-label,
.excel-fixed-heading {
  text-align: center;
}

.excel-row input,
.excel-row select,
.conclusion-main > input {
  height: var(--sheet-cell-h);
  min-height: var(--sheet-cell-h);
  padding: 0 7px;
}

.excel-row.date-row,
.excel-row.date-row label span,
.excel-row.date-row input {
  height: var(--sheet-date-h);
  min-height: var(--sheet-date-h);
}

.excel-row input[readonly] {
  background: #f8fbfc;
  font-weight: 700;
}

.excel-fixed-heading {
  display: grid;
  place-items: center;
  padding: 0 8px;
  background: #f8fbfc;
  font-weight: 900;
}

.excel-fixed-heading.left-heading {
  place-items: center start;
  text-align: left;
  padding-left: 12px;
}

.excel-block {
  display: grid;
  border-left: 1px solid #aeb8bf;
  border-right: 1px solid #aeb8bf;
}

.procedure-block {
  grid-template-columns: 56px minmax(0, 1fr);
  height: var(--sheet-procedure-h);
  min-height: var(--sheet-procedure-h);
}

.procedure-block textarea {
  height: var(--sheet-procedure-h);
  min-height: var(--sheet-procedure-h);
  padding: 8px;
  resize: none;
  text-align: left;
  line-height: 1.45;
  background: #e5f3f5;
  font-weight: 700;
}

.conclusion-block {
  grid-template-columns: 56px minmax(0, 1fr);
}

.excel-side-label.tall {
  line-height: 1.35;
}

.conclusion-main,
.review-main {
  display: grid;
  min-width: 0;
}

.conclusion-main .center {
  font-weight: 700;
}

.excel-row.inner {
  height: var(--sheet-cell-h);
  min-height: var(--sheet-cell-h);
}

.conclusion-main .large-area {
  height: var(--sheet-other-h);
  min-height: var(--sheet-other-h);
  padding: 10px 9px;
  resize: vertical;
  text-align: left;
  line-height: 1.45;
}

.review-block {
  grid-template-columns: 56px minmax(0, 1fr);
}

.review-fixed-row {
  height: var(--sheet-review-h);
  min-height: var(--sheet-review-h);
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #aeb8bf;
  border-top: 0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  justify-content: flex-start;
}

.review-sign-row {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr) 130px minmax(0, 1fr);
  height: var(--sheet-sign-h);
  min-height: var(--sheet-sign-h);
}

.review-sign-row span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  border: 1px solid #aeb8bf;
  border-top: 0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.review-sign-row span:nth-child(1),
.review-sign-row span:nth-child(3) {
  background: #e5f3f5;
  color: #1a353d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.workpaper-form-print {
  display: grid;
  gap: 14px;
  color: var(--ink);
}

.workpaper-form-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-top: 5px solid var(--red);
  background: linear-gradient(90deg, #fff7f7 0%, #ffffff 58%, #f3f3f3 100%);
}

.workpaper-form-head span,
.workpaper-form-foot,
.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.workpaper-form-head h3 {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 24px;
  line-height: 1.25;
}

.workpaper-print-badge {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  align-content: center;
  gap: 5px;
}

.workpaper-print-badge strong {
  color: var(--red);
  font-size: 13px;
}

.workpaper-form-section {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.section-title b {
  padding-left: 10px;
  border-left: 5px solid var(--red);
  font-size: 18px;
}

.locked-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.locked-template-field {
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid #ead89b;
  border-left: 5px solid #d6a600;
  background: #fff4c7;
  display: grid;
  align-content: start;
  gap: 5px;
}

.locked-template-field span {
  color: #806200;
  font-size: 12px;
  font-weight: 700;
}

.locked-template-field strong {
  min-height: 22px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.locked-template-field em {
  justify-self: start;
  padding: 2px 6px;
  color: #806200;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #ead89b;
  font-size: 11px;
  font-style: normal;
}

.workpaper-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workpaper-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 180px 180px;
  gap: 12px;
  align-items: stretch;
}

.workpaper-control {
  display: grid;
  gap: 6px;
}

.workpaper-control span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.workpaper-control textarea,
.workpaper-control input,
.workpaper-control select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.workpaper-control textarea {
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  line-height: 1.55;
}

.workpaper-control input,
.workpaper-control select {
  height: 38px;
  padding: 0 10px;
}

.workpaper-control.compact {
  align-content: start;
}

.workpaper-form-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--gray-soft);
  border: 1px solid var(--line);
}

.workpaper-sheet-table {
  width: auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11.5px;
  color: #111;
  background: #fff;
}

.workpaper-sheet-table td {
  height: 22px;
  min-width: 44px;
  max-width: 44px;
  border: 1px solid #a8a8a8;
  padding: 0;
  vertical-align: middle;
  word-break: normal;
  background: #fff;
  line-height: 1.3;
  overflow: hidden;
}

.workpaper-sheet-table .sheet-title-cell {
  text-align: center;
  font-weight: 800;
}

.polished-sheet td {
  outline: none;
}

.polished-sheet td:focus {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--blue);
  background: #f7fbff;
}

.polished-sheet .locked-cell {
  background: #e9f5f7;
  color: #282828;
  font-weight: 700;
}

.polished-sheet .editable-cell {
  background: #fff;
}

.polished-sheet .filled-cell:not(.locked-cell) {
  background: #fff;
}

.polished-sheet .trimmed-empty-cell {
  border-color: transparent;
  background: transparent;
}

.fixed-cell-text {
  width: 100%;
  height: 100%;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  color: #15313a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  background: linear-gradient(180deg, #eef9fb 0%, #d9eef3 100%);
}

.polished-sheet .sheet-title-cell .fixed-cell-text {
  font-weight: 900;
  color: #0f2d35;
  background: linear-gradient(180deg, #d9f1f5 0%, #c8e7ed 100%);
}

.fixed-scale-1 .fixed-cell-text {
  font-size: 10px;
}

.fixed-scale-2 .fixed-cell-text {
  font-size: 9px;
}

.fixed-scale-3 .fixed-cell-text {
  font-size: 8px;
}

.sheet-cell-input {
  width: 100%;
  height: 100%;
  min-height: 22px;
  border: 0;
  outline: 0;
  padding: 1px 4px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

textarea.sheet-cell-input {
  display: block;
  resize: none;
  overflow: hidden;
  padding-top: 6px;
}

.sheet-cell-input:focus {
  background: #fffefa;
  box-shadow: inset 0 0 0 2px var(--orange);
}

.project-fill {
  font-weight: 700;
  white-space: nowrap;
}

.workpaper-sheet-table .blank-row td {
  height: 18px;
}

.info-card {
  min-height: 68px;
  padding: 10px;
  border-left: 5px solid var(--red);
  background: var(--gray-soft);
  display: grid;
  align-content: center;
  gap: 3px;
}

.info-card span {
  color: var(--muted);
  font-size: 12px;
}

.info-card strong {
  font-size: 18px;
}

.permission-note {
  margin-bottom: 10px;
  padding: 9px 12px;
  color: var(--gray-dark);
  background: var(--gray-soft);
  border-left: 5px solid var(--gray);
  font-size: 13px;
}

.knowledge-card,
.archive-item {
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.knowledge-card strong,
.archive-item strong {
  font-size: 15px;
}

.knowledge-card small,
.archive-item small {
  color: var(--muted);
  line-height: 1.5;
}

.placeholder-panel {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 30px;
}

.placeholder-panel strong {
  display: block;
  color: var(--deep-red);
  font-size: 24px;
  margin-bottom: 10px;
}

.placeholder-panel p {
  margin: 0;
  color: var(--muted);
}

.panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.icon-bubble {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}

.icon-bubble.red {
  background: var(--red);
}

.icon-bubble.orange {
  background: var(--orange);
}

.icon-bubble.blue {
  background: var(--blue);
}

.icon-bubble.green {
  background: var(--green);
}

.project-main {
  margin-top: 8px;
  padding: 9px;
  background: var(--gray-soft);
  border-left: 5px solid var(--red);
}

.project-main strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.project-main p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  background: #d8dadd;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--red);
}

.compact-grid {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.fact {
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.fact strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.material-board,
.workpaper-board {
  margin-top: 7px;
  display: grid;
  gap: 5px;
  align-content: start;
  min-height: 0;
}

.material-item,
.workpaper-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 45px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
}

.material-item strong,
.workpaper-item strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-item small,
.workpaper-item small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  min-width: 72px;
  min-height: 28px;
  border: 0;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.status.done {
  background: var(--green);
}

.status.pending {
  background: var(--gray);
}

.status.review {
  background: var(--orange);
}

.check-chip {
  border: 0;
  width: 60px;
  min-width: 60px;
  min-height: 28px;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.check-chip.on {
  background: var(--blue);
}

.check-chip.off {
  background: var(--purple);
}

.report-stack {
  margin-top: 7px;
  display: grid;
  gap: 6px;
  min-height: 0;
}

.report-box {
  padding: 8px;
  background: var(--gray-soft);
  border-left: 5px solid var(--green);
}

.report-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.report-box strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.report-note {
  padding: 8px;
  min-height: 68px;
  color: var(--gray-dark);
  font-size: 12px;
  line-height: 1.5;
  background: #fff;
  border: 1px solid var(--line);
}

.report-register-list {
  display: grid;
  gap: 12px;
}

.report-register-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.report-register-head {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--gray-soft);
  border-left: 5px solid var(--green);
}

.report-register-head strong {
  display: block;
  font-size: 16px;
}

.report-register-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.report-code-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.report-code-entry input {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 10px;
  font: inherit;
}

.report-code-locked {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.report-code-locked strong {
  color: var(--deep-red);
}

.cash-report-grid,
.responsibility-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
}

.cash-report-grid div,
.responsibility-summary span {
  padding: 8px;
  background: #fff7e9;
  border-left: 4px solid var(--orange);
}

.cash-report-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cash-report-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.responsibility-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-data-table {
  width: calc(100% - 24px);
  margin: 10px 12px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.mini-data-table th,
.mini-data-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.mini-data-table th {
  background: var(--gray-soft);
}

.punishment-proof-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.punishment-proof-row small {
  display: inline-block;
  margin-left: 10px;
  color: var(--muted);
}

.upload-proof-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--red);
  cursor: pointer;
  font-weight: 700;
}

.upload-proof-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.project-select {
  margin-left: auto;
  width: min(46%, 168px);
  min-height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 18px;
  padding: 10px 14px;
  background: var(--deep-red);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-shell {
  width: 100vw;
  height: 100vh;
  padding: 14px 20px;
  grid-template-rows: 84px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.admin-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 18px;
  background: #f5f5f5;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-head p {
  margin: 0 0 4px;
  color: var(--red);
  font-weight: 800;
}

.admin-head h1 {
  margin: 0;
  color: var(--deep-red);
  font-size: 32px;
}

.admin-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}

.admin-nav {
  min-height: 0;
  background: #f6f6f6;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-nav-button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--gray-dark);
  font-weight: 800;
}

.admin-nav-button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.admin-content {
  min-height: 0;
  overflow: hidden;
}

.admin-page-grid {
  height: 100%;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.admin-api-page {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(260px, 0.9fr) minmax(220px, 0.72fr);
  gap: 12px;
}

.admin-card {
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px;
}

.admin-card h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 19px;
}

.admin-card p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-api-card {
  padding: 16px;
}

.report-workspace { display: grid; gap: 18px; }
.report-compose, .report-ledger { min-width: 0; }
.report-ledger { height: calc(100vh - 142px); display: flex; flex-direction: column; overflow: hidden; }
.module-title p { margin: 5px 0 0; color: #7b8494; font-size: 13px; }
.report-project-bar { display: flex; align-items: end; gap: 20px; padding: 14px 16px; margin: 16px 0; border-radius: 12px; background: #f6f8fb; }
.report-project-bar .field { flex: 1; margin: 0; }
.report-project-bar > div { min-width: 110px; padding: 7px 14px; border-left: 1px solid #dfe4eb; }
.report-project-bar span, .report-project-bar strong { display: block; }
.report-project-bar span { color: #7b8494; font-size: 12px; }
.report-project-bar strong { margin-top: 4px; font-size: 19px; color: #c5162b; }
.report-brief textarea { min-height: 96px; }
.report-brief small { margin-top: 7px; color: #89919e; }
.report-generation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.report-generation-card { padding: 15px; border: 1px solid #e1e5eb; border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(36, 49, 68, .05); }
.report-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.report-card-head span, .report-card-head small { display: block; }
.report-card-head span { font-weight: 700; color: #253047; }
.report-card-head small { margin-top: 4px; color: #818998; line-height: 1.45; }
.report-generation-card textarea { width: 100%; min-height: 220px; resize: vertical; border: 1px solid #dce1e8; border-radius: 9px; padding: 12px; line-height: 1.7; font: inherit; box-sizing: border-box; }
.generation-source { margin-top: 8px; font-size: 12px; color: #9299a5; }
.report-confirm-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; padding: 16px 18px; border-radius: 12px; background: #fff7f0; border: 1px solid #f3d6c0; }
.report-confirm-bar strong, .report-confirm-bar span { display: block; }
.report-confirm-bar span { margin-top: 4px; color: #806d60; font-size: 13px; }
.report-issue-table td { min-width: 170px; vertical-align: top; line-height: 1.65; white-space: normal; }
.report-issue-table td:first-child { min-width: 70px; }
.report-issue-table th:last-child,
.report-issue-table td:last-child { width: 150px; min-width: 150px; }
.report-ledger-scroll { flex: 1; min-height: 260px; overflow: auto; border: 1px solid #e1e5eb; border-radius: 10px; }
.report-ledger-scroll .report-issue-table { margin: 0; }
.report-ledger-scroll .report-issue-table thead th { position: sticky; top: 0; z-index: 2; background: #f4f6f9; box-shadow: 0 1px 0 #dfe4eb; }
.report-composer-modal { width: min(1440px, 96vw); max-height: 92vh; overflow: auto; padding: 22px; border-radius: 14px; background: #fff; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.report-composer-modal .report-generation-card textarea { min-height: 260px; }
.report-issue-table textarea { width: 100%; min-height: 160px; box-sizing: border-box; padding: 10px; border: 1px solid #d6dce5; border-radius: 8px; font: inherit; line-height: 1.6; resize: vertical; }
.report-row-actions { display: table-cell; min-width: 150px !important; vertical-align: middle !important; text-align: center !important; white-space: normal; }
.report-row-actions button { display: block; width: 104px; min-height: 34px; margin: 0 auto 8px; }
.report-row-actions button:last-child { margin: 0 auto; }
.report-number-bar { display: flex; align-items: end; gap: 14px; padding: 14px 16px; margin: 14px 0; border-radius: 12px; background: #f6f8fb; }
.report-number-bar .field { flex: 1; margin: 0; }
.report-lock-notice { margin-top: 16px; padding: 15px 18px; border: 1px solid #b9ddca; border-radius: 12px; background: #f1faf5; color: #28734d; line-height: 1.6; }
button:disabled { cursor: not-allowed; opacity: .55; }
.api-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.api-guide div { padding: 14px; border-radius: 10px; background: #f6f8fb; }
.api-guide span, .api-guide strong { display: block; }
.api-guide span { color: #c5162b; font: 600 12px ui-monospace, monospace; }
.api-guide strong { margin-top: 6px; color: #39445a; font-size: 13px; }
.openai-config-panel { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(220px, .45fr) auto; align-items: end; gap: 14px; margin: 18px 0; padding: 18px; border: 1px solid #dfe4eb; border-radius: 12px; background: #f7f9fc; }
.openai-config-panel .field, .openai-config-panel .action-row { margin: 0; }
@media (max-width: 1100px) { .report-generation-grid { grid-template-columns: 1fr; } .api-guide, .openai-config-panel { grid-template-columns: 1fr; } .report-ledger { height: auto; max-height: none; } .report-ledger-scroll { max-height: 62vh; } }

.admin-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.admin-card-title h2 {
  margin-bottom: 6px;
}

.admin-card-title p {
  max-width: 760px;
  margin: 0;
}

.admin-card-title > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--deep-red);
  background: var(--red-soft);
  border: 1px solid #f0c8cf;
  font-size: 12px;
  font-weight: 800;
}

.admin-config-table {
  table-layout: fixed;
}

.admin-config-table th,
.admin-config-table td {
  height: 46px;
}

.ima-table th:nth-child(1) {
  width: 150px;
}

.ima-table th:nth-child(3) {
  width: 190px;
}

.ima-table th:nth-child(4) {
  width: 190px;
}

.api-table th:nth-child(1) {
  width: 260px;
}

.api-table th:nth-child(2) {
  width: 150px;
}

.api-table th:nth-child(4) {
  width: 150px;
}

@media (max-width: 1180px) {
  .app-shell {
    padding: 12px;
    gap: 10px;
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .module-grid {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media print {
  .login-view,
  .app-shell,
  .admin-shell,
  .toast {
    display: none !important;
  }

  body * {
    visibility: hidden;
  }

  .workpaper-modal.open,
  .workpaper-modal.open * {
    visibility: visible;
  }

  .workpaper-modal.open {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
    height: auto;
    min-height: 0;
  }

  .workpaper-dialog {
    box-shadow: none;
    border: 0;
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
  }

  .workpaper-dialog-head {
    display: none;
  }

  .workpaper-dialog-body {
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  .print-sheet-area {
    width: 177mm;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .vb-workpaper-window {
    width: 177mm;
    border: 0;
  }

  .vb-titlebar,
  .vb-statusbar {
    display: none;
  }

  .excel-form-sheet {
    --sheet-cell-h: 10.45mm;
    --sheet-date-h: 7.55mm;
    --sheet-procedure-h: 31.35mm;
    --sheet-other-h: 20.9mm;
    --sheet-review-h: 12.78mm;
    --sheet-sign-h: 13.54mm;
    padding: 0;
    border: 0;
    font-family: SimSun, "宋体", serif;
    font-size: 10.5pt;
    line-height: 1.18;
    letter-spacing: 0;
    word-spacing: 0;
    position: relative;
  }

  .excel-form-sheet::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(34mm + var(--sheet-date-h));
    bottom: 0;
    border: 1.4pt solid #111;
    box-sizing: border-box;
    pointer-events: none;
  }

  .excel-form-sheet * {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
  }

  .sheet-print-head {
    min-height: 34mm;
    border: 0 !important;
  }

  .sheet-print-head img {
    left: 4.2mm;
    top: 4.1mm;
    width: 17mm;
    height: 20mm;
    object-fit: contain;
  }

  .sheet-caption {
    height: 19mm;
    font-family: SimSun, "宋体", serif;
    font-size: 20pt;
    letter-spacing: 8.8pt !important;
    font-weight: 900;
  }

  .excel-row.date-row label:nth-child(2) {
    justify-self: end;
    width: 50mm;
  }

  .excel-row.date-row label,
  .excel-row.date-row label span,
  .excel-row.date-row label input {
    border-color: transparent !important;
    background: transparent !important;
  }

  .excel-row.date-row label:nth-child(2) {
    grid-template-columns: 18mm 32mm;
  }

  .excel-row.date-row label:nth-child(2) span {
    justify-content: center;
    white-space: nowrap;
    padding: 0;
  }

  .excel-row.date-row label:nth-child(2) input {
    text-align: right;
    padding-right: 0;
  }

  .excel-row.label-wide {
    grid-template-columns: 51.6mm minmax(0, 1fr);
  }

  .excel-row.matter-row {
    grid-template-columns: 51.6mm minmax(0, 1fr) minmax(0, 1fr);
  }

  .procedure-block,
  .conclusion-block,
  .review-block {
    grid-template-columns: 14.5mm minmax(0, 1fr);
  }

  .excel-row label span,
  .excel-label,
  .excel-side-label,
  .excel-fixed-heading,
  .review-sign-row span {
    font-family: SimSun, "宋体", serif;
    font-size: 10.5pt;
    line-height: 1.12;
    letter-spacing: 0;
    word-spacing: 0;
    padding-left: 2mm;
    padding-right: 2mm;
  }

  .excel-row input,
  .excel-row select,
  .excel-block textarea,
  .conclusion-main > input,
  .conclusion-main .large-area {
    font-family: SimSun, "宋体", serif;
    font-size: 10.2pt;
    line-height: 1.18;
    letter-spacing: 0;
    word-spacing: 0;
  }

  .procedure-block textarea {
    font-size: 10.2pt;
    line-height: 1.18;
    padding: 2.1mm 2.5mm;
  }

  .conclusion-main .large-area {
    font-size: 10pt;
    padding: 2.2mm 2.5mm;
  }

  .review-fixed-row {
    font-family: SimSun, "宋体", serif;
    font-size: 9.2pt;
    line-height: 1.15;
    padding: 0 2.5mm;
  }

  .review-sign-row span {
    font-size: 10.5pt;
  }

  .workpaper-form-print {
    gap: 8px;
  }

  .workpaper-form-section,
  .workpaper-form-head,
  .workpaper-form-foot {
    break-inside: avoid;
  }

  @page {
    size: A4 portrait;
    margin: 7.1mm 9.9mm 7.1mm 22.9mm;
  }
}
