:root {
  --primary: #355c42; --primary-dark: #244a31; --success: #426d50;
  --danger: #a14742; --warning: #aa783b; --info: #426881;
  --bg: #f3f5f2; --card: #fff; --border: #dce3d9; --text: #23342b; --text-muted: #708177;
}
body { line-height: 1.5; }
#app { align-items: flex-start; }
.admin-sidebar { position: sticky; top: 0; min-height: 100dvh; height: 100dvh; overflow-y: auto; }
.brand { margin-bottom: 35px; }
.brand small { margin-top: 4px; }
nav { gap: 24px; }
.nav-group { display: grid; gap: 5px; }
.nav-group>small { padding: 0 14px 5px; font-size: 10px; color: #859588; letter-spacing: 1px; }
.nav-group button { width: 100%; display: flex; align-items: center; gap: 12px; border-radius: 7px; }
.nav-group button::before { content: ''; height: 5px; width: 5px; border: 1px solid currentColor; border-radius: 2px; opacity: .5; }
.nav-group button.active::before { background: currentColor; opacity: 1; }
.aside-bottom { gap: 18px; padding-top: 28px; }
.aside-bottom button { font-size: 12px; padding: 8px 12px; border: 1px solid #cdd8ca; text-align: center; }
.console-footnote { font-size: 10px; color: #859588; text-align: center; }
main { padding: 34px 38px; max-width: 1600px; }
header { margin-bottom: 28px; gap: 20px; }
header h1 { font-size: 26px; letter-spacing: 0; }
header p { max-width: 680px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-actions button { font-size: 12px; }
.tab-content { min-width: 0; }
.tab-content[aria-busy=true] { cursor: progress; }
.account-panel .stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.stat-card { padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.stat-card h3 { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card .number { font-size: 28px; font-weight: 550; font-variant-numeric: tabular-nums; margin-top: 8px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.toolbar .search-box { width: 270px; margin-right: auto; }
.account-panel .table-wrap { border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.account-panel th { white-space: nowrap; font-size: 12px; color: #6a7d6f; }
.account-panel td { vertical-align: middle; }
.account-panel td:last-child { max-width: none; }
.account-panel .btn-small, .account-dialog .btn-small { width: auto; padding: 6px 10px; font-size: 12px; margin: 2px; }
.account-panel .btn-success, .account-dialog .btn-success { color: #fff; background: var(--primary); border-color: var(--primary); }
.account-panel .btn-danger { color: #9b4440; background: #fff7f5; border-color: #e5d2cf; }
.account-panel .btn-warning { color: #916a38; background: #fcf8ef; border-color: #e6dbc7; }
.account-panel .btn-info { color: #426881; background: #f4f8fb; border-color: #d6e1e8; }
.account-panel .status-active, .account-dialog .status-active { color: #426d50; background: #eaf3e9; border-radius: 5px; padding: 3px 7px; white-space: nowrap; font-size: 11px; }
.account-panel .status-disabled, .task-status-failed { color: #a14742; background: #fbefec; border-radius: 5px; padding: 3px 7px; white-space: nowrap; font-size: 11px; }
.pagination-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-muted); font-size: 12px; }
.pagination-button { padding: 4px 12px; font-size: 20px; }
.section-title { color: var(--text); font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.form-group { margin: 0 0 16px; min-width: 0; }
.form-group label { display: block; margin: 0 0 7px; color: #5c7162; font-size: 12px; }
.form-group input, .form-group select { width: 100%; }
.account-dialog { width: min(540px,95vw); }
#rateSettingsModal { width: min(860px,95vw); max-height: 88vh; overflow: auto; }
#rateSettingsModal th, #rateSettingsModal td { vertical-align: middle; }
#rateSettingsModal td:first-child { width: 38%; }
#rateSettingsModal td:nth-child(3) { min-width: 155px; }
#transactionDetailModal { width: min(850px,95vw); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 14px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 17px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.account-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.account-dialog td { overflow-wrap: anywhere; }
.account-dialog .modal-content { max-width: none!important; }
.card-generator-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-generator-heading strong { font-size: 15px; }
.card-generator-rate { font-size: 11px; color: var(--text-muted); }
.card-generator-fields { display: grid; grid-template-columns: 1fr 1fr 1.6fr auto; gap: 16px; align-items: end; }
.card-generator-fields .form-group { margin: 0; }
.card-generator-submit { min-height: 43px; }
.card-credit-options { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.card-credit-options-heading { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.card-credit-options-content { max-width: 670px; }
.card-credit-presets { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.card-credit-preset { display: flex; flex-direction: column; align-items: center; padding: 10px 5px; gap: 3px; }
.card-credit-preset-points { font-size: 12px; font-weight: 600; white-space: nowrap; }
.card-credit-preset-price { color: var(--text-muted); font-size: 11px; }
.card-credit-preset.is-selected { background: #eaf2e6; border-color: #648466; box-shadow: inset 0 0 0 1px #648466; }
#usersTable { min-width: 980px; }
#logsTable { min-width: 780px; }
#tasks .table-wrap { max-height: 68vh; }
#tasks th { position: sticky; top: 0; z-index: 1; }
#tasks td:first-child { min-width: 170px; }
@media(max-width:1100px) {
  main { padding: 28px 22px; }
  .card-generator-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .header-actions .admin-label { display: none; }
}
@media(max-width:700px) {
  #app { display: block; }
  .admin-sidebar { position: static; height: auto; min-height: 0; padding: 18px 15px 12px; }
  .brand { margin-bottom: 18px; }
  nav { display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 5px; }
  .nav-group { display: contents; }
  .nav-group>small, .nav-group button::before { display: none; }
  .nav-group button { flex: 0 0 auto; width: auto; padding: 9px 12px; white-space: nowrap; }
  .aside-bottom { position: absolute; top: 24px; right: 15px; padding: 0; }
  .console-footnote { display: none; }
  main { padding: 24px 15px; }
  header { align-items: flex-start; gap: 10px; }
  header h1 { font-size: 23px; }
  .header-actions button { padding: 8px; margin-top: 20px; }
  .account-panel .stats { gap: 8px; }
  .stat-card { padding: 13px 10px; }
  .stat-card .number { font-size: 21px; overflow-wrap: anywhere; }
  .stat-card h3 { font-size: 10px; }
  .toolbar .search-box { width: 100%; }
  .card-credit-presets { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-generator-fields { gap: 12px; }
  .card-generator-heading { align-items: flex-start; }
  .card-generator-rate { white-space: nowrap; }
  .account-dialog { padding: 18px; }
  .login-card { margin: 12vh 15px; }
}


/* 项目监控（管理员只读） */
.pm-filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; margin: 18px 0; }
.pm-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #5c7162; }
.pm-filters input, .pm-filters select { min-height: 34px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px; color: var(--text); }
.pm-filters input[type="date"] { width: 150px; }
.pm-filters button { min-height: 34px; }
.pm-summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0 14px; color: var(--text-muted); font-size: 12px; }
.pm-summary strong { color: var(--text); font-size: 15px; margin-left: 3px; }
.pm-type { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #eef4ef; color: #4b6a56; font-size: 11px; white-space: nowrap; }
.pm-preview { display: -webkit-box; max-width: none; color: #44574b; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.pm-badge-running { background: #e8f1fb; color: #35628c; }
.pm-badge-done { background: #eaf3e9; color: #426d50; }
.pm-badge-warn { background: #fcf8ef; color: #916a38; }
.pm-badge-idle { background: #f1f3f1; color: #6c7c70; }
#pmTable { width: 100%; min-width: 0; table-layout: fixed; }
#pmTable th, #pmTable td { vertical-align: middle; }
#pmTable td:nth-child(1), #pmTable td:nth-child(3), #pmTable td:nth-child(5),
#pmTable td:nth-child(6), #pmTable td:nth-child(7), #pmTable td:nth-child(8),
#pmTable td:nth-child(9) { white-space: nowrap; }
#pmTable td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
#pmTable td:nth-child(4) { min-width: 0; }
#pmTable td:nth-child(9) { font-variant-numeric: tabular-nums; font-size: 12px; }
#projectMonitor th { position: sticky; top: 0; z-index: 1; background: #fff; }
#projectMonitor tbody tr:hover { background: #f8fbf8; }
#projectMonitor .table-wrap { max-height: 70vh; overflow: auto; }
.pm-detail { display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none; color: #426881; font-size: 12px; line-height: 1.4; cursor: pointer; }
.pm-detail:hover { text-decoration: underline; }
#pmTable td.pm-expanded { vertical-align: top; }
#pmTable td.pm-expanded .pm-preview { display: block; -webkit-line-clamp: unset; overflow: visible; }
