:root {
  color-scheme: light;
  --red: #9f1d2e;
  --blue: #19578f;
  --gold: #966100;
  --ink: #111827;
  --text: #344054;
  --muted: #667085;
  --line: #e6eaf0;
  --bg: #f5f7fb;
  --paper: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #111827;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-weight: 800;
}

.brand span {
  color: #f4c76a;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.brand-logo {
  width: 144px;
  height: 50px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:hover {
  color: #f7c35f;
}

.nav-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.nav-alert.active {
  border-color: rgba(247, 195, 95, 0.78);
  background: rgba(247, 195, 95, 0.14);
  color: #f7c35f;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f7c35f;
  color: #111827;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.hero {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 42px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 56px;
}

.eyebrow {
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  margin: 12px 0 18px;
  color: var(--ink);
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: 0;
}

.lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 750;
}

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

.button.danger {
  border-color: rgba(159, 29, 46, 0.28);
  background: #fff1f2;
  color: var(--red);
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.status-panel {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  padding: 24px;
}

.panel-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.check-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.check-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.check-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.06);
}

.card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.metric {
  color: var(--red);
  font-size: 34px;
  line-height: 1.1;
  font-weight: 850;
}

.api-list {
  display: grid;
  gap: 10px;
}

.api-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.method {
  min-width: 50px;
  color: var(--blue);
  font-weight: 800;
}

.doc {
  max-width: 780px;
}

.doc h1 {
  font-size: 34px;
}

.doc h2 {
  margin-top: 30px;
  font-size: 22px;
}

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: #f9fbff;
  font-weight: 800;
}

.table-sort {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.management-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.management-card {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 18px;
  border-left: 5px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.management-card:hover,
.management-card.is-active {
  border-color: var(--red);
  box-shadow: 0 14px 30px rgba(31, 41, 55, 0.1);
  transform: translateY(-1px);
}

.management-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.management-card em,
.management-card small {
  display: block;
  font-style: normal;
}

.management-card em {
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.management-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.management-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.management-tag.red {
  background: #fff1f2;
  color: var(--red);
}

.management-tag.blue {
  background: #eef6ff;
  color: var(--blue);
}

.management-tag.gold {
  background: #fff8e8;
  color: var(--gold);
}

.management-tag.green {
  background: #edf8f3;
  color: #1f7a5c;
}

.module-panel {
  scroll-margin-top: 92px;
}

.module-panel[hidden],
.management-card[hidden] {
  display: none;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.role-card p {
  margin: 8px 0 0;
  font-size: 14px;
}

.role-member-table {
  margin-top: 18px;
}

.role-member-table table {
  min-width: 860px;
}

.placeholder-card h3 {
  margin-bottom: 8px;
}

.guide-card,
.proposal-editor-card,
.proposal-table-wrap {
  margin-top: 18px;
}

.guide-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-card-head h2 {
  font-size: 20px;
}

.guide-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  background: #f9fbff;
}

.guide-list p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.guide-list strong {
  color: var(--ink);
  font-weight: 780;
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid #d6dbe4;
  border-radius: 8px;
  background: #fff;
}

.file-picker:focus-within {
  border-color: var(--blue);
  outline: 3px solid #eef6ff;
}

.file-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker-name {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker.has-file .file-picker-name {
  color: var(--ink);
}

.file-picker-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 86px;
  margin: 0;
  padding: 0 14px;
  border-left: 1px solid var(--line);
  background: #f9fbff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
}

.proposal-table-wrap table {
  min-width: 820px;
}

.finance-summary-grid {
  margin-bottom: 18px;
}

.finance-opening-panel {
  margin-bottom: 18px;
}

.finance-opening-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
}

.finance-branch-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.finance-branch-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.finance-branch-card strong,
.finance-branch-card span,
.finance-branch-card em {
  display: block;
}

.finance-branch-card strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
}

.finance-branch-card span {
  margin-top: 4px;
  color: var(--red);
  font-size: 16px;
  font-weight: 760;
}

.finance-branch-card em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.finance-table-wrap table {
  min-width: 980px;
}

.finance-editor {
  margin-top: 18px;
}

.finance-direction,
.finance-amount {
  font-weight: 760;
}

.finance-direction.income,
.finance-amount.income {
  color: #1f7a5c;
}

.finance-direction.expense,
.finance-amount.expense {
  color: var(--red);
}

.change-line + .change-line {
  margin-top: 6px;
}

.change-line strong {
  color: var(--ink);
}

.change-arrow {
  display: inline-block;
  margin: 0 6px;
  color: var(--gold);
  font-weight: 800;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-link {
  color: var(--blue);
  font-weight: 750;
}

.review-section {
  scroll-margin-top: 92px;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.admin-panel > * {
  min-width: 0;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 14px;
}

.section-head.compact h2 {
  font-size: 20px;
}

.service-editor-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: start;
}

.service-preview-card {
  box-shadow: none;
}

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

.service-preview-item {
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-preview-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.service-preview-top span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 760;
}

.service-preview-top strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.3;
}

.service-preview-item small,
.service-preview-item em {
  display: block;
  font-style: normal;
}

.service-preview-item small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.service-preview-item em {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.service-preview-item.tone-red .service-preview-top span {
  background: #fff1f2;
  color: var(--red);
}

.service-preview-item.tone-blue .service-preview-top span {
  background: #eef6ff;
  color: var(--blue);
}

.service-preview-item.tone-gold .service-preview-top span {
  background: #fff8e8;
  color: var(--gold);
}

.service-preview-item.tone-green .service-preview-top span {
  background: #edf8f3;
  color: #1f7a5c;
}

.service-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.service-status.green {
  background: #edf8f3;
  color: #1f7a5c;
}

.service-status.blue {
  background: #eef6ff;
  color: var(--blue);
}

.service-status.amber {
  background: #fff8e8;
  color: var(--gold);
}

.service-status.red {
  background: #fff1f2;
  color: var(--red);
}

.service-status.gray {
  background: #f2f4f7;
  color: var(--muted);
}

.service-table-wrap table {
  min-width: 920px;
}

.member-form {
  min-width: 0;
  box-shadow: none;
}

.member-form-sections {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.member-form-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.member-form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.member-form-section h2 {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
}

.member-list-section,
.member-editor-section {
  scroll-margin-top: 92px;
}

.member-list-tools {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.member-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button.member-action {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.08);
}

.button.member-action.red {
  background: var(--red);
}

.button.member-action.slate {
  background: #475467;
}

.member-search {
  width: min(420px, 100%);
}

.member-table-wrap {
  padding: 20px;
  box-shadow: none;
}

.member-table-wrap table {
  min-width: 680px;
}

.member-select,
.member-select-all {
  width: 16px;
  height: 16px;
  padding: 0;
}

.member-dues-panel {
  box-shadow: none;
}

.member-dues-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-dues-entry {
  display: grid;
  grid-template-columns: 100px 120px 130px minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.bulk-member-dues-form {
  grid-template-columns: 100px 100px 120px 130px minmax(150px, 1fr) auto;
}

.member-dues-entry[hidden] {
  display: none;
}

.member-dues-entry label span {
  font-size: 12px;
}

.member-dues-entry input,
.member-dues-entry select {
  height: 34px;
  font-size: 13px;
}

.member-dues-entry-actions {
  display: flex;
  gap: 8px;
}

.member-dues-table-wrap {
  padding: 0;
  box-shadow: none;
}

.member-dues-table-wrap table {
  min-width: 900px;
}

.table-input {
  min-width: 96px;
  height: 34px;
  font-size: 13px;
}

.adoption-reason-select {
  min-width: 132px;
}

.table-primary {
  color: var(--ink);
  font-weight: 720;
}

.form-grid {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-grid label {
  min-width: 0;
}

.field-2 {
  grid-column: span 2;
}

.field-3 {
  grid-column: span 3;
}

.field-4 {
  grid-column: span 4;
}

.field-5 {
  grid-column: span 5;
}

.field-6 {
  grid-column: span 6;
}

.field-8 {
  grid-column: span 8;
}

.field-9 {
  grid-column: span 9;
}

.field-12 {
  grid-column: span 12;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d6dbe4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 138px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid #eef6ff;
}

.permission-panel {
  padding: 14px 16px;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  background: #f9fbff;
}

.permission-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.permission-panel-head span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.permission-panel-head small {
  color: var(--muted);
  font-size: 12px;
}

.permission-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.sync-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sync-status-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.sync-status-grid strong,
.sync-status-grid span {
  display: block;
}

.sync-status-grid strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
}

.sync-status-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  background: #ffffff;
}

.check-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
}

.check-option span {
  display: inline;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.check-option:has(input:disabled) {
  opacity: 0.52;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .hero-inner,
  .grid,
  .role-grid,
  .service-editor-layout,
  .finance-branch-summary,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .member-dues-entry {
    grid-template-columns: 1fr;
  }

  .member-dues-table-wrap {
    overflow-x: visible;
  }

  .member-dues-table-wrap table,
  .member-dues-table-wrap tbody,
  .member-dues-table-wrap tr,
  .member-dues-table-wrap td {
    display: block;
  }

  .member-dues-table-wrap table {
    min-width: 0;
    border: 0;
    background: transparent;
  }

  .member-dues-table-wrap thead {
    display: none;
  }

  .member-dues-table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .member-dues-table-wrap tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .member-dues-table-wrap td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 7px 0;
    border: 0;
  }

  .member-dues-table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
  }

  .member-dues-table-wrap td[colspan] {
    display: block;
    padding: 14px;
    text-align: center;
  }

  .member-dues-table-wrap td[colspan]::before {
    content: "";
  }

  .member-dues-table-wrap .table-input {
    min-width: 0;
    width: 100%;
  }

  .member-dues-table-wrap td[data-label="操作"] .button {
    width: 100%;
  }

  .form-grid label {
    grid-column: 1;
  }

  .form-grid > * {
    grid-column: 1;
  }

  .field-12 {
    grid-column: 1;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  h1 {
    font-size: 34px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
