/* Shared visual layer. Business states and page-specific layouts stay in their original files. */
:root {
  --ink: #203831;
  --sub: #5c6c64;
  --muted: #64705f;
  --line: #dde2d9;
  --canvas: #f5f5ee;
  --card: #fffef9;
  --blue: #245b45;
  --blue-soft: #edf2e7;
  --green: #286448;
  --shadow: 0 4px 20px #243b2b04;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  accent-color: var(--blue);
  color-scheme: light;
}
html { background: var(--canvas); }
body { min-height: 100svh; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
::selection { background: #d5e7c1; color: #203831; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
a { text-underline-offset: 4px; }
button, a, input, select, textarea, summary { transition: background-color .18s, border-color .18s, box-shadow .18s, color .18s; }
:is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid #245b45; outline-offset: 4px; }
input:not([type=checkbox]):not([type=hidden]), select, textarea { border-color: #d9dfd5; background-color: #fffefb; border-radius: 8px; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #7c857d; }
input:focus, select:focus, textarea:focus { border-color: #63866a; box-shadow: 0 0 0 3px #245b4512; }
input[type=checkbox] { accent-color: var(--blue); }
.primary { background: var(--blue); border-radius: 8px; box-shadow: none; letter-spacing: .02em; }
.primary:hover:not(:disabled) { background: #193f30; box-shadow: 0 4px 12px #20383117; transform: none; }
.secondary, .ghost { color: var(--blue); background: var(--blue-soft); border-radius: 7px; }
.secondary:hover:not(:disabled), .ghost:hover:not(:disabled) { background: #e0e9d8; }
.brand { letter-spacing: -.035em; }
.brand-mark, .mark { background: #245b45; box-shadow: none; border-radius: 9px; }
.brand-mark img, .mark img, .password-page .brand > img { filter: hue-rotate(255deg) saturate(.45); }
.secure { color: #365b42; background: #edf3e7; }
.settings-hint, .recent-caption { color: #69756b; line-height: 1.65; }
.toast { background: #203831; }
.payment-sheet, .wechat-bind-dialog, .wallet-dialog, .modal { color: var(--ink); border-radius: 16px; background: #fffef9; }
.payment-modal { visibility: hidden; }
.payment-modal.open { visibility: visible; }
.wallet-dialog::backdrop, .wechat-bind-dialog::backdrop { background: #152a236b; backdrop-filter: blur(5px); }

/* Member workspace */
.member-page .shell { max-width: 1440px; padding: 0 40px 48px; }
.member-page .topbar { min-height: 82px; height: auto; margin: 0; border-bottom: 1px solid var(--line); gap: 20px; }
.member-page .brand { font-size: 18px; }
.member-page .brand-mark { width: 34px; height: 34px; }
.member-page .account { padding: 5px 11px 5px 5px; background: #fffef9; }
.member-page .avatar { color: #36543d; background: #e2e9d9; }
.member-page .admin-link { color: #52664e; background: transparent; min-height: 32px; }
.workspace-intro { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 34px 0 28px; }
.studio-eyebrow { display: flex; align-items: center; gap: 10px; color: #53694f; font-size: 10px; font-weight: 650; letter-spacing: .16em; line-height: 1.5; }
.studio-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6d8755; }
.workspace-intro h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.3; letter-spacing: -.055em; margin: 10px 0 0; font-weight: 600; }
.workspace-intro p { color: var(--sub); font-size: 12px; line-height: 1.8; margin: 8px 0 0; }
.workspace-flow { display: flex; align-items: center; gap: 13px; color: #626f5e; font-size: 11px; white-space: nowrap; padding-bottom: 6px; }
.workspace-flow b { color: #365741; font: 12px "Segoe UI", sans-serif; margin-right: 5px; }
.workspace-flow i { color: #9da68e; font-style: normal; }
.member-page .grid { grid-template-columns: minmax(0, 1.85fr) minmax(310px, 1fr); gap: 22px; }
.member-page .card { background: #fffef9; border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: none; }
.member-page .main-card { padding: 28px; border-top: 3px solid #42684c; }
.member-page .card-header { margin-bottom: 22px; }
.member-page .card-title { font-size: 21px; font-weight: 650; }
.member-page .card-title small { display: block; font-size: 10px; letter-spacing: .16em; color: #64745c; margin-bottom: 6px; font-weight: 500; }
.member-page .types { gap: 7px; margin-bottom: 18px; }
.member-page .type { border: 1px solid #e0e5da; background: #f5f6ef; border-radius: 7px; padding: 10px 14px; }
.member-page .type.active { color: #245b45; border-color: #8fa683; background: #edf2e5; }
.member-page .type.active span { color: #57734c; }
.member-page .ai-fill { border: 1px solid #dde5d5; border-radius: 8px; background: #f4f6ec; margin-bottom: 22px; }
.member-page .ai-fill summary { color: #3f6449; padding: 12px 14px; }
.member-page .ai-fill summary span { color: #5d7054; }
.member-page .form-grid { gap: 18px 14px; }
.member-page label { color: #52634e; font-size: 12px; margin-bottom: 8px; }
.member-page input:not([type=checkbox]):not([type=hidden]), .member-page select { height: 46px; }
.member-page .amount-input span { top: 13px; }
.member-page #invoiceRemark { min-height: 80px; }
.member-page .fee-preview { background: #f1f4e9; border-color: #dfe6d4; border-radius: 8px; padding: 16px; gap: 12px; }
.member-page .fee-cell span { color: #63745b; font-size: 11px; margin-bottom: 8px; }
.member-page .fee-cell strong { font-size: 15px; line-height: 1.5; }
.member-page .fee-cell:last-child { border-left: 1px solid #d3dcc7; padding-left: 16px; }
.member-page .fee-cell:last-child strong { color: #245b45; font-size: 19px; }
.member-page .form-footer { margin-top: 18px; padding-top: 18px; }
.member-page .primary { min-height: 46px; padding: 12px 22px; }
.member-page .primary span { margin-left: 14px; }
.member-page .side, .member-page .side.wallet-side { gap: 14px; height: auto; min-height: 0; grid-template-rows: none; align-content: start; }
.member-page .recent { padding: 22px; }
.member-page .mini-title { font-size: 14px; font-weight: 650; }
.member-page .recent-list, .member-page .wallet-side .recent-list { height: auto; min-height: 150px; max-height: 290px; }
.member-page .recent-item { border-color: #e9ecdf; padding: 14px 0; }
.member-page .recent-name { font-size: 13px; }
.member-page .recent-date { color: #63735b; }
.member-page .status.success { background: #eaf1e1; color: #3f6738; }
.member-page .status.waiting { background: #f8efdd; color: #866126; }
.member-page .download-link { color: #245b45; background: #edf2e7; border-radius: 5px; }
.member-page .telegram-card { padding: 19px 22px; }
.member-page .telegram-card > p { display: block; color: #6a7764; font-size: 11px; }
.member-page .telegram-actions .settings-hint { font-size: 10px; }
.member-page .announcement { border-color: #dbe3cb; background: #edf1e1; border-radius: 10px; padding: 16px 18px; }
.member-page .wallet-panel { background: #e9efdf; border-color: #d9e1cc; border-radius: 10px; box-shadow: none; }
.member-page .wallet-heading { padding: 17px 20px; }
.member-page .wallet-heading > strong { color: #245b45; font-weight: 600; }
.member-page .wallet-heading > span { font-size: 13px; }
.member-page .wallet-body { padding: 0 20px 16px; }
.member-page .wallet-note { color: #586b51; }
.member-page .wallet-panel button { background: #fffef9; color: #35583d; border-color: #d9e1cc; }

/* Login: editorial typography paired with a quiet, dimensional paper illustration. */
.auth-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr); gap: 6vw; min-height: 100svh; padding: 48px 8vw; background: #f5f5ee; align-items: center; }
.auth-story { align-self: stretch; display: flex; flex-direction: column; justify-content: center; position: relative; min-width: 0; }
.auth-story .studio-eyebrow { margin-bottom: 26px; }
.auth-story h2 { font-size: clamp(38px, 4.4vw, 68px); font-weight: 500; line-height: 1.28; letter-spacing: -.065em; margin: 0; color: #263f32; }
.auth-story h2 em { color: #66834f; font-style: normal; }
.auth-story > p { font-size: 13px; color: #68745e; line-height: 1.9; margin: 22px 0 0; max-width: 390px; }
.paper-scene { position: relative; height: 310px; margin-top: 20px; display: grid; place-items: center; isolation: isolate; }
.paper-orbit { position: absolute; width: 290px; height: 290px; border-radius: 50%; background: #e6ecd9; z-index: -2; }
.paper-orbit::before { content: ""; position: absolute; inset: -23px; border: 1px solid #dbe2d0; border-radius: 50%; }
.paper-orbit::after { content: ""; position: absolute; inset: 55px -48px; border: 1px solid #d4ddc5; border-radius: 50%; transform: rotate(-32deg); }
.invoice-paper { width: 232px; padding: 24px 22px 20px; background: #fffef9; border: 1px solid #e0e3d4; border-radius: 3px; transform: rotate(-8deg); box-shadow: 10px 18px 30px #40523212, 0 1px 2px #4052320d; position: relative; }
.invoice-paper::before { content: ""; position: absolute; inset: 0; background: #f0f1e7; border: 1px solid #dce2cf; transform: rotate(14deg); z-index: -1; border-radius: 3px; }
.paper-brand { display: flex; align-items: center; justify-content: space-between; color: #465e41; font-size: 9px; letter-spacing: .1em; }
.paper-brand span { font-size: 17px; }
.paper-title { font-size: 24px; color: #2b4737; letter-spacing: .2em; margin: 20px 0 5px; }
.paper-subtitle { font-size: 8px; letter-spacing: .13em; color: #6e7b63; padding-bottom: 15px; border-bottom: 1px dashed #ced8c0; }
.paper-lines { display: grid; gap: 9px; padding: 18px 0; }
.paper-lines i { display: block; height: 4px; background: #e5e9dc; width: 100%; }
.paper-lines i:nth-child(2) { width: 65%; }.paper-lines i:nth-child(3) { width: 82%; }
.paper-bottom { display: flex; justify-content: space-between; color: #6c795f; font-size: 8px; border-top: 1px dashed #ced8c0; padding-top: 14px; }
.paper-seal { position: absolute; right: -35px; bottom: 22px; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: #365c42; border: 5px solid #f5f5ee; color: #e4edd5; font: 28px Georgia, serif; transform: rotate(8deg); box-shadow: 0 5px 12px #243b2b12; }
.story-footer { display: flex; justify-content: space-between; padding-top: 20px; margin-top: 12px; border-top: 1px solid #dce1d2; font-size: 10px; color: #5d6e53; letter-spacing: .06em; }
.auth-page .shell { width: 100%; max-width: 440px; padding: 40px; margin: auto; border: 1px solid #dfe3d7; border-radius: 14px; background: #fffef9; box-shadow: 0 16px 50px #3d513206; }
.auth-page .brand { font-size: 17px; color: #284633; }
.auth-page h1 { color: #263f32; font-size: 30px; font-weight: 600; margin: 34px 0 10px; letter-spacing: -.04em; }
.auth-page .intro { color: #68745f; font-size: 12px; }
.auth-page .auth-switch { margin: 28px 0; background: #eff2e7; border-radius: 8px; }
.auth-page .auth-switch button { border-radius: 5px; color: #5c6c51; font-size: 12px; min-height: 40px; }
.auth-page .auth-switch button[aria-pressed=true] { color: #294f37; background: #fffef9; box-shadow: 0 1px 4px #253c3010; }
.auth-page input { height: 48px; }
.auth-page label { color: #53624b; font-size: 12px; }
.auth-page .field { margin-bottom: 22px; }
.auth-page .primary { min-height: 48px; font-size: 13px; }
.auth-page .secondary { background: #edf2e4; border: 1px solid #d9e2cb; color: #3a613e; }
.auth-page .hint { color: #637358; font-size: 10px; margin-top: 25px; }
.auth-page .notice { color: #4f684a; background: #f0f4e8; }
.password-page { display: flex; background: #f5f5ee; }
.password-page .shell { max-width: 480px; }
.password-page .eyebrow { color: #5f7b4e; margin-top: 28px; }
.password-page h1 { margin-top: 10px; }

/* Administration: the same identity, with denser working surfaces. */
.admin-page .app { background: var(--canvas); }
.admin-page .topbar { background: #fffef9; border-color: var(--line); }
.admin-page .admin-sidebar { background: #edf0e5; border-color: #dce2d1; }
.admin-page .nav-group-title { color: #586c49; letter-spacing: .08em; font-size: 10px; }
.admin-page .admin-nav a { color: #516249; border-radius: 6px; transition: background-color .18s; }
.admin-page .admin-nav a:hover { background: #e3e9d8; }
.admin-page .admin-nav a[aria-current=page] { color: #fffef9; background: #345a3f; border-left-color: #b6c995; font-weight: 600; box-shadow: none; }
.admin-page .admin-nav a[aria-current=page]::before { background: #c4d6aa; }
.admin-page .sidebar-upload { color: #345a3f; background: #fffef9; border: 1px solid #d8e0cc; }
.admin-page .page-heading { padding: 10px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.admin-page .page-heading h1 { font-size: 27px; letter-spacing: -.04em; font-weight: 600; }
.admin-page .page-heading p { color: #5c6c50; }
.admin-page .panel, .admin-page .stat { background: #fffef9; border-color: #dfe4d6; border-radius: 10px; box-shadow: none; }
.admin-page .panel-head { padding: 19px 22px; background: #fafbf4; border-bottom-color: #e4e8db; border-radius: 10px 10px 0 0; }
.admin-page .panel-head h2 { color: #36533a; font-size: 15px; }
.admin-page .page-body, .admin-page .card-body { padding: 22px; }
.admin-page .table th { color: #5b6e4c; background: #f4f6ec; font-size: 11px; }
.admin-page .table td { border-color: #e9ecdf; }
.admin-page .table tbody tr:hover { background: #f8faf2; }
.admin-page .stat strong { color: #355a3d; font-weight: 600; }
.admin-page .table .actions button { color: #355a3d; background: #edf2e4; }
.admin-page .search, .admin-page .select { background: #fffef9; border-color: #d9e0cf; }
.guide-page main, .upload-page main { background: #fffef9; border-color: #dde3d3; border-radius: 12px; }
.guide-page a, .upload-page a { color: #245b45; }
.guide-page h1, .upload-page h1 { letter-spacing: -.04em; font-weight: 600; }
.guide-page pre { background: #243e32; }
.guide-page th { background: #edf2e4; }
.upload-page button[type=submit] { background: #245b45; border-radius: 8px; }
.upload-page .card { background: #fffef9; border-color: #dde3d3; border-radius: 10px; }

@media (min-width: 1500px) { .auth-page { padding-left: max(8vw, calc((100vw - 1400px) / 2)); padding-right: max(8vw, calc((100vw - 1400px) / 2)); } }
@media (max-width: 1100px) {
  .member-page .shell { padding: 0 24px 36px; }
  .member-page .main-card { padding: 22px; }
  .workspace-flow { display: none; }
  .auth-page { padding: 40px 5vw; gap: 5vw; grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
  .auth-page .shell { padding: 32px; }
}
@media (max-width: 980px) {
  .member-page .grid { grid-template-columns: minmax(0, 1fr); }
  .member-page .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-page .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-page .recent, .member-page .announcement, .member-page .settings-card { grid-column: 1 / -1; }
  .member-page .recent-list { max-height: 300px; }
}
@media (max-width: 760px) {
  .auth-page { display: flex; flex-direction: column; gap: 28px; padding: 32px 20px; }
  .auth-story { width: 100%; max-width: 440px; margin: auto; }
  .auth-story .studio-eyebrow { margin-bottom: 15px; }
  .auth-story h2 { font-size: 36px; line-height: 1.25; }
  .auth-story > p { margin-top: 12px; font-size: 12px; }
  .paper-scene, .story-footer { display: none; }
  .auth-page .shell { padding: 28px; margin: 0 auto; }
  .auth-page h1 { margin-top: 28px; }
  .admin-page .page-heading { padding-top: 4px; margin-bottom: 16px; }
  .admin-page .page-heading h1 { font-size: 23px; }
  .admin-page .page-body, .admin-page .card-body { padding: 14px; }
  .admin-page .panel-head { padding: 15px 14px; }
}
@media (max-width: 520px) {
  .member-page .shell { padding: 0 14px calc(104px + env(safe-area-inset-bottom)); }
  .member-page .topbar { min-height: 66px; gap: 10px; }
  .member-page .brand { font-size: 15px; gap: 8px; }
  .member-page .brand-mark { width: 30px; height: 30px; }
  .member-page .account { border: 0; background: transparent; padding: 0; }
  .member-page .account span, .member-page .account svg { display: none; }
  .member-page .admin-link { font-size: 11px; }
  .workspace-intro { padding: 24px 0 20px; }
  .workspace-intro h1 { font-size: 27px; margin-top: 8px; }
  .workspace-intro p { font-size: 11px; }
  .studio-eyebrow { font-size: 9px; letter-spacing: .12em; }
  .member-page .grid { gap: 16px; }
  .member-page .main-card { padding: 20px 16px; }
  .member-page .card-header { margin-bottom: 18px; }
  .member-page .card-title { font-size: 19px; }
  .member-page .types { margin-bottom: 16px; }
  .member-page .type { padding: 9px 12px; }
  .member-page .ai-fill { margin-bottom: 18px; }
  .member-page .ai-fill summary { padding: 11px; }
  .member-page .ai-fill summary span { font-size: 10px; }
  .member-page .form-grid { gap: 16px 10px; }
  .member-page input:not([type=checkbox]):not([type=hidden]), .member-page select { font-size: 16px; height: 46px; }
  .member-page label { font-size: 11px; }
  .member-page .fee-preview { padding: 13px 10px; gap: 8px; }
  .member-page .fee-cell span { font-size: 9px; }
  .member-page .fee-cell strong { font-size: 12px; overflow-wrap: anywhere; }
  .member-page .fee-cell:last-child { padding-left: 9px; }
  .member-page .fee-cell:last-child strong { font-size: 15px; }
  .member-page .form-footer { margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fffef9; box-shadow: 0 -3px 20px #20383108; }
  .member-page .form-footer label { margin: 0; }
  .member-page .form-footer .primary { padding: 10px 14px; max-width: 165px; }
  .member-page .side { grid-template-columns: minmax(0, 1fr); }
  .member-page .recent, .member-page .telegram-card { padding: 20px; }
  .auth-page .code-row { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
  .auth-page .auth-switch { margin: 24px 0; }
}
@media (max-width: 360px) {
  .auth-page { padding: 24px 14px; }
  .auth-page .shell { padding: 24px 20px; }
  .auth-story h2 { font-size: 31px; }
  .member-page .brand { font-size: 14px; }
  .member-page .shell { padding-left: 10px; padding-right: 10px; }
  .member-page .main-card { padding-left: 12px; padding-right: 12px; }
  .member-page .form-footer .primary span { margin-left: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .workspace-intro, .auth-story, .auth-page .shell { animation: studio-enter .55s both; }
  .auth-page .shell { animation-delay: .08s; }
  @keyframes studio-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}


/* Shared workspace components */
:root { --ui-muted: #53674b; --ui-border: #dde4d4; --ui-surface: #fffef9; --ui-soft: #eff3e7; }
:is(button, a, input, select, textarea, summary) { scroll-margin-top: 82px; }
:where(button, a)[aria-busy=true] { cursor: progress; }
.admin-page .page-heading { min-height: 0; padding: 0 0 13px; margin-bottom: 18px; gap: 16px; }
.admin-page .page-heading h1 { font-size: 21px; line-height: 1.4; letter-spacing: -.035em; }
.admin-page .page-heading p { margin-top: 4px; color: var(--ui-muted); font-size: 11px; line-height: 1.65; }
.admin-page .admin-content { padding: 22px 26px 40px; }
.admin-page .topbar { height: 56px; padding: 0 22px; }
.admin-page .admin-frame { grid-template-columns: 202px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.admin-page .admin-sidebar { top: 56px; height: calc(100dvh - 56px); padding: 20px 12px 12px; background: #edf0e5; gap: 20px; }
.admin-page .nav-group + .nav-group { margin-top: 23px; }
.admin-page .nav-group-title { margin: 0 11px 8px; color: #607052; font-size: 10px; letter-spacing: .07em; }
.admin-page .admin-nav a { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 9px 11px; margin: 3px 0; border: 1px solid transparent; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.admin-page .admin-nav a[aria-current=page] { border-color: #345a3f; background: #345a3f; color: #fffef9; box-shadow: 0 2px 5px #243c2410; }
.admin-page .admin-nav a[aria-current=page]::before { display: none; }
.nav-icon { flex-shrink: 0; width: 18px; height: 18px; opacity: .88; }
.admin-page .sidebar-upload { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px; border-radius: 7px; font-size: 11px; }
.admin-nav-toggle { display: none; align-items: center; gap: 7px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--ui-border); border-radius: 7px; color: #36583d; background: #f1f4e9; font-size: 12px; }
.admin-nav-toggle svg { width: 17px; height: 17px; }
.admin-nav-dialog { inset: 0 auto 0 0; width: min(320px, calc(100vw - 36px)); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-right: 1px solid #cdd9c2; border-radius: 0 14px 14px 0; color: var(--ink); background: #edf0e5; }
.admin-nav-dialog[open] { display: flex; flex-direction: column; }
.admin-nav-dialog::backdrop { background: #183a2d70; backdrop-filter: blur(3px); }
.admin-drawer-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid #dbe2d0; background: #f7f8ef; }
.admin-drawer-heading span { color: var(--ui-muted); font-size: 10px; }
.admin-drawer-heading h2 { margin: 4px 0 0; color: #2c4d37; font-size: 18px; font-weight: 600; }
.admin-drawer-heading button { width: 40px; height: 40px; border: 1px solid #dce3d2; border-radius: 8px; color: #47623f; background: #fffef9; font-size: 16px; }
.admin-nav-dialog .admin-sidebar { position: static; display: flex; flex: 1; width: 100%; height: auto; min-height: 0; overflow: auto; padding: 18px 16px; border: 0; }
.admin-nav-dialog .admin-nav a { min-height: 44px; }
.admin-nav-dialog .sidebar-upload { flex-shrink: 0; margin-top: 18px; }
.admin-page .mobile-switch { display: none !important; }
.admin-page .settings-tabs { margin-bottom: 20px; }
.admin-page .settings-section-heading { margin-bottom: 19px; }
.admin-page .settings-section-heading .settings-eyebrow { display: none; }
.admin-page .settings-section-heading h2 { font-size: 19px; }
.admin-page .settings-section-heading > div > p:last-child { margin-top: 6px; font-size: 11px; }
.admin-page .settings-default-card { padding: 17px 20px; margin-bottom: 22px; }
.admin-page .panel-head { min-height: 62px; padding: 17px 20px; background: #fafbf4; }
.admin-page .panel-head h2 { font-size: 15px; font-weight: 600; line-height: 1.5; }
.admin-page .panel-head p { max-width: 760px; margin-top: 4px; color: var(--ui-muted); font-size: 11px; line-height: 1.75; }
.admin-page .page-body, .admin-page .card-body { padding: 20px; }
.admin-page .form-grid { gap: 19px 16px; }
.admin-page [data-admin-page]:not(#page-system) .field label { margin-bottom: 7px; font-size: 12px; line-height: 1.6; color: #52644a; }
.admin-page [data-admin-page]:not(#page-system) .field input, .admin-page [data-admin-page]:not(#page-system) .field select, .admin-page [data-admin-page]:not(#page-system) .field textarea { min-height: 42px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.admin-page [data-admin-page]:not(#page-system) .field textarea { min-height: 112px; }
.admin-page .hint, .admin-page .page-copy { color: var(--ui-muted); line-height: 1.8; }
.admin-page .page-copy { font-size: 12px; }
.admin-page .primary, .admin-page .secondary, .admin-page .ghost { min-height: 36px; padding: 9px 13px; border-radius: 7px; }
.admin-page .primary { color: #fffef9; }
.admin-page .page-toolbar, .admin-page .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.admin-page .search, .admin-page .select { min-height: 39px; padding: 9px 11px; font-size: 12px; }
.admin-page .toolbar .search { flex: 1; min-width: 160px; max-width: 420px; }
.admin-page .stat { padding: 16px 18px; border-radius: 10px; background: #fffef9; }
.admin-page .stat > span { color: var(--ui-muted); font-size: 11px; }
.admin-page .stat strong { margin-top: 8px; font-size: 22px; line-height: 1.3; font-weight: 600; }
.admin-page .stats { gap: 13px; margin-bottom: 18px; }
.admin-page .table th { padding: 13px 15px; font-size: 11px; line-height: 1.6; }
.admin-page .table td { padding: 15px; font-size: 12px; line-height: 1.7; }
.admin-page .table .actions button { min-height: 32px; padding: 7px 9px; border-radius: 6px; }
.admin-page .table-wrap { border-radius: 0 0 10px 10px; }
.admin-page .empty { padding: 36px 20px; background: #fbfcf5; color: var(--ui-muted); font-size: 12px; }
.admin-page .help-note { margin: 14px 0 19px; padding: 0; border: 1px solid #dfe6d5; border-radius: 8px; background: #f5f7ee; }
.admin-page .help-note > summary { padding: 12px 14px; color: #4c6840; font-size: 11px; cursor: pointer; }
.admin-page .help-note > :not(summary) { margin: 0 14px 13px; }
.admin-page .form-actions { align-items: center; gap: 12px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #e4e9dc; }
.admin-page .editor-scope { padding: 15px; border: 1px solid #dfe6d4; border-radius: 9px; background: #f3f6eb; }
.admin-page .range-list { display: grid; gap: 13px; }
.admin-page .range-row { align-items: end; gap: 12px; padding: 17px; border: 1px solid #dfe5d5; border-radius: 9px; background: #fbfcf5; }
.admin-page .range-row label { display: block; margin-bottom: 8px; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.admin-page .range-row input { min-height: 40px; padding: 9px 10px; border-color: #d8e1cb; border-radius: 6px; background: #fffefb; font-size: 13px; }
.admin-page .remove-range { min-height: 40px; color: #8d4c42; background: #f7efea; border-radius: 6px; }
.admin-page #costRules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-page .cost-rule { padding: 20px; border: 1px solid #dce4d2; border-radius: 10px; background: #fafcf4; }
.admin-page .cost-rule h3 { margin: 0 0 17px; font-size: 14px; color: #3c5c3e; }
.admin-page .cost-rule label { display: block; margin: 12px 0 7px; color: var(--ui-muted); font-size: 11px; }
.admin-page .ai-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px 20px; padding: 23px; border: 1px dashed #bbcdae; border-radius: 10px; background: #f3f7ea; }
.admin-page .ai-upload label { grid-column: 1 / -1; margin: 0; color: #44653d; font-size: 12px; font-weight: 600; }
.admin-page .ai-upload input { width: 100%; min-width: 0; font-size: 12px; }
.admin-page .ai-upload .primary { min-height: 42px; }
.admin-page input[type=file]::file-selector-button { min-height: 39px; padding: 8px 12px; margin-right: 10px; border: 1px solid #cfdcbe; border-radius: 6px; background: #fffef9; color: #3f643a; font: inherit; }
.admin-page .ai-result { padding: 20px; margin-top: 18px; border: 1px solid #dce4d0; border-radius: 10px; background: #fbfcf6; }
.admin-page .ai-fields { gap: 14px; }
.admin-page .ai-fields > div { padding: 13px; border-radius: 7px; background: #f1f5e8; }
.admin-page .notification-switch { margin-bottom: 18px; }
.admin-page #paymentAuditForm { margin-bottom: 24px; }
.admin-page #page-callbacks h3 { margin-top: 27px; padding-top: 22px; border-top: 1px solid #e1e7d8; color: #3a593c; font-size: 14px; }
.admin-page #page-connections > .panel { margin-bottom: 18px !important; border-radius: 10px; padding: 22px !important; }
.admin-page .referral-overview { gap: 12px; }
.admin-page .referral-overview > div { border-radius: 9px; padding: 17px; border-color: #dfe6d4; background: #f5f8ed; }
.admin-page .referral-search { align-items: end; gap: 12px; padding: 15px; border-radius: 9px; background: #f4f7ed; }
.admin-page .referral-search label { font-size: 11px; color: var(--ui-muted); }
.admin-page .referral-table-wrap { border: 1px solid #e3e8d9; border-radius: 8px; }
.admin-page .referral-pages { margin-top: 16px; }

/* Member workspace and shared dialogs */
.member-page .topbar { min-height: 64px; }
.member-page .account { cursor: default; }
.member-page .workspace-intro { align-items: center; padding: 22px 0 20px; gap: 20px; }
.member-page .workspace-intro h1 { margin: 0; font-size: 23px; line-height: 1.4; letter-spacing: -.035em; }
.member-page .workspace-intro p { margin-top: 5px; color: var(--ui-muted); font-size: 12px; }
.member-nav { display: flex; align-items: center; flex-shrink: 0; gap: 4px; padding: 5px; border: 1px solid #dfe5d5; border-radius: 9px; background: #edf1e5; }
.member-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; color: #506648; text-decoration: none; font-size: 12px; }
.member-nav a:hover { background: #f6f8ef; }
.member-nav a[aria-current] { border-color: #dce5cf; background: #fffef9; color: #305638; box-shadow: 0 1px 4px #2a412011; }
.member-nav a > span { font-size: 14px; }
.member-page .main-card { padding: 24px; }
.member-page .card-title { font-size: 19px; }
.member-page .card-header { margin-bottom: 18px; }
.member-page .form-grid { gap: 19px 15px; }
.member-page .type { min-height: 41px; padding: 11px 15px; font-size: 12px; }
.member-page .settings-hint { color: var(--ui-muted); font-size: 11px; }
.member-page .recent, .member-page .telegram-card { padding: 21px; }
.member-page .recent-caption { font-size: 11px; color: var(--ui-muted); }
.member-page .export-footer { border-top: 1px solid #e6ebdd; padding-top: 14px; }
.member-page .wallet-heading { min-height: 64px; }
.member-page .wallet-heading > span { font-size: 13px; }
.member-page .wallet-body { border-top: 1px solid #e3e9d9; }
.member-page .wallet-actions { gap: 9px; }
.member-page .wallet-actions button, .member-page .wallet-key-row button { min-height: 38px; border-radius: 6px; color: #43623c; border-color: #d7e1cc; background: #f1f5e8; }
.member-page .announcement { border: 1px solid #dce6cc; border-radius: 10px; background: #f1f6e6; }
.wallet-dialog, .wechat-bind-dialog, .admin-page .modal-inner { border: 1px solid #d8e2cb; border-radius: 13px; background: #fffef9; box-shadow: 0 22px 80px #18352725; }
.wallet-dialog h2, .wechat-bind-dialog h3 { font-size: 20px; line-height: 1.5; letter-spacing: -.025em; }
.wallet-dialog label { color: #4b6243; font-size: 12px; }
.wallet-dialog input, .wallet-dialog textarea, .wallet-dialog select { border-color: #dbe4cf; border-radius: 7px; padding: 10px 12px; font-size: 14px; }
.wallet-dialog button { min-height: 39px; border-radius: 7px; }
.wallet-dialog button[type=submit] { background: #245b45; color: #fffef9; }
.wallet-table th { color: #526748; background: #f1f5e8; }
.wallet-table td { border-color: #e6ebde; }

/* Account and document pages */
.auth-page { padding-top: 38px; padding-bottom: 38px; }
.auth-story h2 { font-size: clamp(34px, 3.6vw, 51px); line-height: 1.3; }
.auth-story .studio-eyebrow { margin-bottom: 19px; }
.auth-story > p { color: var(--ui-muted); margin-top: 17px; }
.auth-page .paper-scene { height: 280px; }
.auth-page .shell { padding: 34px; border-radius: 13px; }
.auth-page h1 { margin: 23px 0 8px; font-size: 25px; line-height: 1.4; }
.auth-page .intro { color: var(--ui-muted); line-height: 1.8; }
.auth-page .auth-switch { margin: 22px 0; }
.auth-page .field { margin-bottom: 18px; }
.auth-page .hint { margin-top: 19px; color: var(--ui-muted); font-size: 11px; line-height: 1.8; }
.auth-page input { border-color: #d8e1cd; font-size: 14px; }
.password-page .shell > p { color: var(--ui-muted); font-size: 12px; line-height: 1.9; }
.password-page .eyebrow { margin-top: 24px; font-size: 11px; }
.guide-page main { max-width: 1080px; margin: 24px auto; padding: 28px 38px 42px; }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 21px; border-bottom: 1px solid #e2e8d9; font-size: 12px; }
.document-toolbar a { text-decoration: none; }
.document-badge { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 27px; padding: 5px 9px; border: 1px solid #d9e3cd; border-radius: 5px; color: #4b6741; background: #f0f5e6; font-size: 10px; }
.guide-page .guide-toc { margin-bottom: 24px; border: 1px solid #dce4d1; border-radius: 9px; background: #f5f8ee; }
.guide-toc > summary { padding: 13px 16px; color: #365b3d; cursor: pointer; font-size: 13px; font-weight: 600; }
.guide-toc > summary > span { float: right; color: var(--ui-muted); font-size: 10px; font-weight: 400; }
.guide-page .guide-toc nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; padding: 0 17px 16px; border: 0; font-size: 12px; }
.guide-toc nav a { padding: 5px 0; color: #506b42; line-height: 1.7; }
.guide-page .guide-content h1 { margin: 0 0 12px; color: #2d4c37; font-size: 23px; line-height: 1.5; }
.guide-page .guide-content h2 { margin-top: 30px; padding-top: 21px; border-top: 1px solid #e2e8d9; color: #34583b; font-size: 18px; line-height: 1.5; }
.guide-page p, .guide-page li, .guide-page td { color: #43573d; font-size: 13px; line-height: 1.9; }
.guide-page pre { padding: 20px; border-radius: 9px; color: #f0f6e9; font-size: 12px; line-height: 1.8; }
.guide-page pre code { color: inherit; background: none; }
.guide-page table { border-radius: 8px; }
.guide-page th { font-size: 12px; }
.guide-page code { overflow-wrap: anywhere; }
.upload-page main { max-width: 860px; padding: 24px 30px 38px; margin: 24px auto; }
.upload-page main > header { padding-bottom: 18px; border-bottom: 1px solid #dfe6d5; }
.upload-page main > header a { text-decoration: none; font-size: 12px; }
.upload-page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 23px; }
.upload-page .upload-page-heading h1 { margin: 0; font-size: 23px; line-height: 1.5; }
.upload-page main > p { margin: 10px 0 21px; color: var(--ui-muted); font-size: 12px; line-height: 1.85; }
.upload-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px; margin: 0 0 21px; gap: 10px; list-style: none; border: 1px solid #dce5d0; border-radius: 9px; background: #eff5e6; }
.upload-flow li { display: flex; align-items: center; justify-content: center; gap: 9px; color: #4d6b42; font-size: 11px; }
.upload-flow li > span { color: #5c7650; font-size: 10px; font-variant-numeric: tabular-nums; }
.upload-page .card { margin-top: 18px; padding: 23px; }
.upload-page h2 { color: #3b5b3c; font-size: 16px; }
.upload-page .hint { color: var(--ui-muted); font-size: 11px; line-height: 1.9; }
.upload-page #pdfFiles { width: 100%; margin-top: 12px; padding: 20px 14px; border: 1px dashed #c3d3b2; border-radius: 8px; background: #f6f9f0; font-size: 12px; }
.upload-page input::file-selector-button { color: #3e613a; border-color: #cbdabb; background: #fffef9; }
.upload-page button { min-height: 40px; font-size: 12px; border-radius: 7px; }
.upload-page .secondary { color: #3b623a; background: #edf3e4; }
.upload-page .job { padding-top: 19px; margin-top: 19px; border-color: #e2e8d9; }
.upload-page .job p { font-size: 12px; color: var(--ui-muted); }

@media (max-width: 1100px) {
  .admin-page #costRules { grid-template-columns: minmax(0, 1fr); }
  .admin-page .range-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page .range-row .remove-range { justify-self: start; padding: 8px 15px; }
}
@media (max-width: 760px) {
  .admin-page .topbar { height: 56px; padding: 0 12px; }
  .admin-page .top-actions { gap: 7px; }
  .admin-page .top-actions .admin-pill { display: none; }
  .admin-page .admin-nav-toggle { display: inline-flex; }
  .admin-page .admin-content { padding: 18px 13px 30px; }
  .admin-page .admin-frame { display: block; min-height: calc(100vh - 56px); }
  .admin-page .page-heading { padding-bottom: 13px; margin-bottom: 16px; }
  .admin-page .page-heading h1 { font-size: 20px; }
  .admin-page .page-heading p { margin-top: 4px; font-size: 11px; }
  .admin-page .panel-head { padding: 16px; align-items: flex-start; }
  .admin-page .panel-head h2 { font-size: 14px; }
  .admin-page .page-body, .admin-page .card-body { padding: 16px; }
  .admin-page .panel-head > button { flex-shrink: 0; }
  .admin-page .primary, .admin-page .secondary, .admin-page .ghost { min-height: 40px; }
  .admin-page .page-toolbar { gap: 10px; }
  .admin-page .page-toolbar .select { min-width: 0; max-width: 100%; }
  .admin-page .page-toolbar label { font-size: 11px; }
  .admin-page [data-admin-page]:not(#page-system) .field input, .admin-page [data-admin-page]:not(#page-system) .field select, .admin-page [data-admin-page]:not(#page-system) .field textarea, .admin-page .range-row input { min-height: 44px; font-size: 16px; }
  .admin-page .stats { gap: 10px; }
  .admin-page .stat { padding: 14px; }
  .admin-page .stat strong { font-size: 21px; }
  .admin-page .table .actions button { min-height: 36px; }
  .admin-page .invoice-table td { padding: 0; }
  .admin-page .invoice-table tr { padding: 15px 0; gap: 9px 12px; }
  .admin-page .range-row { padding: 15px; gap: 15px 10px; }
  .admin-page .range-row input { width: 100%; }
  .admin-page .ai-upload { grid-template-columns: minmax(0, 1fr); gap: 15px; padding: 18px; }
  .admin-page #page-connections > .panel { padding: 17px !important; }
  .admin-page .referral-search { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page .referral-search label, .admin-page .referral-search input { grid-column: 1 / -1; }
  .member-page .workspace-intro { flex-direction: column; align-items: stretch; gap: 16px; padding: 19px 0 18px; }
  .member-page .workspace-intro h1 { font-size: 21px; }
  .member-page .workspace-intro p { font-size: 11px; }
  .member-nav { gap: 3px; padding: 4px; }
  .member-nav a { flex: 1; min-height: 41px; padding: 8px 10px; font-size: 12px; }
  .member-page .main-card { padding: 21px 17px; }
  .member-page .card-title { font-size: 18px; }
  .member-page .topbar { min-height: 62px; }
  .auth-page { padding: 28px 18px; gap: 0; }
  .auth-page .auth-story { display: none; }
  .auth-page .shell { max-width: 460px; padding: 29px 25px; }
  .auth-page h1 { font-size: 24px; margin-top: 24px; }
  .auth-page input { font-size: 16px; }
  .auth-page .auth-switch { margin: 21px 0; }
  .password-page .shell { padding: 27px 24px; }
  .wallet-dialog input, .wallet-dialog textarea, .wallet-dialog select { font-size: 16px; }
  .guide-page main, .upload-page main { margin: 14px 10px; padding: 21px 17px 30px; border-radius: 10px; }
  .guide-page .guide-content h1, .upload-page .upload-page-heading h1 { font-size: 21px; }
  .guide-page .guide-content h2 { font-size: 17px; }
  .guide-page .guide-toc nav { grid-template-columns: minmax(0, 1fr); }
  .guide-page p, .guide-page li, .guide-page td { font-size: 12px; }
  .guide-page pre { margin-left: -5px; margin-right: -5px; padding: 15px; font-size: 11px; }
  .document-toolbar { padding-bottom: 15px; margin-bottom: 18px; }
  .upload-page .card { padding: 19px 16px; }
  .upload-flow { gap: 6px; padding: 14px 9px; }
  .upload-flow li { gap: 5px; font-size: 10px; }
  .upload-flow li > span { font-size: 9px; }
  .upload-page #uploadButton { min-height: 44px; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .admin-nav-dialog[open] { animation: drawer-arrive .18s ease-out; }
  @keyframes drawer-arrive { from { opacity: .5; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
}

.admin-page .cost-rule > .form-grid { grid-template-columns: minmax(0, 1fr); }

/* Readable inactive states and keyboard-accessible data surfaces. */
.admin-page .table tr.inactive { opacity: 1; background: #f3f5ed; }
.admin-page .inactive td:first-child strong { color: #5b6c51; }
.admin-page .danger { color: #9b4338; background: #faece6; border: 1px solid #eed7ce; }
.admin-page .danger:hover:not(:disabled) { background: #f4dfd5; }
.admin-page .table-wrap:focus-visible, .admin-page .referral-table-wrap:focus-visible { outline: 2px solid #6b8759; outline-offset: 3px; }
.auth-page .error, .wallet-error { color: #a33f36; }
@media (max-width: 760px) {
  .member-page .workspace-intro { padding: 15px 0; gap: 11px; }
  .member-page .workspace-intro p { display: none; }
}

.admin-page .settings-savebar .primary { min-width: 136px; min-height: 44px; padding: 12px 17px; }
.admin-page .modal .field label { font-size: 12px; color: #52644a; }
.admin-page .modal .field input, .admin-page .modal .field select, .admin-page .modal .field textarea { min-height: 42px; padding: 10px 12px; font-size: 13px; }
@media (max-width: 760px) {
  .admin-page .settings-savebar .primary { min-width: 114px; min-height: 44px; padding: 10px 12px; }
  .admin-page .modal .field input, .admin-page .modal .field select, .admin-page .modal .field textarea { font-size: 16px; }
}

.admin-page .stat .stat-detail { margin: 7px 0 0; font-size: 12px; font-weight: 400; line-height: 1.7; color: var(--ui-muted); }

.admin-page .page-toolbar:has(.toolbar-field) { align-items: flex-end; }
.admin-page .toolbar-field { display: grid; gap: 6px; flex: 1 1 160px; min-width: 0; max-width: 230px; }
.admin-page .toolbar-field label { line-height: 1.6; }
.admin-page .page-toolbar .toolbar-field .select { width: 100%; min-width: 0; max-width: 100%; }
.admin-page .export-toolbar .toolbar-field { flex-basis: 145px; max-width: none; }
.admin-page .toolbar-actions { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-page .toolbar-actions > label { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 760px) {
  .admin-page .toolbar-field { max-width: none; }
  .admin-page .page-toolbar .toolbar-field .select { min-height: 44px; font-size: 16px; }
}
@media (max-width: 380px) {
  .admin-page .stats { grid-template-columns: minmax(0, 1fr); }
  .admin-page .export-toolbar .toolbar-field { flex-basis: 100%; }
}

.admin-page .referral-search input { min-height: 42px; padding: 10px 12px; border: 1px solid #d9dfd5; font-size: 13px; width: min(420px, 100%); }
@media (max-width: 760px) {
  .admin-page .referral-search input { min-height: 44px; font-size: 16px; }
}

.company-rules-surface { margin: 20px 0 26px; }
.company-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.company-rule-copy { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf3; }
.company-rule-copy h4 { margin: 0 0 7px; font-size: 13px; color: var(--ink); }
.company-rule-copy p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--ui-muted); }
.company-amount-rules { margin-top: 22px; }
@media (max-width: 760px) {
  .company-rule-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .company-rules-surface { margin-top: 16px; }
}

.identity-validation { margin: 6px 0 0; color: #a43b31; font-size: 12px; line-height: 1.7; }
.identity-validation:empty { display: none; }
.member-page .field input[aria-invalid="true"] { border-color: #a43b31; background-color: #fffaf7; }


/* Compact invoice workspace keeps routine entry and its action together. */
.member-page .topbar { min-height: 54px; }
.member-page .workspace-intro { padding: 8px 0 10px; gap: 12px; }
.member-page .workspace-intro h1 { font-size: 18px; }
.member-page .workspace-intro p { display: none; }
.member-page .member-nav { padding: 3px; }
.member-page .member-nav a { min-height: 34px; padding: 6px 12px; }
.member-page .grid > .main-card { align-self: start; padding: 16px; }
.member-page .compact-invoice-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.member-page .compact-invoice-header .card-title { margin: 0; font-size: 18px; }
.member-page #aiPanel { margin: 0; background: #f4f6ec; }
.member-page #aiPanel summary { padding: 8px 11px; font-size: 11px; }
.member-page #aiPanel[open] { grid-column: 1 / -1; }
.member-page #invoiceForm .types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 12px; overflow: visible; border: 1px solid #dfe5d5; border-radius: 8px; background: #f1f4e9; }
.member-page #invoiceForm .type { min-height: 34px; padding: 6px; border-color: transparent; border-radius: 5px; background: transparent; text-align: center; }
.member-page #invoiceForm .type strong { margin: 0; font-size: 12px; font-weight: 500; line-height: 1.5; }
.member-page #invoiceForm .type.active { border-color: #b6c7a8; background: #fffef9; color: #245b45; box-shadow: 0 1px 3px #2946300a; }
.member-page #invoiceForm .type.active strong { font-weight: 650; }
.member-page #invoiceForm .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.member-page #invoiceForm .field.full { grid-column: 1 / -1; }
.member-page #invoiceForm label { margin: 0 0 5px; font-size: 11px; }
.member-page #invoiceForm input:not([type=checkbox]):not([type=hidden]), .member-page #invoiceForm select { height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.member-page #invoiceForm .invoice-amount input:not([type=hidden]) { padding-left: 29px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.member-page #invoiceForm .amount-input > span { top: 50%; transform: translateY(-50%); font-size: 14px; }
.member-page #invoiceForm .settings-hint { display: block; margin-top: 4px; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.member-page #invoiceForm .settings-hint:empty { display: none; }
.member-page .invoice-category-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.member-page #invoiceCategoryPrefix { background: #eef3e8; color: #245b45; border-radius: 6px; padding: 7px 9px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.member-page .invoice-payment-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: start; gap: 6px 10px; min-width: 0; }
.member-page #invoiceForm .invoice-payment-row > label { margin: 0; white-space: nowrap; }
.member-page #paymentChannelHint { grid-column: 1 / -1; }
.member-page .invoice-extras { grid-column: 1 / -1; min-width: 0; padding: 0 14px; border: 1px solid #cbd9bf; border-radius: 8px; background: #f8faf3; }
.member-page .invoice-extras > summary { padding: 12px 0; color: #315630; font-size: 14px; font-weight: 650; cursor: pointer; }
.member-page .invoice-extras[open] { padding-bottom: 14px; }
.member-page #invoiceForm .invoice-extras .form-grid { grid-template-columns: minmax(0, 1fr); }
.member-page #invoiceForm .invoice-extras label { font-size: 13px; }
.member-page #invoiceForm #email { height: 46px; }
.member-page #invoiceRemark { min-height: 88px; font-size: 14px; }
.member-page #feePreview { grid-column: auto; grid-template-columns: 1.5fr 1fr 1fr; align-items: center; gap: 8px; padding: 10px 12px; margin: 0; }
.member-page #feePreview .fee-cell > span { margin-bottom: 4px; font-size: 10px; line-height: 1.4; }
.member-page #feePreview .fee-cell > strong { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.member-page #feePreview .fee-cell:last-child { padding-left: 9px; }
.member-page #feePreview .fee-cell:last-child > strong { font-size: 16px; }
.member-page #invoiceForm .form-footer { margin-top: 10px; padding-top: 10px; }
.member-page #invoiceForm .primary { min-height: 40px; padding: 9px 18px; font-size: 13px; }
@media (max-width: 980px) {
  .member-page .grid { gap: 14px; }
}
@media (max-width: 600px) {
  .member-page .shell { padding: 0 12px 84px; }
  .member-page .topbar { min-height: 48px; gap: 8px; }
  .member-page .workspace-intro { flex-direction: row; padding: 6px 0 10px; gap: 0; }
  .member-page .workspace-intro > div { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .member-page .member-nav { width: 100%; }
  .member-page .member-nav a { flex: 1; padding: 6px; }
  .member-page .grid > .main-card { padding: 12px; }
  .member-page .compact-invoice-header { margin-bottom: 8px; }
  .member-page #invoiceForm .type { min-height: 38px; padding: 5px 3px; }
  .member-page #invoiceForm .form-grid { gap: 8px 10px; }
  .member-page #invoiceForm .invoice-title, .member-page #invoiceForm .invoice-tax, .member-page .invoice-payment-row, .member-page #feePreview { grid-column: 1 / -1; }
  .member-page #invoiceForm input:not([type=checkbox]):not([type=hidden]), .member-page #invoiceForm select { height: 44px; font-size: 16px; }
  .member-page #invoiceForm .invoice-amount input:not([type=hidden]) { font-size: 20px; }
  .member-page #feePreview { grid-template-columns: 1.5fr 1fr 1fr; padding: 9px 10px; }
  .member-page #invoiceForm .form-footer { margin: 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); }
  .member-page #invoiceForm .form-footer .primary { min-height: 44px; padding: 10px 14px; }
}

/* 会员端最近开票点击交互与开票详情弹窗 */
.member-page .recent-item-clickable {
  cursor: pointer;
  margin: 0 -8px;
  padding: 12px 8px;
  border-radius: 9px;
  transition: background-color .16s ease, border-color .16s ease;
}
.member-page .recent-item-clickable:hover {
  background: #f3f6ec;
}
.member-page .recent-item-clickable:hover .recent-name {
  color: #193f30;
}
.member-page .recent-item-clickable:focus-visible {
  outline: 2px solid #245b45;
  outline-offset: -2px;
  background: #f3f6ec;
}
@keyframes detail-dialog-arrive {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.invoice-detail-dialog {
  width: min(520px, calc(100vw - 24px));
  max-width: none;
  max-height: min(86svh, 760px);
  padding: 0;
  border: 1px solid #d5dfc9;
  border-radius: 16px;
  background: #fffef9;
  color: var(--ink);
  box-shadow: 0 24px 80px #162e2330;
  overflow: hidden;
  text-align: left;
}
.invoice-detail-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: detail-dialog-arrive .18s ease-out;
}
.invoice-detail-dialog::backdrop {
  background: #152a236b;
  backdrop-filter: blur(5px);
}
.invoice-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #e6ebdd;
  background: #fbfcf8;
  flex-shrink: 0;
}
.invoice-detail-title-group {
  min-width: 0;
}
.invoice-detail-eyebrow {
  display: block;
  font-size: 11px;
  color: #5f725b;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.invoice-detail-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.02em;
  color: var(--ink);
}
.invoice-detail-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.invoice-detail-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #dde4d4;
  border-radius: 8px;
  background: #fffef9;
  color: #52644a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.invoice-detail-close:hover {
  background: #edf2e7;
  color: var(--ink);
}
.invoice-detail-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 20px;
  display: grid;
  gap: 14px;
}
.invoice-detail-hero {
  background: #f2f6ea;
  border: 1px solid #dde6d2;
  border-radius: 11px;
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}
.invoice-detail-label {
  display: block;
  font-size: 11px;
  color: #607259;
  margin-bottom: 4px;
}
.invoice-detail-hero-title strong {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
.invoice-detail-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #dce5d1;
}
.invoice-detail-money,
.invoice-detail-fee {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.invoice-detail-money {
  color: var(--ink);
}
.invoice-detail-fee {
  color: #245b45;
}
.invoice-detail-adjust {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #7c6227;
  background: #f9f2df;
  border-radius: 6px;
  padding: 6px 9px;
}
.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.invoice-detail-cell {
  padding: 10px 12px;
  border: 1px solid #e6ebdd;
  border-radius: 9px;
  background: #fffefb;
  min-width: 0;
}
.invoice-detail-cell-highlight {
  grid-column: 1 / -1;
  background: #f7faf1;
  border-color: #d6e2c8;
}
.invoice-detail-cell dt {
  font-size: 11px;
  color: #63745b;
  margin: 0 0 4px;
}
.invoice-detail-cell dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}
.invoice-detail-cell-highlight dd {
  font-size: 14px;
  font-weight: 600;
  color: #204938;
}
.invoice-detail-remark-box {
  padding: 12px 14px;
  border: 1px solid #e3e8d9;
  border-radius: 10px;
  background: #fafbf6;
}
.invoice-detail-remark {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.invoice-detail-remark.is-empty {
  color: #7b8779;
}
.invoice-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid #e6ebdd;
  background: #fbfcf8;
  flex-shrink: 0;
}
.invoice-detail-footer .primary,
.invoice-detail-footer .secondary {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
}
.invoice-detail-download {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 520px) {
  .invoice-detail-dialog {
    width: calc(100vw - 16px);
    max-height: 88svh;
    border-radius: 14px;
  }
  .invoice-detail-header {
    padding: 14px 16px 12px;
  }
  .invoice-detail-body {
    padding: 14px 16px 16px;
    gap: 12px;
  }
  .invoice-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .invoice-detail-footer {
    padding: 12px 16px;
  }
  .invoice-detail-footer .primary,
  .invoice-detail-footer .secondary {
    min-height: 42px;
    flex: 1;
  }
}
