:root {
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  color: #202226;
  background: #f4f5f6;
  --ink: #202226;
  --muted: #757b83;
  --line: #dde0e4;
  --panel: #fff;
  --dark: #1d1f22;
  --accent: #d95783;
  --accent-dark: #b94069;
  --green: #25885a;
  --amber: #b17b22;
  --danger: #be494c;
}

* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html, body { min-width: 1000px; min-height: 680px; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #1d1f22;
}
.boot-screen > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #89475f;
  border-radius: 6px;
  color: #ffb2cb;
  background: #442732;
  font-weight: 700;
  animation: boot-pulse 1.1s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { opacity: .58; }
  50% { opacity: 1; }
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #1d1f22;
}

.login-panel {
  display: flex;
  width: 370px;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border: 1px solid #3b3e43;
  border-radius: 8px;
  background: #26282c;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

.login-brand, .sidebar-brand { display: flex; align-items: center; gap: 11px; }
.login-brand { margin-bottom: 9px; color: #fff; }
.login-brand > span, .sidebar-brand > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #89475f;
  border-radius: 6px;
  color: #ffb2cb;
  background: #442732;
  font-weight: 700;
}
.login-brand > div, .sidebar-brand > div { display: flex; flex-direction: column; }
.login-brand strong { font-size: 16px; }
.login-brand small, .sidebar-brand small { color: #8f949c; font-size: 11px; }
.login-panel label { display: flex; flex-direction: column; gap: 7px; color: #c3c6cb; font-size: 12px; }
.login-panel input {
  height: 40px;
  padding: 0 11px;
  border: 1px solid #44474d;
  border-radius: 5px;
  color: #fff;
  background: #1d1f22;
}
.login-panel button, .primary-action {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}
.login-panel button:hover, .primary-action:hover { background: #e46891; }
#login-error { min-height: 16px; margin: 0; color: #efa0a4; font-size: 11px; text-align: center; }

.admin-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  display: grid;
  position: sticky;
  top: 0;
  grid-template-rows: 72px minmax(0, 1fr) 58px;
  height: 100vh;
  color: #e9ebee;
  background: var(--dark);
}
.sidebar-brand { padding: 0 18px; border-bottom: 1px solid #33363a; }
.sidebar-brand > span { width: 34px; height: 34px; }
.sidebar-brand strong { font-size: 13px; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; padding: 15px 10px; }
.sidebar nav button, .logout {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  color: #9fa4ac;
  background: transparent;
  text-align: left;
  font-size: 12px;
}
.sidebar nav button:hover, .sidebar nav button.active { color: #fff; background: #303238; }
.sidebar nav button.active { box-shadow: inset 3px 0 var(--accent); }
.logout { margin: 8px 10px 12px; border-top: 1px solid #33363a; border-radius: 0; }

.admin-main { min-width: 0; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.admin-header h1 { margin: 0; font-size: 17px; }
.admin-header > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.admin-header span { color: var(--muted); font-size: 11px; }
.server-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 11px; }
.server-status i { width: 7px; height: 7px; border-radius: 50%; background: #37a96f; }
.admin-content { padding: 24px 28px 40px; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
.metric {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 10px; font-size: 24px; }
.metric small { display: block; margin-top: 4px; color: #9da2a9; font-size: 10px; }
.metric-with-badge { position: relative; }
.metric-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #237b51;
  background: #e4f4eb;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
}
.metric-badge.connecting { color: #5d636b; background: #eceff2; }
.metric-badge.polling { color: #9a691a; background: #f8efda; }
.metric-badge.error { color: #a54245; background: #fae7e8; }

.dashboard-online-users {
  min-height: 64px;
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}
.online-user-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.online-user-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #ddebd7;
  border-radius: 4px;
  background: #f6fbf3;
}
.online-user-item span {
  display: block;
  overflow: hidden;
  color: #255f3f;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-user-item small {
  display: block;
  margin-top: 4px;
  color: #71907f;
  font-size: 9px;
}
.online-empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 11px;
}

.section-block { margin-top: 18px; border-top: 1px solid var(--line); background: var(--panel); }
.section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 0 16px; border: 1px solid var(--line); border-top: 0; }
.section-heading h2 { margin: 0; font-size: 13px; }
.section-heading span { color: var(--muted); font-size: 10px; }
.section-heading button, .secondary-action {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #cfd3d8;
  border-radius: 4px;
  color: #454950;
  background: #fff;
  font-size: 11px;
}
.section-heading button:hover, .secondary-action:hover:not(:disabled) { background: #f1f2f4; }
.admin-collapsible-block > summary { cursor: pointer; list-style: none; }
.admin-collapsible-block > summary::-webkit-details-marker { display: none; }
.admin-collapsible-block > summary::after { content: ""; width: 7px; height: 7px; margin-left: 12px; border-right: 1.5px solid #8a9098; border-bottom: 1.5px solid #8a9098; transform: rotate(-45deg); transition: transform 120ms ease; }
.admin-collapsible-block[open] > summary::after { transform: rotate(45deg); }
.admin-collapsible-block > summary > div { min-width: 0; }
.collapsible-hint { margin-left: auto; color: var(--muted); font-size: 10px; }
.admin-collapsible-body { min-width: 0; }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-top: 0; color: var(--muted); font-size: 10px; }
.admin-pagination button { min-height: 28px; padding: 0 10px; border: 1px solid #cfd3d8; border-radius: 4px; color: #454950; background: #fff; font-size: 10px; }
.admin-pagination button:hover:not(:disabled) { background: #f1f2f4; }
.admin-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.secondary-action:disabled { opacity: .45; cursor: not-allowed; }
.stats-filter { display: flex; align-items: flex-end; gap: 8px; }
.stats-filter label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.stats-filter input { height: 30px; padding: 0 7px; border: 1px solid #cfd3d8; border-radius: 4px; color: var(--ink); background: #fff; font-size: 11px; }
.stats-filter button { min-height: 30px; }
.stats-table-wrap { overflow-x: auto; }
.custom-font-admin-block { overflow: hidden; }
.custom-font-user-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.custom-font-user-filter select { min-width: 220px; height: 30px; padding: 0 8px; border: 1px solid #cfd3d8; border-radius: 4px; color: var(--ink); background: #fff; font-size: 11px; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 11px; }
.data-table th, .data-table td { height: 44px; padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.data-table th { height: 36px; color: #676c74; background: #f6f7f8; font-weight: 600; }
.data-table td { color: #3f4349; }
.data-table code { color: #6a7078; font-size: 9px; }
.data-table input, .data-table select { height: 30px; border: 1px solid #ccd0d5; border-radius: 4px; padding: 0 7px; background: #fff; }
.data-table input[type="number"] { width: 82px; }
.data-table button { min-height: 28px; padding: 0 8px; border: 1px solid #ccd0d5; border-radius: 4px; color: #484c53; background: #fff; font-size: 10px; }
.data-table button:hover { border-color: #aaafb6; background: #f3f4f5; }

.status { display: inline-block; padding: 3px 6px; border-radius: 3px; font-size: 9px; }
.status.paid, .status.active { color: #237b51; background: #e4f4eb; }
.status.pending { color: #9a691a; background: #f8efda; }
.status.expired, .status.closed, .status.refunded { color: #a54245; background: #fae7e8; }
.status.disabled { color: #6d5521; background: #f5ead0; }
.status.deleted { color: #747981; background: #eceff2; }

.provider-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 9px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.provider-pill.provider-mock { color: #747981; background: #eceff2; }
.provider-pill.provider-xunhupay { color: #9a691a; background: #f8efda; }
.provider-pill.provider-alipay { color: #1c62b9; background: #e3eefb; }

.row-subtle { display: block; margin-top: 4px; color: #9aa0a8; font-size: 9px; }
.user-row-disabled td { background: #fffaf0; }
.user-row-deleted td { color: #8b9098; background: #f7f8f9; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.user-actions select { width: 92px; }
.data-table button.danger-table-button { border-color: #dfbfc0; color: var(--danger); }
.data-table button.danger-table-button:hover:not(:disabled) { border-color: var(--danger); background: #fdf3f3; }
.data-table button:disabled, .data-table select:disabled { opacity: .5; cursor: not-allowed; }

.plans-table-wrap { overflow-x: auto; }
.plans-table { min-width: 1160px; }
.plans-table td { vertical-align: middle; }
.plans-table input[name="baseQuantity"],
.plans-table input[name="bonusQuantity"] { width: 94px; }
.plans-table .plan-description-input { width: 170px; }
.plans-table [data-plan-total] { white-space: nowrap; }
.plans-table input:disabled { opacity: .45; cursor: not-allowed; background: #f1f2f4; }
.plan-referral-toggle { display: inline-flex; align-items: center; gap: 5px; color: #5f646c; font-size: 10px; white-space: nowrap; }
.plan-referral-toggle input { width: 15px; height: 15px; }
.referral-metric-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.referral-settings-layout { grid-template-columns: minmax(300px, 420px) minmax(260px, 1fr); margin-top: 18px; }
.referral-rules-panel p { margin: 0 0 12px; color: #646a72; font-size: 11px; line-height: 1.7; }
.referral-rules-panel p:last-child { margin-bottom: 0; }
.referral-qr-settings { padding-bottom: 18px; }
.referral-qr-config { display: flex; align-items: center; gap: 22px; padding: 18px 16px; border: 1px solid var(--line); border-top: 0; background: #fff; }
.referral-qr-preview-wrap { display: flex; position: relative; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 8px; }
.referral-qr-preview { display: block; width: 164px; height: 164px; padding: 6px; border: 1px solid #e1d8dc; border-radius: 6px; background: #fff; object-fit: contain; }
.referral-qr-preview--empty { display: grid; place-items: center; color: #9a9296; background: #faf8f9; font-size: 11px; }
.referral-qr-upload { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: #626870; font-size: 11px; }
.referral-qr-upload p { margin: 0; line-height: 1.6; }
.referral-qr-upload .primary-action { min-height: 32px; padding: 0 13px; }
.file-picker { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 11px; border: 1px solid #d9cbd1; border-radius: 5px; color: #633f4e; background: #fff8fb; cursor: pointer; }
.file-picker input { width: 190px; max-width: 100%; color: #626870; font-size: 10px; }
.status.approved { color: #237b51; background: #e4f4eb; }

.split-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 18px; }
.form-panel { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.form-panel h2 { margin: 0 0 16px; font-size: 13px; }
.hint-card { padding: 12px 14px; border: 1px solid #ead9df; border-radius: 5px; color: #5f5056; background: #fff8fa; font-size: 10px; line-height: 1.65; }
.hint-card strong { color: #4c3d43; font-size: 11px; }
.hint-card p { margin: 5px 0 0; }
.setup-list { margin: 0; padding: 0 0 0 20px; color: #525860; font-size: 10px; line-height: 1.75; }
.setup-list li { padding-left: 3px; }
.setup-list code { overflow-wrap: anywhere; color: #7a2949; }
.payment-settings-page { display: flex; flex-direction: column; gap: 18px; }
.payment-current-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid #e6d4dc;
  border-radius: 7px;
  background: linear-gradient(110deg, #fff8fb 0%, #fff 58%);
}
.payment-current-bar h2 { margin: 5px 0; font-size: 15px; }
.payment-current-bar p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.payment-switcher { display: flex; flex: 0 0 auto; align-items: end; gap: 8px; }
.payment-switcher label { display: flex; flex-direction: column; gap: 5px; color: #5b6068; font-size: 10px; }
.payment-switcher select { min-width: 170px; height: 32px; padding: 0 8px; border: 1px solid #cfd3d8; border-radius: 4px; color: var(--ink); background: #fff; font-size: 11px; }
.payment-eyebrow { color: var(--accent-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.payment-current-bar button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #cfd3d8;
  border-radius: 4px;
  color: #454950;
  background: #fff;
  font-size: 11px;
}
.payment-switcher .primary-action { min-height: 32px; padding: 0 12px; }
.payment-current-bar button:hover { background: #f1f2f4; }
.payment-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.payment-provider-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.payment-provider-card-alipay { border-top: 3px solid #1677ff; }
.payment-provider-card-xunhu { border-top: 3px solid #d95783; }
.payment-provider-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
}
.payment-provider-title { display: flex; min-width: 0; align-items: center; gap: 10px; }
.payment-provider-title h2 { margin: 0 0 4px; font-size: 13px; }
.payment-provider-title > div > span { color: var(--muted); font-size: 10px; }
.payment-provider-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #1677ff;
  font-size: 13px;
  font-weight: 700;
}
.payment-provider-card-xunhu .payment-provider-icon { background: var(--accent); }
.payment-state { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.payment-state::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.payment-state.active, .payment-state.ready { color: #237b51; background: #e4f4eb; }
.payment-state.pending { color: #9a691a; background: #f8efda; }
.payment-provider-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 16px; padding: 16px; }
.payment-section-label { margin: 0 0 9px; color: #555b63; font-size: 10px; font-weight: 700; }
.payment-config-table { table-layout: fixed; }
.payment-config-table th { width: 112px; }
.payment-config-table td { overflow-wrap: anywhere; }
.payment-config-table code { overflow-wrap: anywhere; white-space: normal; }
.payment-config-source { margin: 9px 0 0; color: #9398a0; font-size: 9px; line-height: 1.5; }
.payment-guide-section { min-width: 0; padding-top: 15px; border-top: 1px solid #eceef1; }
.payment-security-note, .payment-fallback-note { margin-top: 12px; }
.payment-fallback-note { color: #5a4b50; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; color: #5b6068; font-size: 11px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid #cfd3d8;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}
.form-grid textarea { min-height: 150px; resize: vertical; font-family: Consolas, monospace; font-size: 10px; }
.form-grid button { margin-top: 3px; }
.form-grid .switch-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafbfc;
}
.form-grid .switch-field input {
  width: 18px;
  min-height: 18px;
  justify-self: end;
  accent-color: var(--accent);
}
.empty { padding: 36px; border: 1px solid var(--line); color: var(--muted); background: #fff; font-size: 11px; text-align: center; }
.notice { position: fixed; z-index: 20; right: 20px; bottom: 20px; max-width: 360px; padding: 10px 14px; border: 1px solid #4a4e54; border-radius: 5px; color: #fff; background: #282a2e; font-size: 11px; box-shadow: 0 8px 26px rgba(0,0,0,.2); }

/* /admin/#assets 页面：各板块纵向排列并留出间距（此前板块之间 border 直接相连，看着糊成一片） */
.assets-page { display: flex; flex-direction: column; gap: 18px; }
.assets-page > .section-block,
.assets-page > .oss-toolbar,
.assets-page > .oss-layout { margin-top: 0; }

.gradient-admin-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  border-top: 0;
  background: transparent;
}
.gradient-admin-panel {
  border: 1px solid var(--line);
  background: var(--panel);
}
.gradient-admin-panel .section-heading { border: 0; border-bottom: 1px solid var(--line); }
.gradient-admin-panel .gradient-admin-toolbar { border: 0; }
.gradient-admin-toolbar {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fbfcfd;
}
.gradient-import-form {
  display: flex;
  min-width: 360px;
  align-items: stretch;
  gap: 10px;
}
.gradient-upload-drop {
  display: flex;
  min-width: 280px;
  min-height: 58px;
  padding: 8px 10px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #c7cbd1;
  border-radius: 4px;
  color: #555b63;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}
.gradient-upload-drop:hover {
  border-color: var(--accent);
  background: #fff6fa;
}
.gradient-upload-drop input {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}
.gradient-upload-drop span {
  color: var(--muted);
  font-size: 9px;
}
.gradient-import-form .primary-action {
  align-self: center;
  min-width: 86px;
}
.gradient-import-note {
  display: flex;
  min-width: 0;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.gradient-admin-grid {
  display: grid;
  max-height: 430px;
  padding: 12px 16px 16px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  overflow: auto;
  background: #fff;
}
.gradient-admin-card {
  display: flex;
  position: relative;
  min-width: 0;
  min-height: 84px;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #d9dde2;
  border-radius: 5px;
  background: #fbfcfd;
}
.gradient-admin-card.deleted {
  opacity: .62;
}
.gradient-admin-preview {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 3px;
}
.gradient-admin-card strong {
  overflow: hidden;
  color: #444950;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gradient-admin-card small {
  overflow: hidden;
  color: #8a9098;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gradient-admin-delete {
  display: grid;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  color: #9b4b50;
  background: rgba(255, 255, 255, .9);
  font-size: 15px;
  line-height: 1;
}
.gradient-admin-delete:hover {
  border-color: var(--danger);
  color: #fff;
  background: var(--danger);
}
.gradient-admin-empty {
  min-height: 84px;
  padding: 26px;
  grid-column: 1 / -1;
}
.gradient-source-block {
  border: 1px solid var(--line);
  background: #fff;
}
.gradient-source-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #4c5158;
  font-size: 11px;
}
.gradient-source-heading span {
  color: var(--muted);
  font-size: 9px;
}
.gradient-error-summary {
  max-width: 260px;
  color: var(--danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oss-toolbar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); background: #fff; }
.oss-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.oss-toolbar select { min-width: 190px; height: 32px; padding: 0 8px; border: 1px solid #cfd3d8; border-radius: 4px; background: #fff; }
.oss-toolbar #oss-refresh { margin-left: auto; }
.oss-layout { display: grid; grid-template-columns: minmax(440px, 1fr) 330px; gap: 18px; margin-top: 18px; }
.oss-browser { min-width: 0; border: 1px solid var(--line); background: #fff; }
.oss-browser-heading { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.oss-browser-heading h2 { margin: 0; font-size: 13px; }
.oss-browser-heading span { color: var(--muted); font-size: 10px; }
.oss-tree { min-height: 440px; max-height: calc(100vh - 220px); overflow: auto; padding: 8px; background: #fafbfc; }
.oss-folder summary, .oss-file-row { display: grid; width: 100%; align-items: center; gap: 7px; min-height: 36px; padding: 0 9px; border: 0; border-radius: 3px; color: #42474e; background: transparent; text-align: left; list-style: none; }
.oss-folder summary { position: relative; grid-template-columns: 12px 34px minmax(0, 1fr) 58px auto; padding-left: 13px; }
.oss-file-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.oss-folder summary { cursor: pointer; }
.oss-folder summary::-webkit-details-marker { display: none; }
.oss-folder-chevron { width: 7px; height: 7px; border-right: 1.5px solid #8a9098; border-bottom: 1.5px solid #8a9098; transform: rotate(-45deg); transition: transform 120ms ease; }
.oss-folder[open] > summary .oss-folder-chevron { transform: rotate(45deg); }
.oss-folder summary:hover, .oss-file-row:hover, .oss-folder summary.selected, .oss-file-row.selected { background: #edf0f3; }
.oss-folder[open] > summary { background: #f2f4f7; }
.oss-folder summary.dragging { outline: 1px dashed var(--accent); outline-offset: -3px; background: #fff4f8; }
.oss-folder summary.selected, .oss-file-row.selected { box-shadow: inset 3px 0 var(--accent); }
.oss-folder summary strong, .oss-file-row strong { overflow: hidden; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.oss-folder-name { display: inline-flex; min-width: 0; align-items: center; justify-content: flex-start; gap: 4px; }
.oss-folder-name strong { flex: 0 1 auto; min-width: 0; }
.oss-folder summary small, .oss-file-row small { color: #8a9098; font-size: 9px; }
.oss-folder-mark, .oss-file-row > span { display: grid; min-width: 30px; height: 21px; place-items: center; border-radius: 3px; color: #8d671d; background: #f6e8c8; font-size: 8px; font-weight: 700; }
.oss-file-row > span { color: #5b6470; background: #e8ebef; }
.oss-folder-actions { display: inline-flex; width: 58px; height: 28px; align-items: center; justify-content: flex-end; gap: 3px; }
.oss-lock-button { display: grid; position: relative; width: 26px; height: 26px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 3px; color: #777d85; background: transparent; }
.oss-lock-button:hover { border-color: #c8ccd1; color: #3f454c; background: #fff; }
.oss-lock-button.locked { color: #a64362; background: #faedf2; }
.oss-lock-button.locked:hover { border-color: #d7a6b7; }
.oss-lock-button.system { color: #7d626b; background: #eee8ea; cursor: not-allowed; }
.oss-lock-button:disabled { opacity: .55; cursor: wait; }
.oss-lock-icon { position: relative; width: 12px; height: 9px; margin-top: 4px; border: 1.5px solid currentColor; border-radius: 2px; }
.oss-lock-icon::before { position: absolute; bottom: 7px; left: 2px; width: 6px; height: 6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; content: ""; }
.oss-lock-button.unlocked .oss-lock-icon::before { left: 5px; transform: rotate(24deg); transform-origin: 0 100%; }
.oss-style-add-button { display: grid; width: 26px; height: 26px; padding: 0; place-items: center; border: 1px solid #d8dce1; border-radius: 3px; color: #7c2141; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.oss-style-add-button:hover { border-color: #c84b7a; background: #fff1f6; }
.oss-style-add-button:disabled { opacity: .5; cursor: wait; }
.oss-folder-children { margin-left: 17px; border-left: 1px solid #e1e4e8; padding-left: 5px; }
.oss-empty-folder { min-height: 30px; padding: 8px 12px 8px 44px; color: #a0a5ac; font-size: 10px; }
.oss-operations { display: flex; flex-direction: column; gap: 12px; }
.oss-operations .form-panel { border-radius: 4px; }
.oss-operations .form-grid textarea { min-height: 80px; }
.oss-operations .form-grid > small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.oss-upload-drop {
  min-height: 108px;
  padding: 10px;
  border: 1px dashed #c7cbd1;
  border-radius: 4px;
  background: #fafbfc;
  transition: border-color 120ms ease, background 120ms ease;
}
.oss-upload-drop:hover, .oss-upload-drop.dragging {
  border-color: var(--accent);
  background: #fff6fa;
}
.oss-upload-drop input { margin-top: 2px; }
.oss-upload-drop span {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: #555b63;
  font-size: 11px;
}
.oss-upload-drop small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oss-field-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.oss-field-meta small { min-width: 0; font-size: inherit; }
.oss-field-meta output { flex: 0 0 auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oss-field-error { min-height: 13px; color: var(--danger); font-size: 9px; line-height: 1.4; }
.form-grid input.invalid { border-color: var(--danger); outline-color: var(--danger); }
.oss-selection { display: flex; flex-direction: column; gap: 5px; min-height: 58px; padding: 11px 13px; border: 1px solid var(--line); background: #fff; }
.oss-selection span { color: var(--muted); font-size: 10px; }
.oss-selection strong { overflow: hidden; color: #444950; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.danger-action { min-height: 38px; border: 1px solid #d7b6b7; border-radius: 4px; color: var(--danger); background: #fff; font-size: 11px; }
.danger-action:hover:not(:disabled) { border-color: var(--danger); background: #fdf3f3; }
.danger-action:disabled, .primary-action:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout { grid-template-columns: 340px minmax(0, 1fr); }
  .oss-layout { grid-template-columns: minmax(400px, 1fr) 300px; }
  .payment-provider-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .payment-current-bar { align-items: stretch; flex-direction: column; }
  .payment-switcher { align-items: stretch; flex-wrap: wrap; }
  .payment-switcher label { flex: 1 1 100%; }
  .payment-switcher select { width: 100%; }
  .payment-switcher button { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------------------
 * 美化确认弹窗：替代原生 confirm / prompt / alert
 * 由 admin.js 动态创建 <dialog class="admin-dialog">，showModal() 保证位于顶层
 * ------------------------------------------------------------------------- */
.admin-dialog {
  width: min(460px, 92vw);
  max-width: min(460px, 92vw);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 64px rgba(24, 26, 29, .28);
}

.admin-dialog::backdrop {
  background: rgba(20, 22, 25, .5);
  backdrop-filter: blur(3px);
}

.admin-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}

.admin-dialog-header strong { font-size: 14px; }

.admin-dialog-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 17px;
  line-height: 1;
}

.admin-dialog-close:hover { border-color: var(--line); color: var(--ink); background: #f1f2f4; }

.admin-dialog-message {
  margin: 0;
  padding: 20px 20px 16px;
  color: #4b5058;
  font-size: 13px;
  line-height: 1.7;
  /* 原 window.confirm 文案里的换行要按原样保留 */
  white-space: pre-line;
}

.admin-dialog-field { display: grid; gap: 6px; padding: 0 20px 16px; }
.admin-dialog-field > span { color: var(--muted); font-size: 11px; }

.admin-dialog-input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #ccd0d5;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}

.admin-dialog-input:focus { outline: 2px solid rgba(217, 87, 131, .35); outline-offset: 1px; border-color: var(--accent); }

.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }

.admin-dialog-button {
  min-width: 92px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #ccd0d5;
  border-radius: 5px;
  color: #484c53;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
}

.admin-dialog-button:hover { border-color: #aaafb6; background: #f3f4f5; }
.admin-dialog-button.is-primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.admin-dialog-button.is-primary:hover { border-color: #e46891; background: #e46891; }
.admin-dialog-button.is-primary.is-danger { border-color: var(--danger); background: var(--danger); }
.admin-dialog-button.is-primary.is-danger:hover { border-color: #d05a5d; background: #d05a5d; }
