:root {
  --home-ink: #172537;
  --home-muted: #657386;
  --home-line: #dce4ec;
  --home-soft: #f5f7fa;
  --home-blue: #0f6498;
  --home-blue-dark: #0a4d78;
  --home-blue-soft: #e9f3f8;
}

body { min-width: 0; }

.topbar {
  height: 64px;
  padding: 0 28px;
  gap: 28px;
  color: var(--home-ink);
  box-shadow: 0 1px 0 rgba(27, 49, 70, .02);
}

.brand-small {
  width: auto;
  min-width: 210px;
  gap: 11px;
}

.brand-small > span {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--home-blue);
}

.brand-small > div { display: grid; gap: 1px; }
.brand-small strong { font-size: 14px; letter-spacing: .03em; }
.platform-version { margin-left: 4px; color: #7b8da0; font-size: 10px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.brand-small em {
  border: 0;
  padding: 0;
  font-size: 10px;
  letter-spacing: .14em;
  color: #8490a0;
}

.topnav { gap: 18px; }
.topnav button,
.topnav a {
  padding: 0 3px;
  border-bottom-width: 2px;
  font-size: 14px;
}
.topnav a {
  height: 100%;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: #536276;
  text-decoration: none;
}
.topnav a.active { color: var(--home-blue); border-color: var(--home-blue); font-weight: 800; }

.topbar-tools {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.global-search,
.project-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  padding: 0 11px;
  background: #f7f9fb;
  color: #78879a;
}

.global-search { width: min(290px, 22vw); }
.global-search input,
.project-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--home-ink);
  font-size: 13px;
}

.global-search:focus-within,
.project-search:focus-within {
  border-color: #7daeca;
  box-shadow: 0 0 0 3px rgba(15, 100, 152, .08);
  background: #fff;
}

.topbar-icon {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #5a6b7d;
  font-weight: 700;
}

.topbar-icon:hover { background: var(--home-soft); border-color: var(--home-line); }
.notice-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #c84c42;
  color: #fff;
  font-size: 9px;
}

.userbox {
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--home-line);
  display: grid;
  grid-template-columns: 34px auto repeat(3, auto);
  grid-template-rows: 18px 16px;
  column-gap: 7px;
  align-items: center;
}

.user-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcebf4;
  color: var(--home-blue-dark);
  font-weight: 800;
}

.userbox > #userName { grid-column: 2; grid-row: 1; font-size: 12px; font-weight: 700; white-space: nowrap; }
.userbox > #userRole { grid-column: 2; grid-row: 2; font-size: 10px; }
.userbox .quiet {
  grid-row: 1 / 3;
  grid-column: auto;
  padding: 5px 4px;
  font-size: 11px;
}

.page-projects {
  max-width: 1480px;
  padding: 34px 42px 56px;
}

.preview-banner {
  margin: -10px 0 22px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  background: #edf5f9;
  color: #4d687b;
  font-size: 11px;
}
.preview-banner strong { color: var(--home-blue-dark); }

.home-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.home-heading h1 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.02em; }
.home-heading p:last-child { margin: 0; color: var(--home-muted); font-size: 14px; }
.create-project-button { min-height: 40px; padding: 9px 18px !important; }

.home-panel {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(34, 58, 78, .035);
}

.home-panel-head {
  min-height: 72px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e7edf2;
}

.home-panel-head h2 { margin: 0 0 5px; font-size: 17px; }
.home-panel-head p { margin: 0; color: var(--home-muted); font-size: 12px; }
.section-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  margin-left: 5px;
  padding: 0 7px;
  border-radius: 10px;
  background: #eef2f5;
  color: #5c6c7c;
  font-size: 11px;
  vertical-align: 2px;
}

.quiet-action { padding: 7px 13px !important; font-size: 12px; }
.pending-list { display: grid; }
.pending-item {
  min-height: 70px;
  padding: 13px 20px;
  display: grid;
  grid-template-columns: 4px minmax(330px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #edf1f4;
  cursor: pointer;
}

.pending-item:last-child { border-bottom: 0; }
.pending-item:hover { background: #f8fafc; }
.task-marker { width: 4px; height: 32px; border-radius: 3px; background: #9aa8b6; }
.task-marker.warning { background: #d68a27; }
.task-marker.danger { background: #c4564c; }
.pending-copy > div { display: flex; align-items: center; gap: 9px; }
.pending-copy strong { font-size: 14px; }
.pending-copy p { margin: 5px 0 0; color: var(--home-muted); font-size: 12px; }
.pending-meta { color: #7b8897; font-size: 11px; white-space: nowrap; }
.pending-action { padding: 6px 10px !important; font-size: 11px; }
.pending-empty {
  min-height: 86px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #476579;
}
.pending-empty > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6f4ef;
  color: #268065;
  font-weight: 800;
}
.pending-empty p { margin: 3px 0 0; color: var(--home-muted); font-size: 12px; }
.pending-more { padding: 9px 20px; background: #f8fafb; color: var(--home-muted); font-size: 11px; text-align: right; }

.recent-heading { align-items: flex-end; }
.project-controls { display: flex; align-items: center; gap: 10px; }
.project-search { width: 270px; }
.project-table-wrap { overflow-x: auto; }
.project-list-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 12px;
}

.project-list-table th {
  padding: 11px 14px;
  border-bottom: 1px solid #dbe4eb;
  background: #f6f8fa;
  color: #6e7d8d;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.project-list-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e9eef2;
  color: #435366;
  vertical-align: middle;
}

.project-list-table tbody tr { cursor: pointer; }
.project-list-table tbody tr:hover { background: #f7fafc; }
.project-list-table tbody tr:last-child td { border-bottom: 0; }
.project-list-table td > strong,
.project-list-table td > small { display: block; }
.project-list-table td > small { margin-top: 4px; color: #8491a0; }

.project-identity { min-width: 280px; display: flex; align-items: center; gap: 11px; }
.project-identity strong { display: block; color: var(--home-ink); font-size: 13px; }
.project-identity small { display: block; margin-top: 4px; color: #7c8998; font-size: 10px; }
.project-type-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf3f8;
  color: #23698f;
  font-weight: 800;
}
.project-type-icon.type-budget { background: #edf0fa; color: #5868a2; }
.project-type-icon.type-bill { background: #f8f0e8; color: #9a6838; }

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 11px;
  background: #eef2f5;
  color: #647382;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge.info { background: #e8f2f8; color: #226b94; }
.status-badge.success { background: #e8f4ef; color: #28795f; }
.status-badge.warning { background: #fbf1df; color: #9c681d; }
.status-badge.danger { background: #f9e9e7; color: #a94740; }
.status-badge.neutral { background: #eef1f4; color: #687687; }
.project-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; white-space: nowrap; }
.row-open { border: 0; background: transparent; color: var(--home-blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.row-open:hover { color: var(--home-blue-dark); text-decoration: underline; }
.row-delete { border: 0; background: transparent; color: #a94740; font-size: 11px; font-weight: 700; white-space: nowrap; }
.row-delete:hover { color: #8f302a; text-decoration: underline; }
.project-delete-dialog .scheme-delete-body { grid-template-columns: 52px minmax(0,1fr); }
.project-delete-dialog #projectDeleteClose { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #718699; font-size: 24px; }
.project-delete-dialog #projectDeleteClose:hover { background: #eaf1f6; }
.project-delete-name-confirm { display: grid; gap: 7px; margin-top: 17px; color: #425f77; font-size: 12px; font-weight: 700; }
.project-delete-name-confirm input { height: 38px; border: 1px solid #d19a95; border-radius: 6px; padding: 0 10px; background: #fff; color: #263f55; font: inherit; font-weight: 500; }
.project-delete-name-confirm input:focus { border-color: #b8423b; outline: 2px solid rgba(184,66,59,.12); }
.project-delete-error { min-height: 19px; color: #b43f38 !important; font-weight: 700; }
.recent-panel .empty-projects { border: 0; border-radius: 0; padding: 48px; }

.workspace-page { height: calc(100vh - 64px); min-width: 1100px; }

.page-standards {
  max-width: 1560px;
  padding: 34px 42px 56px;
}

.standards-heading {
  align-items: flex-start;
  gap: 24px;
}

.standards-heading p:last-child { max-width: 760px; line-height: 1.65; }
.standards-heading .heading-actions { align-items: center; margin-top: 2px; }
.database-inventory-link { display: inline-flex; align-items: center; text-decoration: none; }

.standard-summary-grid { margin-bottom: 18px; }
.standard-summary-grid article { padding: 22px 26px; }
.standard-summary-grid h3 { margin: 14px 0 8px; }
.standard-summary-grid p { margin-bottom: 0; }
.standard-summary-grid dl dd { font-size: 17px; }

.standard-zone-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin: 20px 0 0;
  border: 1px solid var(--home-line);
  border-radius: 10px 10px 0 0;
  background: #fff;
}

.standard-zone-tabs button {
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
  border: 0;
  border-right: 1px solid #e5ebf0;
  border-bottom: 3px solid transparent;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
}

.standard-zone-tabs button:last-child { border-right: 0; }
.standard-zone-tabs button:hover { background: #f8fafc; }
.standard-zone-tabs button.active { border-bottom-color: var(--home-blue); background: #eef6fa; }
.standard-zone-tabs .zone-number { grid-row: 1 / 3; color: #8b98a8; font-weight: 800; }
.standard-zone-tabs button.active .zone-number { color: var(--home-blue); }
.standard-zone-tabs strong { color: #24384c; font-size: 13px; }
.standard-zone-tabs small { color: #778697; font-size: 10px; }

.standard-workspace {
  display: grid;
  grid-template-columns: 450px minmax(0, 1fr);
  min-height: 660px;
  border: 1px solid var(--home-line);
  border-top: 0;
  background: #fff;
}

.standard-doc-panel,
.standard-data-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.standard-doc-panel { border-right: 1px solid var(--home-line); background: #fbfcfd; }
.standard-panel-head {
  min-height: 72px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5ebf0;
}

.standard-panel-head p {
  margin: 0 0 4px;
  color: var(--home-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.standard-panel-head h3 { margin: 0; font-size: 17px; }
.standard-filterbar,
.standard-data-toolbar {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e7edf2;
}

.standard-filterbar { flex-wrap: wrap; }
.standard-filterbar .segmented { max-width: 100%; overflow-x: auto; }
.standard-filterbar .segmented button { white-space: nowrap; }
.standard-filterbar .project-search,
.standard-data-toolbar .project-search { flex: 1; min-width: 180px; }
.standard-data-toolbar .standard-dataset-tabs { flex: 1; max-width: 100%; min-width: 0; }
.standard-data-searchbar { display: flex; justify-content: flex-end; padding: 8px 12px; border-bottom: 1px solid #e7edf2; }
.standard-data-searchbar .project-search { width: min(320px,100%); }

.standard-document-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
}

.standard-document-item {
  padding: 15px 16px;
  border-bottom: 1px solid #e9eef2;
  background: #fff;
}

.standard-document-item:hover { background: #f8fafc; }
.standard-document-item header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.standard-document-item h4 { margin: 0; font-size: 13px; line-height: 1.45; color: var(--home-ink); }
.standard-document-item p { margin: 7px 0 0; color: var(--home-muted); font-size: 11px; line-height: 1.6; }
.standard-document-item small { color: #8290a1; font-size: 10px; }
.standard-document-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; color: #69798b; font-size: 10px; }
.standard-document-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.standard-document-actions button { padding: 6px 10px !important; font-size: 11px; }
.standard-document-actions button[disabled] { opacity: .55; cursor: not-allowed; }

.document-kind {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 8px;
  border-radius: 11px;
  background: #e8f2f8;
  color: #226b94;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.document-kind.fee { background: #f7eee2; color: #9a641f; }
.document-kind.quota { background: #e9f4ef; color: #25795f; }
.document-kind.price { background: #eef0fb; color: #5663a2; }
.document-kind.regulation { background: #f0f2f4; color: #607082; }

.standard-dataset-tabs {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  justify-content: flex-start;
}

.standard-dataset-tabs button { white-space: nowrap; }
.standard-data-meta {
  min-height: 34px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f5;
  background: #fbfcfd;
  color: #708094;
  font-size: 11px;
}

.standard-data-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.standard-data-table {
  min-width: 980px;
  table-layout: auto;
}

.standard-data-table td {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standard-data-table td:hover {
  overflow: visible;
  white-space: normal;
  background: #fffdf4 !important;
}

.standards-pagination {
  min-height: 40px;
  flex: 0 0 40px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e9f0;
  background: #f7fafc;
  color: #6f7f91;
  font-size: 11px;
}

.standards-pagination > div { display: flex; gap: 7px; }
.standard-empty {
  padding: 40px 18px;
  color: var(--home-muted);
  text-align: center;
  line-height: 1.7;
}

.standard-pdf-dialog {
  width: min(1180px, 94vw);
  max-width: none;
}

.standard-pdf-form {
  min-height: 760px;
  display: flex;
  flex-direction: column;
}

.standard-pdf-notice {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line2);
  background: #f8fafc;
  color: #607287;
  font-size: 12px;
}

#standardPdfFrame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #eef2f6;
}

@media (max-width: 1180px) {
  .topbar { padding: 0 18px; gap: 18px; }
  .global-search { display: none; }
  .userbox .quiet { display: none; }
  .page-projects { padding: 28px 24px 48px; }
  .pending-item { grid-template-columns: 4px 1fr auto; }
  .pending-meta { display: none; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .brand-small { min-width: 0; }
  .brand-small > div { display: none; }
  .topnav { margin-left: 2px; gap: 11px; }
  .topnav button, .topnav a { font-size: 12px; }
  .topbar-icon { display: none; }
  .userbox { grid-template-columns: 30px; border-left: 0; padding-left: 0; }
  .user-avatar { width: 30px; height: 30px; }
  .userbox > #userName, .userbox > #userRole { display: none; }
  .page-projects { padding: 22px 14px 40px; }
  .home-heading { align-items: flex-start; }
  .home-heading h1 { font-size: 24px; }
  .home-heading p:last-child { max-width: 240px; line-height: 1.6; }
  .home-panel-head { align-items: flex-start; }
  .recent-heading { flex-direction: column; }
  .project-controls { width: 100%; flex-wrap: wrap; }
  .project-search { width: 100%; }
  .pending-item { grid-template-columns: 4px 1fr; gap: 11px; }
  .pending-action { grid-column: 2; justify-self: start; }
  .create-project-button { white-space: nowrap; }
}

/* New-project dialog: make the two permanent choices explicit. */
.project-create-dialog { width: min(860px, 94vw); max-height: 92vh; }
.project-create-dialog .dialog-head { align-items: flex-start; }
.project-create-dialog .dialog-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.project-create-body { padding: 20px 24px; max-height: calc(92vh - 155px); overflow: auto; background: #fbfcfe; }
.project-basic-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.project-basic-grid label { margin-bottom: 12px; }
.choice-fieldset { border: 0; padding: 0; margin: 8px 0 20px; }
.choice-fieldset legend { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.choice-fieldset legend > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; }
.choice-fieldset legend em { margin-left: auto; color: #8a5c24; font-size: 12px; font-style: normal; font-weight: 500; }
.choice-cards { display: grid; gap: 12px; }
.basis-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-choice { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-cards label { margin: 0; cursor: pointer; }
.choice-cards input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { min-height: 98px; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 15px; border: 1px solid #ccd7e3; border-radius: 11px; background: #fff; transition: .18s; box-shadow: 0 2px 8px rgba(31,54,78,.04); }
.choice-card > b { grid-row: 1 / 4; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: #edf3f8; color: #31546f; font-size: 17px; }
.choice-card > strong { font-size: 15px; }
.choice-card > small, .choice-card > i { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 500; line-height: 1.45; }
.choice-card.recommended { position: relative; }
.choice-card.recommended::after { content: "推荐新项目"; position: absolute; right: 10px; top: 8px; color: #08766f; font-size: 10px; font-weight: 700; }
.choice-cards input:checked + .choice-card { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,193,.12); background: #f7fbff; }
.choice-cards input:checked + .choice-card > b { background: var(--blue); color: #fff; }
.choice-cards input:focus-visible + .choice-card { outline: 2px solid var(--blue); outline-offset: 2px; }
.optional-project-fields { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.optional-project-fields summary { padding: 12px 14px; cursor: pointer; color: #496175; font-size: 13px; font-weight: 700; }
.optional-project-fields[open] summary { border-bottom: 1px solid var(--line2); }
.optional-project-fields .project-basic-grid { padding: 14px; }
.template-option { margin: 0 0 13px !important; padding: 12px 14px; display: flex !important; flex-direction: row !important; align-items: flex-start !important; gap: 10px !important; border: 1px solid #cce4df; border-radius: 9px; background: #f4fbf9; }
.template-option input { margin-top: 3px; }
.template-option span { display: flex; flex-direction: column; gap: 3px; }
.template-option small { color: var(--muted); font-weight: 500; }
.project-lock-summary { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-radius: 9px; background: #f1f4f7; color: #51677b; }
.project-lock-summary > span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #d6dfe8; border-radius: 50%; background: #fff; font-size: 12px; }
.project-lock-summary div { display: flex; flex-direction: column; gap: 3px; }
.project-lock-summary small { font-size: 12px; }
.project-lock-summary.ready { background: #eaf6ff; color: #144d7d; }
@media (max-width: 720px) {
  .project-basic-grid, .basis-choice, .result-choice { grid-template-columns: 1fr; }
  .choice-card { min-height: 82px; }
  .project-create-body { padding: 16px; }
}
