:root {
  --ink: #20242a;
  --muted: #6e737a;
  --line: #e5e7eb;
  --panel: #ffffff;
  --surface: #f5f7f9;
  --brand: #b21e35;
  --brand-dark: #8e1629;
  --warning: #fff7df;
  --danger: #a51d2d;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 56px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 20px 24px; background: linear-gradient(120deg, #fff, #fff9f7); border: 1px solid #f0dfe0; border-radius: 18px; box-shadow: 0 12px 32px rgba(75, 37, 39, .06); }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 52px; height: 52px; object-fit: contain; border-radius: 12px; background: #fff; }
.eyebrow, .step { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(22px, 4vw, 34px); line-height: 1.15; }
h1 small { color: var(--muted); font-size: .45em; font-weight: 500; }
h2 { display: inline; font-size: 20px; margin-left: 8px; }
.hero p, .panel-heading p { color: var(--muted); font-size: 13px; margin-top: 7px; }
.privacy-pill, .status { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; color: #5a626b; background: #f0f2f4; font-size: 12px; white-space: nowrap; }
.quote-layout { display: grid; gap: 16px; }
.panel { min-width: 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 18px rgba(26, 32, 38, .035); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading > div:first-child { min-width: 0; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 700; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.ghost { color: var(--brand); background: #fff; border-color: #e7bec3; }
.button.danger, .icon-button.danger { color: var(--danger); }
.button.tiny { padding: 5px 9px; font-size: 12px; background: #fff; border-color: #d7dbe0; color: #4d555e; }
.button.tiny:hover { border-color: var(--brand); color: var(--brand); }
.button.tiny.danger { border-color: #efc4c9; color: var(--danger); }
.plan-add-row, .inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
label { display: grid; gap: 6px; color: #4f5660; font-size: 13px; font-weight: 600; }
input, select { min-height: 38px; padding: 7px 10px; color: var(--ink); background: #fff; border: 1px solid #d8dde3; border-radius: 8px; outline: none; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(178, 30, 53, .1); }
.plan-add-row select { min-width: min(540px, 100%); flex: 1; }
.selected-plans { display: grid; gap: 8px; margin-top: 13px; }
.selected-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #ead7d9; border-radius: 10px; background: #fffafa; }
.selected-plan small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }




.icon-button { padding: 4px 8px; border: 0; background: transparent; font-size: 12px; }
.members-list { display: grid; gap: 9px; min-width: 0; }
.member-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(92px, .45fr) minmax(0, 1fr) auto; align-items: end; column-gap: 12px; row-gap: 10px; min-width: 0; padding: 10px; border: 1px solid #e6e8eb; border-radius: 10px; background: #fcfcfd; }
.member-row > label { min-width: 0; }
.member-row input, .member-row select { width: 100%; min-width: 0; }
.row-number { align-self: center; color: var(--brand); font-weight: 700; text-align: center; }
.member-plan-field { min-width: 0; }
.member-plan-empty { display: block; min-height: 38px; }
.benefit-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.benefit-card { display: flex; grid-template-columns: none; align-items: center; gap: 7px; padding: 10px 13px; background: #fffafa; border: 1px solid #ead7d9; border-radius: 10px; }
.benefit-card input { min-height: 0; }
.switch-label { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: #565e67; font-size: 13px; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 40px; height: 22px; background: #cbd0d6; border-radius: 999px; transition: .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .15s; }
.switch-label input:checked + .switch { background: var(--brand); }
.switch-label input:checked + .switch::after { transform: translateX(18px); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.plan-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px; background: #fffafa; border-bottom: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.plan-tab { flex: 0 0 auto; min-width: 120px; padding: 9px 13px; color: #6b5558; background: #fff; border: 1px solid #ead7d9; border-radius: 9px; font-size: 12px; font-weight: 700; text-align: center; }
.plan-tab:hover { color: var(--brand); border-color: #d19496; }
.plan-tab[aria-selected="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.config-table, .rate-table, .data-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.config-table th, .config-table td, .rate-table th, .rate-table td, .data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 12px; }
.config-table th:not(:first-child), .config-table td:not(:first-child), .rate-table th:not(:first-child), .rate-table td:not(:first-child) { text-align: center; }
.config-table thead .table-title th, .rate-table caption { padding: 11px; color: #fff; background: var(--brand); font-size: 14px; font-weight: 700; text-align: center; }
.config-table thead .table-head th, .rate-table thead th { color: #fff; background: #d19496; font-weight: 700; }
.config-table tbody th { width: 35%; background: #f7f7f7; font-weight: 600; }
.config-table .section-row th, .config-table .section-row td { color: #fff; background: #d8a0a0; font-weight: 700; }
.config-table .section-row .cell-value { color: #fff; }
.config-table .one-line-row th { width: auto; text-align: center; }
.benefit-value-cell { text-align: center; }
.cell-value { min-height: 26px; line-height: 1.4; }
.cell-select { width: 100%; min-height: 32px; padding: 4px 7px; font-size: 12px; text-align: center; text-align-last: center; }
.cell-select option { text-align: center; }
.static-choice { color: #555d65; }
.live-heading { align-items: center; }
.rate-table-box { overflow-x: auto; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 8px; }
.rate-table { min-width: 560px; }
.rate-table caption { caption-side: top; }
.rate-table tbody th { background: #f7f7f7; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.summary-card { display: grid; gap: 5px; padding: 13px; border: 1px solid #ead7d9; border-radius: 10px; background: #fffafa; color: #59616b; font-size: 13px; }
.summary-card strong { color: var(--ink); font-size: 15px; white-space: pre-line; }
.summary-card b { padding-top: 6px; color: var(--brand); border-top: 1px solid #f0dfe0; font-size: 19px; }
.total-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; padding: 12px 14px; color: #5a626b; background: #f8f9fa; border-radius: 9px; }
.total-strip strong { color: var(--brand); }
.notice { padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.notice.warning { color: #7a5b12; background: var(--warning); border: 1px solid #f0dea4; }
.notice.error { color: #8c1c2b; background: #fff0f2; border: 1px solid #edc3c9; }
.empty { padding: 16px; color: var(--muted); text-align: center; font-size: 13px; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(32, 36, 42, .38); }
.modal-card { width: min(440px, 100%); padding: 22px; background: #fff; border: 1px solid #f0dfe0; border-radius: 16px; box-shadow: 0 20px 60px rgba(60, 33, 36, .2); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-heading h3 { margin: 0; color: var(--ink); font-size: 18px; }
.modal-message { margin: 16px 0 20px; color: #59616b; font-size: 14px; line-height: 1.7; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.created-link[hidden], .modal-backdrop[hidden] { display: none !important; }
.inline-message { margin-top: 10px; font-size: 12px; }
.warning-text { color: #9a6f16; }
.success-text { color: #357052; }
.warning-list { display: grid; gap: 7px; margin-top: 12px; }
.loading-card { padding: 30px; color: var(--muted); text-align: center; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: linear-gradient(145deg, #fff7f5, #f5f7f9); }
.auth-card { width: min(420px, 100%); padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(60, 33, 36, .1); }
.auth-logo { display: block; width: 74px; height: 74px; margin: 0 auto 14px; object-fit: contain; }
.auth-card h1 { text-align: center; font-size: 24px; }
.muted { color: var(--muted); font-size: 13px; text-align: center; }
.stack-form { display: grid; gap: 14px; margin-top: 22px; }
.admin-hero { margin-bottom: 16px; }
.admin-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.admin-shell main { display: grid; gap: 16px; }
.inline-form label { min-width: 170px; flex: 1; }
.created-link { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 12px; background: #f1faf4; border: 1px solid #cce7d5; border-radius: 9px; color: #28633d; font-size: 13px; }
.created-link code { overflow-wrap: anywhere; color: var(--ink); }
.data-table { min-width: 850px; }
.data-table th { color: #5f6770; background: #f7f8f9; font-weight: 700; white-space: nowrap; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); }
.data-table code { color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 5px; }
.status.active { color: #287044; background: #e5f5ea; }
.status.inactive { color: #7c5b13; background: #fff4d7; }
.status.expired, .status.disabled { color: #8c1c2b; background: #fff0f2; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 10px; }
  .hero { align-items: flex-start; flex-direction: column; padding: 16px; }
  .privacy-pill { align-self: flex-start; }
  .hero-actions { align-self: stretch; justify-content: space-between; }
  .panel { padding: 15px; }
  .panel-heading { flex-direction: column; }
  .panel-heading .button, .switch-label { align-self: flex-start; }
  .member-row { grid-template-columns: 24px minmax(0, 1fr) 80px auto; column-gap: 10px; row-gap: 8px; }
  .member-row > .row-number { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .member-row > .icon-button { grid-column: 4; grid-row: 1 / span 2; align-self: center; }
  .member-plan-field { grid-column: 2 / 4; grid-row: 2; }
  .member-plan-empty { display: none; }
  .admin-user { align-items: flex-start; flex-direction: column; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form label { width: 100%; }
}

/* Applicant-centric quote flow */
.applicant-list-heading { align-items: center; }
.applicants-list { display: grid; gap: 18px; }
.applicant-card { overflow: hidden; border: 1px solid #e2e5e9; border-radius: 15px; background: #fbfcfd; box-shadow: 0 8px 24px rgba(32, 36, 42, .045); }
.applicant-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: linear-gradient(110deg, #fff7f5, #fff); border-bottom: 1px solid #ecdddf; }
.applicant-card-heading > div:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
.applicant-card-heading h3 { font-size: 18px; }
.applicant-card-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.applicant-index { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--brand); border-radius: 11px; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.applicant-actions { display: flex; align-items: center; gap: 9px; }
.status-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge.complete { color: #286642; background: #e7f5ec; }
.status-badge.pending { color: #80601a; background: #fff5db; }
.applicant-basics { display: grid; grid-template-columns: minmax(150px, .55fr) minmax(280px, 1.45fr); gap: 14px; padding: 18px; background: #fff; }
.applicant-basics label { align-content: start; min-width: 0; }
.applicant-basics select, .applicant-basics input { width: 100%; }
.mini-step { display: inline-grid; min-width: 25px; min-height: 21px; place-items: center; margin-right: 4px; padding: 2px 5px; color: var(--brand); background: #fbeaec; border-radius: 6px; font-size: 10px; letter-spacing: .04em; }
.field-hint, .field-error { min-height: 16px; color: var(--muted); font-size: 11px; font-weight: 500; }
.field-error { color: var(--danger); }
.input-error { border-color: var(--danger) !important; background: #fff8f9; }
.applicant-onboarding { margin: 0 18px 18px; padding: 18px; color: var(--muted); background: #f7f8f9; border: 1px dashed #d8dce1; border-radius: 11px; text-align: center; font-size: 13px; }
.applicant-workflow { display: grid; gap: 0; border-top: 1px solid var(--line); }
.workflow-section { padding: 18px; background: #fff; border-bottom: 1px solid var(--line); }
.workflow-title { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 14px; }
.workflow-title .mini-step { flex: 0 0 auto; margin-top: 1px; }
.workflow-title h4 { margin: 0; color: #30363d; font-size: 15px; }
.workflow-title p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.core-config-details { padding: 0; }
.core-config-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; cursor: pointer; list-style: none; }
.core-config-details > summary::-webkit-details-marker { display: none; }
.core-config-details[open] > summary { border-bottom: 1px solid var(--line); }
.core-config-summary-title, .core-config-summary-actions { display: inline-flex; align-items: center; gap: 8px; }
.core-config-summary-title { color: #30363d; font-size: 15px; font-weight: 700; }
.core-config-summary-title .mini-step { margin-right: 0; }
.config-lock-badge { padding: 4px 8px; color: #6a5a25; background: #fff3cf; border: 1px solid #ead89c; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.core-config-details > summary .details-chevron { margin-right: 3px; }
.core-config-details[open] > summary .details-chevron { margin-top: 4px; transform: rotate(225deg); }
.core-config-details-body { padding: 18px; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.config-field { min-width: 0; padding: 11px; background: #fafbfc; border: 1px solid #e6e8eb; border-radius: 10px; }
.config-field > span { min-height: 36px; color: #4b535c; line-height: 1.45; }
.config-field select { width: 100%; min-width: 0; }
.config-static { display: flex; min-height: 38px; align-items: center; padding: 8px 10px; color: #555d65; background: #f0f2f4; border: 1px solid #e1e4e7; border-radius: 8px; font-weight: 500; }
.config-static.is-locked::after { content: "已锁定"; flex: 0 0 auto; margin-left: auto; padding-left: 8px; color: #8b7073; font-size: 10px; }
.optional-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.optional-choice { display: flex; grid-template-columns: none; align-items: center; gap: 10px; min-width: 0; padding: 13px; background: #fff; border: 1px solid #dde1e5; border-radius: 11px; cursor: pointer; transition: .15s ease; }
.optional-choice:hover { border-color: #d6a8ae; }
.optional-choice.selected { background: #fff7f7; border-color: #d69ba3; box-shadow: 0 0 0 2px rgba(178, 30, 53, .05); }
.optional-choice input { flex: 0 0 auto; min-height: 0; accent-color: var(--brand); }
.optional-choice span { display: grid; gap: 3px; min-width: 0; }
.optional-choice b { color: #3e454d; font-size: 13px; }
.optional-choice small { color: var(--muted); font-size: 11px; font-weight: 500; }
.optional-config { margin-top: 14px; padding: 14px; background: #fffafa; border: 1px solid #efdddf; border-radius: 11px; }
.optional-config h5 { margin: 0 0 11px; color: #66575a; font-size: 13px; }
.premium-section { background: #fcfcfd; }
.personal-premium-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.personal-premium-grid > div { display: grid; gap: 5px; min-width: 0; padding: 14px; background: #fff; border: 1px solid #e2e5e8; border-radius: 11px; }
.personal-premium-grid > div.premium-total { background: #fff6f6; border-color: #e6bdc2; }
.personal-premium-grid span { color: #626a73; font-size: 12px; }
.personal-premium-grid strong { color: #30363d; font-size: 20px; }
.personal-premium-grid .premium-total strong { color: var(--brand); }
.personal-premium-grid small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; }
.premium-placeholder { padding: 16px; color: var(--muted); background: #f7f8f9; border: 1px dashed #d7dbe0; border-radius: 10px; text-align: center; font-size: 12px; }
.applicant-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; background: #f8f9fa; }
.applicant-details-grid details { min-width: 0; background: #fff; border: 1px solid #dde1e5; border-radius: 11px; }
.applicant-details-grid details[open] { grid-column: 1 / -1; }
.applicant-details-grid summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; color: #414850; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; }
.applicant-details-grid summary::-webkit-details-marker { display: none; }
.details-chevron { flex: 0 0 auto; width: 9px; height: 9px; margin: -4px 3px 0 0; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .18s ease, margin .18s ease; }
.applicant-details-grid details[open] .details-chevron { margin: 4px 3px 0 0; transform: rotate(225deg); }
.details-body { padding: 0 13px 13px; }
.applicant-benefit-table { min-width: 560px; }
.rate-table-stack { display: grid; gap: 12px; }
.rate-table-stack .rate-table-box { margin-bottom: 0; }
.current-rate-row th, .current-rate-row td { color: var(--brand); background: #fff5f5 !important; font-weight: 700; }
.notice.subtle { color: #626a73; background: #f5f7f8; border: 1px solid #e1e4e7; }
.summary-note { margin-top: 12px; }
.empty.compact { padding: 12px; }
.applicant-empty { border: 1px dashed #d8dce0; border-radius: 11px; }

@media (max-width: 760px) {
  .applicant-list-heading { align-items: flex-start; }
  .applicant-card-heading { align-items: flex-start; padding: 14px; }
  .applicant-card-heading p { display: none; }
  .applicant-actions { align-items: flex-end; flex-direction: column; }
  .applicant-basics, .config-grid, .optional-grid, .personal-premium-grid, .applicant-details-grid { grid-template-columns: 1fr; }
  .applicant-basics, .workflow-section, .applicant-details-grid { padding: 14px; }
  .core-config-details { padding: 0; }
  .core-config-details > summary, .core-config-details-body { padding: 14px; }
  .applicant-details-grid details[open] { grid-column: auto; }
  .applicant-details-grid summary { align-items: center; flex-direction: row; }
}
