:root {
  color-scheme: light;
  --ink: #102a2a;
  --muted: #667776;
  --paper: #f5f7f3;
  --card: #ffffff;
  --line: #dde5e1;
  --teal: #0f766e;
  --teal-dark: #095b55;
  --teal-soft: #e4f3ee;
  --red: #b6362d;
  --gold: #c38b33;
  --wechat: #07c160;
  --alipay: #1677ff;
  --shadow: 0 18px 60px rgba(21, 55, 50, 0.1);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--paper); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(221, 229, 225, 0.85);
  background: rgba(245, 247, 243, 0.92);
  backdrop-filter: blur(14px);
}

.brand, .pay-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand span:last-child, .pay-brand span:last-child { display: grid; gap: 2px; }
.brand strong, .pay-brand strong { font-size: 15px; letter-spacing: 0.02em; }
.brand small, .pay-brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #b63b30, #872921);
  box-shadow: 0 8px 24px rgba(182, 54, 45, 0.25);
  font-family: STKaiti, KaiTi, serif;
  font-size: 23px;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 20px;
  color: #6d501a;
  background: #fff4cf;
  border-bottom: 1px solid #f1dda1;
  font-size: 13px;
}

.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(195, 139, 51, 0.15); }
.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 54px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(460px, 1.14fr); align-items: center; gap: 70px; }
.hero-copy { position: relative; padding-left: 20px; }
.hero-copy::before { position: absolute; inset: -120px auto auto -110px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(15, 118, 110, 0.1), transparent 68%); content: ""; pointer-events: none; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.hero-copy h1 { margin: 0; font-family: STKaiti, KaiTi, "Microsoft YaHei", serif; font-size: clamp(42px, 5vw, 66px); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; }
.hero-copy > p:not(.eyebrow) { max-width: 510px; margin: 24px 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.status-row { display: flex; flex-wrap: wrap; gap: 10px; }
.provider-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.provider-pill::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.provider-pill.ready.provider-wechat { color: #078d49; background: #ecfff5; border-color: #bcebd1; }
.provider-pill.ready.provider-alipay { color: #1267dc; background: #edf5ff; border-color: #c7ddfb; }
.provider-pill.disabled { opacity: 0.55; text-decoration: line-through; }

.card { border: 1px solid rgba(213, 224, 219, 0.9); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.import-card { position: relative; overflow: hidden; padding: 30px; }
.import-card::after { position: absolute; right: -46px; top: -72px; width: 180px; height: 180px; border: 32px solid rgba(15, 118, 110, 0.05); border-radius: 50%; content: ""; pointer-events: none; }
.section-heading, .section-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading > div, .section-toolbar > div:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.section-heading h2, .section-toolbar h2 { margin: 0; font-size: 20px; }
.section-toolbar p { grid-column: 2; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.step { display: inline-grid; width: 32px; height: 24px; place-items: center; border-radius: 7px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 800; }
.dialog-actions { display: grid; gap: 10px; margin-top: 12px; }
.file-type { padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 26px 0 16px; }
.form-grid .form-full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #4f605f; font-size: 12px; font-weight: 700; }
input, select { min-height: 43px; border: 1px solid #d7e0dc; border-radius: 11px; outline: 0; background: #fbfcfa; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
input { width: 100%; padding: 0 13px; }
select { padding: 0 34px 0 12px; }
input:focus, select:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11); }
.drop-zone { display: grid; min-height: 142px; padding: 22px; place-items: center; align-content: center; gap: 8px; border: 1.5px dashed #9bbeb6; border-radius: 16px; color: var(--ink); background: #f7fbf8; text-align: center; cursor: pointer; transition: 0.2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-1px); }
.drop-zone strong { font-size: 14px; }
.drop-zone small { max-width: 410px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.upload-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-size: 20px; }
.import-preview { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 14px; border-radius: 13px; background: #eef7f3; }
.import-preview > div { display: grid; gap: 4px; min-width: 0; }
.import-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.import-preview span { color: var(--muted); font-size: 11px; }

.button { display: inline-flex; min-height: 42px; padding: 0 17px; align-items: center; justify-content: center; border: 0; border-radius: 11px; font-weight: 750; font-size: 13px; text-decoration: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.button-primary { color: #fff; background: var(--teal); box-shadow: 0 8px 20px rgba(15, 118, 110, 0.2); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.button-secondary:hover, .button-ghost:hover { background: #edf3ef; }
.button-ghost { color: var(--muted); background: transparent; }
.button-small { min-height: 36px; padding-inline: 12px; }
.button-full { width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 62px 0 22px; }
.stat-card { position: relative; overflow: hidden; padding: 22px; box-shadow: 0 10px 34px rgba(21, 55, 50, 0.06); }
.stat-card > span { display: block; color: var(--muted); font-size: 12px; }
.stat-card > strong { display: block; margin: 8px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; letter-spacing: -0.03em; }
.stat-card > small { color: #8a9895; font-size: 10px; }
.stat-accent { color: #fff; border-color: var(--teal); background: linear-gradient(145deg, #0f766e, #075852); }
.stat-accent > span, .stat-accent > small { color: rgba(255, 255, 255, 0.74); }

.member-section { padding: 28px; box-shadow: 0 12px 40px rgba(21, 55, 50, 0.07); }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.filters { display: grid; grid-template-columns: auto 1fr auto auto; align-items: end; gap: 10px; margin: 26px 0 14px; }
.campaign-filter { min-width: 230px; }
.search-box { position: relative; display: block; }
.search-box span { position: absolute; left: 14px; top: 50%; color: var(--muted); font-size: 20px; transform: translateY(-52%); }
.search-box input { padding-left: 42px; }
.table-wrap { overflow-x: auto; border: 1px solid #e3e9e6; border-radius: 15px; }
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th { padding: 13px 15px; color: #74827f; background: #f7f9f7; font-size: 11px; font-weight: 800; text-align: left; letter-spacing: 0.04em; }
td { padding: 14px 15px; border-top: 1px solid #ebefed; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fbfdfb; }
.member-name { display: grid; gap: 3px; }
.member-name strong { font-size: 14px; }
.member-name small, .dept-cell small { color: var(--muted); font-size: 10px; }
.dept-cell { display: grid; gap: 3px; }
.amount-value { font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 700; }
.missing-amount { color: var(--red); font-size: 11px; font-weight: 750; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-chip::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-paid { color: #087b47; background: #e7f8ef; }
.status-reviewing { color: #9a6b15; background: #fff1c9; }
.status-unpaid { color: #8a641f; background: #fff4d9; }
.status-missing { color: #a0362e; background: #fdeae8; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.text-button { padding: 6px 8px; border: 0; border-radius: 7px; color: var(--teal); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.text-button:hover { background: var(--teal-soft); }
.text-button.danger { color: var(--red); }
.empty-state { display: grid; min-height: 250px; place-items: center; align-content: center; gap: 7px; text-align: center; }
.empty-state > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; color: var(--teal); background: var(--teal-soft); font-family: STKaiti, KaiTi, serif; font-size: 22px; }
.empty-state strong { margin-top: 4px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
footer { padding: 0 20px 36px; color: #84918e; font-size: 10px; text-align: center; }

.modal { width: min(430px, calc(100vw - 32px)); padding: 30px; border: 1px solid rgba(213, 224, 219, 0.9); border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(9, 38, 35, 0.25); }
.modal::backdrop { background: rgba(13, 34, 33, 0.48); backdrop-filter: blur(5px); }
.modal h2 { margin: 0 0 8px; font-size: 24px; }
.modal > p, .modal form > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.modal form { display: grid; gap: 18px; }
.modal-close { position: absolute; right: 15px; top: 14px; display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: #f1f5f2; font-size: 21px; cursor: pointer; }
.modal-icon { display: grid; width: 46px; height: 46px; margin-bottom: 22px; place-items: center; border-radius: 15px; color: #fff; background: var(--red); font-family: STKaiti, KaiTi, serif; font-size: 24px; }
.form-error { margin: -7px 0 !important; color: var(--red) !important; }
.qr-modal, .payment-modal { text-align: center; }
.qr-box { display: grid; width: min(250px, 70vw); aspect-ratio: 1; margin: 20px auto; place-items: center; overflow: hidden; border: 8px solid #fff; border-radius: 14px; outline: 1px solid var(--line); background: #fff; }
.qr-box svg, .qr-box img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.modal-description { margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.link-field { margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.provider-logo { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 15px; color: #fff; background: var(--alipay); font-size: 24px; font-weight: 900; }
.provider-logo.wechat { background: var(--wechat); }
.payment-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 11px; }

.pay-page { min-height: 100vh; padding: max(22px, env(safe-area-inset-top)) 16px max(26px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 20% 0%, rgba(15, 118, 110, 0.14), transparent 35%), linear-gradient(180deg, #f2f7f3, #edf2ef); }
.pay-shell { width: min(460px, 100%); margin: 0 auto; }
.pay-brand { display: flex; margin: 6px 0 22px; justify-content: center; }
.pay-card { min-height: 560px; padding: 28px; border: 1px solid rgba(213, 224, 219, 0.9); border-radius: 26px; background: #fff; box-shadow: 0 22px 70px rgba(21, 55, 50, 0.12); }
.pay-loading { display: grid; min-height: 500px; place-items: center; align-content: center; gap: 18px; color: var(--muted); font-size: 13px; }
.verify-panel { display: grid; min-height: 500px; align-content: center; text-align: center; }
.verify-panel h1 { margin-bottom: 22px; }
.verify-panel h2 { margin: 0 0 8px; font-size: 21px; }
.verify-panel > p:not(.pay-period):not(.privacy-note) { max-width: 320px; margin: 0 auto 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.verify-panel form { display: grid; gap: 15px; text-align: left; }
.privacy-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 18px; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--teal), #075852); font-family: STKaiti, KaiTi, serif; font-size: 24px; box-shadow: 0 10px 25px rgba(15, 118, 110, 0.2); }
.privacy-note { margin: 18px 0 0; color: #889692; font-size: 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid #dfe9e4; border-top-color: var(--teal); border-radius: 50%; animation: spin 0.75s linear infinite; }
.spinner-small { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.demo-badge { width: fit-content; margin: 0 auto 18px; padding: 6px 10px; border-radius: 999px; color: #75551a; background: #fff3ce; font-size: 10px; font-weight: 750; }
.pay-period { margin: 0; color: var(--teal); font-size: 12px; font-weight: 800; text-align: center; letter-spacing: 0.12em; }
.pay-card h1 { margin: 6px 0 24px; font-family: STKaiti, KaiTi, serif; font-size: 30px; text-align: center; }
.identity-card { display: grid; gap: 12px; padding: 18px; border-radius: 15px; background: #f6f9f7; }
.identity-card > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.identity-card span { color: var(--muted); font-size: 11px; }
.identity-card strong { font-size: 12px; text-align: right; }
.amount-block { display: grid; margin: 27px 0; place-items: center; gap: 7px; }
.amount-block span { color: var(--muted); font-size: 11px; }
.amount-block strong { font-family: Georgia, "Times New Roman", serif; font-size: 43px; letter-spacing: -0.03em; }
.choice-title { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.pay-button { display: grid; grid-template-columns: 42px 1fr auto; width: 100%; min-height: 64px; margin: 10px 0; padding: 0 16px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: left; cursor: pointer; transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s; }
.pay-button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(21, 55, 50, 0.08); }
.pay-button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.pay-button > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #fff; font-size: 19px; font-weight: 900; }
.pay-button strong { font-size: 14px; }
.pay-button small { color: var(--muted); font-size: 10px; }
.wechat-button > span { background: var(--wechat); }
.wechat-button:hover { border-color: rgba(7, 193, 96, 0.45); }
.alipay-button > span { background: var(--alipay); }
.alipay-button:hover { border-color: rgba(22, 119, 255, 0.45); }
.pay-note, .secure-note { color: #8b9794; font-size: 10px; line-height: 1.7; text-align: center; }
.secure-note { margin: 18px 0 0; }
.paid-panel { display: grid; min-height: 235px; place-items: center; align-content: center; gap: 8px; border-radius: 18px; background: #effaf4; text-align: center; }
.paid-panel h2 { margin: 4px 0 0; font-size: 21px; }
.paid-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.reviewing-panel { background: #fff8e7; }
.reviewing-panel .success-icon { background: var(--gold); font-size: 18px; font-weight: 800; }
.missing-panel { background: #fff1ef; }
.missing-panel .success-icon { background: var(--red); }
.success-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: #fff; background: var(--wechat); font-size: 28px; }
.pay-error { display: grid; min-height: 500px; place-items: center; align-content: center; gap: 10px; text-align: center; }
.pay-error > span { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-size: 26px; font-weight: 800; }
.pay-error h2 { margin: 8px 0 0; }
.pay-error p { max-width: 310px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.toast { position: fixed; z-index: 100; left: 50%; top: 18px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 11px; color: #fff; background: #183c39; box-shadow: 0 12px 35px rgba(9, 35, 33, 0.24); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, -12px); transition: 0.22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy { padding-left: 0; text-align: center; }
  .hero-copy > p:not(.eyebrow) { margin-inline: auto; }
  .status-row { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .topbar { height: 66px; padding: 0 16px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .page-shell { width: calc(100% - 28px); padding: 42px 0; }
  .hero-copy h1 { font-size: 41px; }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; }
  .import-card, .member-section { padding: 20px; border-radius: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .form-full { grid-column: 1; }
  .stats-grid { margin-top: 38px; gap: 10px; }
  .stat-card { padding: 17px; border-radius: 16px; }
  .stat-card > strong { font-size: 24px; }
  .section-toolbar { display: grid; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1 1 calc(50% - 5px); padding-inline: 10px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .campaign-filter, .search-box { grid-column: 1 / -1; }
  .mode-banner { justify-content: flex-start; font-size: 11px; }
  .import-preview { align-items: stretch; flex-direction: column; }
  .pay-card { min-height: auto; padding: 23px 19px; border-radius: 22px; }
  .identity-card { padding: 16px; }
  .modal { padding: 25px 20px; }
}

@media print {
  .topbar, .mode-banner, .hero-grid, .toolbar-actions, .filters, footer { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  .member-section { border: 0; box-shadow: none; }
}
