body { background: #f7f8f7; }
button:disabled { cursor: default; }
a, button, input { touch-action: manipulation; }
a:focus-visible, button:focus-visible { outline: 3px solid #77a89a; outline-offset: 4px; }
.admin-header { width: 100%; max-width: 1200px; margin: auto; padding: 24px 36px; }
.account-brand span { margin-left: 8px; font-size: 11px; font-weight: 500; letter-spacing: .5px; padding: 4px 7px; border: 1px solid #d5ddd8; border-radius: 5px; vertical-align: middle; color: #65736c; }
.admin-main { width: min(1128px, 100% - 72px); margin: 35px auto 80px; }
.admin-loading { padding: 100px 24px; color: #717771; text-align: center; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.admin-eyebrow { margin: 0 0 12px; font-size: 12px; color: #68756c; letter-spacing: 1.4px; }
.admin-heading h1 { font-size: 32px; margin-bottom: 10px; }
.admin-heading .account-description { margin-bottom: 0; font-size: 14px; }
.admin-preview { display: flex; gap: 22px; padding: 12px 16px; border: 1px solid #d8dfda; border-radius: 10px; text-decoration: none; white-space: nowrap; font-size: 13px; background: white; }
.admin-preview:hover { background: #eef2ef; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 28px 0 22px; border-bottom: 1px solid #dfe4e0; }
.admin-nav a { padding: 0 0 14px; font-size: 13px; text-decoration: none; color: #677069; white-space: nowrap; }
.admin-nav a[aria-current] { color: #253c30; border-bottom: 2px solid #375946; font-weight: 600; }
.admin-notice { display: flex; gap: 12px; padding: 16px 18px; border: 1px solid #e1e6e2; border-radius: 12px; background: #f0f3ef; margin-bottom: 28px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #65826b; flex-shrink: 0; margin-top: 5px; }
.admin-notice strong { font-size: 13px; font-weight: 600; color: #385340; }
.admin-notice p { margin: 5px 0 0; color: #6a776b; font-size: 12px; line-height: 1.7; }
.section-heading, .plans-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading > span, .plans-heading > span { color: #7a837b; font-size: 12px; }
.price-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.base-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr) minmax(160px, .9fr); gap: 32px; align-items: center; padding: 24px; border: 1px solid #dfe5df; border-radius: 16px; background: white; }
.base-card h3, .plans-heading h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.base-card p { font-size: 12px; color: #7a827b; line-height: 1.7; margin: 0; }
.base-editor label { font-size: 12px; margin: 0 0 8px; color: #505c53; }
.input-unit { display: flex; align-items: center; gap: 7px; border: 1px solid #d9dfda; border-radius: 9px; padding: 0 12px; min-height: 44px; background: white; }
.input-unit span { white-space: nowrap; color: #7a847c; font-size: 12px; }
.input-unit input { padding: 10px 0; background: transparent; min-height: 42px; border: 0; box-shadow: none; border-radius: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.input-unit:focus-within { outline: 2px solid #d5e5da; border-color: #6f927b; }
.input-unit:has(input[aria-invalid="true"]), input[aria-invalid="true"] { border-color: #be5d4f; }
.base-card .field-help { font-size: 11px; margin-top: 6px; }
.base-example { border-left: 1px solid #e7ece7; padding-left: 28px; display: grid; gap: 7px; }
.base-example > span { font-size: 11px; color: #7a827b; }
.base-example strong { font-size: 29px; font-weight: 600; letter-spacing: -.6px; font-variant-numeric: tabular-nums; color: #2e4838; }
.base-example small { font-size: 12px; font-weight: 400; margin-left: 3px; }
.plans-heading { margin: 26px 0 13px; }
.plans-heading h3 { margin: 0; }
.admin-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-editor { padding: 20px; border: 1px solid #dfe5df; background: white; border-radius: 16px; min-width: 0; }
.plan-editor-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.plan-editor-heading > span:first-child { color: #8b958c; font-size: 11px; letter-spacing: 1px; }
.discount-pill { font-size: 11px; color: #416b50; background: #edf5ee; padding: 4px 8px; border-radius: 5px; }
.plan-editor label { color: #677269; font-size: 12px; margin: 0 0 16px; gap: 8px; }
.plan-editor > label input { padding: 10px 12px; min-height: 43px; border-radius: 9px; font-size: 14px; border-color: #d9dfda; }
.plan-numbers { display: grid; grid-template-columns: .85fr 1.15fr; gap: 12px; }
.discount-preview { border-top: 1px solid #edf0ed; padding-top: 13px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.discount-preview span { font-size: 11px; color: #7d867e; }
.discount-preview strong { font-size: 12px; color: #3e654a; font-weight: 500; }
.field-error, .base-card .field-error { color: #b44939; font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.pricing-rule, .section-note { color: #7b837c; font-size: 12px; line-height: 1.8; margin: 14px 2px 0; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; margin-top: 14px; border-bottom: 1px solid #dfe5df; }
.save-bar > div:first-child { display: grid; gap: 5px; min-width: 0; }
.save-bar strong { font-size: 13px; font-weight: 500; color: #3c5c46; }
.save-bar span { font-size: 11px; color: #7a837b; overflow-wrap: anywhere; }
.save-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.save-actions button, .save-feedback button { min-height: 42px; padding: 10px 18px; font-size: 13px; border-radius: 9px; white-space: nowrap; }
.save-actions .account-primary { width: auto; margin: 0; background: #2e4b38; }
.save-feedback p { margin-bottom: 0; }
.save-feedback button { margin-top: 12px; }
.admin-section { margin-top: 34px; scroll-margin-top: 24px; }
#pricing { scroll-margin-top: 24px; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-card { padding: 18px 20px; border: 1px solid #dfe5df; border-radius: 12px; background: white; }
.service-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.service-card h3 { font-size: 14px; font-weight: 500; margin: 0; }
.service-badge { color: #737d75; font-size: 11px; padding: 4px 7px; background: #f2f4f2; border-radius: 5px; white-space: nowrap; }
.service-badge[data-ready="true"] { color: #406b4b; background: #edf5ee; }
.service-card p { font-size: 12px; color: #7a837b; margin: 13px 0 0; line-height: 1.7; }
.service-card .service-configure { width: 100%; min-height: 38px; padding: 9px 12px; border-radius: 8px; font-size: 12px; margin-top: 16px; background: #f9fbf9; color: #395840; border-color: #dce5dd; }
.service-card .service-configure:hover { background: #eff5ef; }
.service-card p { min-height: 40px; overflow-wrap: anywhere; }
.service-history { margin-top: 18px; color: #6c786f; font-size: 12px; }
.service-history summary { cursor: pointer; }
.service-history ul { padding-left: 18px; line-height: 1.9; }
.service-history li { margin-bottom: 6px; }
.service-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 48px); border: 1px solid #e2e7e2; border-radius: 20px; padding: 28px; color: #202123; background: #fafbf9; overflow-y: auto; overscroll-behavior: contain; }
.service-dialog::backdrop { background: rgb(21 32 24 / 40%); }
.service-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.service-dialog-heading h2 { margin: 0; font-size: 24px; }
.service-dialog .admin-eyebrow { margin-bottom: 8px; }
.service-close { border: 0; background: #edf1ec; color: #57665a; border-radius: 50%; width: 32px; height: 32px; font-size: 22px; flex-shrink: 0; }
.service-description { font-size: 13px; line-height: 1.8; color: #737f75; margin: 15px 0 22px; }
#service-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.service-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.service-field { margin: 0; font-size: 13px; min-width: 0; color: #4f5f53; gap: 8px; }
.service-field-wide { grid-column: 1 / -1; }
.service-dialog input:not([type="checkbox"]), .service-dialog textarea, .service-dialog select { width: 100%; min-width: 0; border: 1px solid #d8e0d7; border-radius: 9px; background: white; padding: 11px 12px; min-height: 44px; color: #263d2d; font-family: inherit; font-size: 14px; }
.service-dialog textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7; resize: vertical; }
.service-dialog input:focus, .service-dialog textarea:focus, .service-dialog select:focus { outline: 2px solid #d5e5da; border-color: #6f927b; box-shadow: none; }
.service-dialog input::placeholder, .service-dialog textarea::placeholder { color: #9ba49c; }
.secret-state { color: #708373; font-size: 11px; }
.service-enable { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 13px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid #e1e7df; }
.service-enable input { appearance: auto; width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: #3c6447; }
#registration-gift-fields > .service-enable { margin: 0 0 20px; padding: 0; border: 0; }
#service-enable-help { margin-top: 8px; }
.service-callback { margin-top: 18px; display: grid; gap: 7px; padding: 12px; background: #eff4ed; border-radius: 8px; color: #6d7e70; font-size: 11px; }
.service-callback code { overflow-wrap: anywhere; color: #405b46; line-height: 1.6; }
.service-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.service-dialog-actions > div { display: flex; gap: 10px; }
.service-dialog-actions button, .service-keys-heading button, #service-reload { font-size: 13px; border-radius: 9px; min-height: 42px; padding: 9px 14px; }
.service-dialog-actions .account-primary { width: auto; margin: 0; background: #2e4b38; }
.service-dialog-note { font-size: 11px; margin-top: 12px; }
.service-keys-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.service-keys-heading h3 { font-size: 14px; font-weight: 500; margin: 0; }
.service-keys-heading > span { font-size: 12px; color: #6c7b6f; }
.service-keys-heading .service-remove-key { font-size: 12px; color: #8c6255; background: transparent; padding: 5px; border: 0; }
#wechat-keys { margin-top: 22px; }
.service-key-row { padding: 16px; border: 1px solid #dce5db; border-radius: 12px; margin-top: 12px; background: white; }
.service-key-row label { font-size: 12px; margin: 12px 0 0; }
@media (max-width: 640px) {
  .service-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); padding: 20px 16px; border-radius: 16px; }
  .service-fields-grid { grid-template-columns: 1fr; gap: 16px; }
  .service-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .service-dialog-actions > div button { flex: 1; }
  .service-dialog input:not([type="checkbox"]), .service-dialog select { font-size: 16px; }
}
.settings-history { list-style: none; padding: 0; border: 1px solid #dfe5df; border-radius: 12px; background: white; overflow: hidden; }
.settings-history li { padding: 16px 20px; border-top: 1px solid #edf0ed; }
.settings-history li:first-child { border: 0; }
.settings-history summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; font-size: 12px; color: #525e55; list-style: none; }
.settings-history summary::after { content: '＋'; color: #88938a; }
.settings-history details[open] summary::after { content: '−'; }
.history-actor { flex: 1; color: #7b867d; }
.settings-history p { color: #6c786f; font-size: 12px; line-height: 1.9; margin: 12px 0 0; }
.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; }
.model-card { border: 1px solid #dfe5df; border-radius: 16px; padding: 24px; background: white; }
.model-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.model-card input:not([type="checkbox"]), .model-card select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #d8e0d7; border-radius: 9px; background: #fafbf9; font: inherit; color: #263d2d; }
.model-card input:focus, .model-card select:focus { outline: 2px solid #d5e5da; border-color: #6f927b; }
.model-rates-heading, .model-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; }
.model-rates-heading h3 { font-size: 15px; margin: 0; }
.model-rates-heading button, .model-actions button { min-height: 42px; border-radius: 9px; padding: 9px 14px; font-size: 13px; }
.model-actions > div { display: flex; gap: 10px; }
.model-actions .account-primary { width: auto; margin: 0; background: #2e4b38; }
.model-rate-preview { padding: 14px; background: #f1f6ef; border-radius: 9px; font-size: 13px; line-height: 1.8; color: #405b46; }
@media (max-width: 640px) {
  .model-card { padding: 18px; }
  .model-card input:not([type="checkbox"]), .model-card select { font-size: 16px; }
  .model-actions { align-items: stretch; flex-direction: column-reverse; }
  .model-actions > div button { flex: 1; }
}
@media (max-width: 1000px) {
  .admin-main { width: min(1128px, 100% - 40px); }
  .admin-header { padding: 20px; }
  .base-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
  .base-card > div:first-child { grid-column: 1 / -1; }
  .admin-plans, .service-grid { gap: 12px; }
  .plan-editor { padding: 16px; }
  .plan-numbers { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .admin-main { margin-top: 22px; width: calc(100% - 36px); }
  .admin-header { padding: 20px 18px; }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .admin-heading h1 { font-size: 28px; }
  .admin-heading .account-description { max-width: 29em; }
  .admin-preview { padding: 10px 13px; }
  .admin-nav { gap: 10px 18px; justify-content: flex-start; margin-top: 24px; }
  .admin-nav a { font-size: 12px; }
  .admin-notice { padding: 14px; margin-bottom: 24px; }
  .base-card { padding: 18px; gap: 18px; }
  .base-example { padding-left: 16px; }
  .base-example strong { font-size: 24px; }
  .base-editor .input-unit { padding: 0 9px; gap: 3px; }
  .admin-plans, .service-grid { grid-template-columns: 1fr; }
  .plan-editor { padding: 20px; }
  .plan-numbers { grid-template-columns: .9fr 1.1fr; gap: 12px; }
  .save-bar { flex-direction: column; align-items: stretch; gap: 14px; }
  .save-actions button { flex: 1; }
  .section-heading > span { font-size: 11px; }
  .settings-history li { padding: 16px; }
  .settings-history summary { flex-wrap: wrap; gap: 8px; }
  .history-actor { flex-basis: 45%; }
}

.model-catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0 12px; }
.model-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border: 1px solid #e5e7e5; border-radius: 12px; background: #fff; color: #252a27; text-align: left; cursor: pointer; font: inherit; }
.model-choice[aria-pressed="true"] { border-color: #476f56; background: #f5f8f5; box-shadow: 0 0 0 1px #476f56; }
.model-choice span { color: #6c756e; font-size: 12px; }
.model-add { margin-bottom: 18px; }
#model-fields [hidden] { display: none; }
