:root {
  color-scheme: light;
  --background: #eef2f7;
  --text: #1f2937;
  --muted: #64748b;
  --blue: #337ab7;
  --line: #d8e0e9;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
#operationFields { min-width: 0; margin: 0; padding: 0; border: 0; }
#operationFields:disabled .button, #operationFields:disabled .text-button { cursor: not-allowed; opacity: .55; }
input:disabled, select:disabled { color: #8793a4; background: #f6f8fb; }
.binding-notice { margin: 0 0 14px; padding: 9px 12px; color: #3c668b; background: #e2edf7; border: 1px solid #cbdfee; border-radius: 4px; font-size: 12px; }
a { color: #3177b2; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.page { width: min(780px, calc(100% - 28px)); margin: 24px auto 36px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.topbar h1 { font-size: 22px; line-height: 1.4; font-weight: 700; }
.topbar > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.gm-panel { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 1px 3px rgb(15 23 42 / 5%); scroll-margin-top: 70px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 10px 16px; border-bottom: 1px solid transparent; }
.panel-heading h2 { font-size: 15px; line-height: 21px; font-weight: 650; }
.heading-tag { font-size: 11px; font-weight: 400; opacity: .9; text-align: right; }
.panel-primary { border-color: #8ebce3; }
.panel-primary > .panel-heading { color: #fff; background: var(--blue); border-color: var(--blue); }
.panel-info { border-color: #bce8f1; }
.panel-info > .panel-heading { color: #31708f; background: #d9edf7; border-color: #bce8f1; }
.panel-success { border-color: #d6e9c6; }
.panel-success > .panel-heading { color: #3c763d; background: #dff0d8; border-color: #d6e9c6; }
.panel-danger { border-color: #ebccd1; }
.panel-danger > .panel-heading { color: #a94442; background: #f2dede; border-color: #ebccd1; }
.panel-warning { border-color: #f0d49a; }
.panel-warning > .panel-heading { color: #7a4f08; background: #fff4d6; border-color: #f0d49a; }
.panel-neutral > .panel-heading { color: #475569; background: #f7f9fc; border-color: #e4e9f0; }
.panel-body { padding: 16px; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field, label { min-width: 0; }
label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
input, select, .readonly-field { display: block; width: 100%; min-width: 0; min-height: 38px; margin-top: 6px; padding: 7px 11px; color: var(--text); background: #fff; border: 1px solid #cbd3dc; border-radius: 4px; font-size: 13px; font-weight: 400; line-height: 22px; }
input::placeholder { color: #94a3b8; opacity: 1; }
input:focus, select:focus { outline: 0; border-color: #66afe9; box-shadow: 0 0 0 3px rgb(66 139 202 / 12%); }
input[type="number"] { font-variant-numeric: tabular-nums; }
select { padding-right: 26px; }
option { color: var(--text); background: #fff; }
.readonly-field { margin-top: 0; background: #f1f4f8; color: #475569; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; max-width: 100%; padding: 7px 16px; color: #fff; border: 1px solid transparent; border-radius: 4px; font-size: 13px; font-weight: 500; line-height: 22px; transition: background .15s, box-shadow .15s; }
.button:hover { filter: brightness(.95); }
.button:focus-visible, .quick-links a:focus-visible, .text-button:focus-visible { outline: 3px solid #99c9ee; outline-offset: 3px; }
.button.primary { background: #337ab7; border-color: #2e6da4; }
.button.info { color: #173c49; background: #5bc0de; border-color: #46b8da; }
.button.warning { color: #5c3907; background: #f0ad4e; border-color: #eea236; }
.button.success { background: #398439; border-color: #327432; }
.button.danger { background: #d9534f; border-color: #d43f3a; }
.button.secondary { color: #475569; background: #fff; border-color: #cbd3dc; }
.wide { width: 100%; }
.text-button { padding: 0; color: #428bca; border: 0; background: transparent; font-size: 12px; }
.hint, .description { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.8; }
.hint { margin-top: 10px; }
.description { margin-bottom: 12px; }
.error { margin-bottom: 14px; padding: 9px 12px; color: #a94442; background: #fdf0f0; border: 1px solid #ebccd1; border-radius: 4px; font-size: 13px; }
.quick-links { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 0 0 18px; padding: 8px 0; border-bottom: 1px solid #d8e0e9; background: var(--background); }
.quick-links a { padding: 6px 4px; color: #52728f; border-radius: 4px; text-align: center; font-size: 12px; white-space: nowrap; }
.quick-links a:hover { color: #286090; background: #e0eaf4; }
.platform-grid .field { display: flex; flex-direction: column; }
.balance-field .readonly-field { margin-bottom: 14px; }
.platform-grid form label { margin-bottom: 14px; }
.resource-grid form[data-action="send_currency"] { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(160px, .7fr); gap: 14px; align-items: end; }
.resource-grid form[data-action="send_currency"] .hint { grid-column: 1 / -1; margin-top: 0; }
.inline-form { display: grid; grid-template-columns: minmax(0, 3fr) minmax(150px, 1fr); gap: 14px; align-items: end; }
.inline-form label { margin-bottom: 0; }
.energy-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.item-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e8edf3; }
.item-search-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.module-material-form { padding-top: 14px; }
.module-material-list { align-self: end; min-height: 38px; padding: 7px 11px; color: #52708b; background: #f5f8fb; border: 1px solid #d8e2eb; border-radius: 4px; font-size: 12px; line-height: 22px; }
.button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.switch-form { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-control { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 600; }
.switch-control input { width: 20px; min-height: 20px; margin: 0; accent-color: #f0ad4e; }
.cleanup-grid article { display: flex; flex-direction: column; min-width: 0; }
.cleanup-grid h3 { margin-bottom: 6px; color: #6f3334; font-size: 13px; font-weight: 600; }
.cleanup-grid .description { flex: 1; }
.activity .panel-body { padding-top: 6px; padding-bottom: 6px; }
.activity ol { list-style: none; max-height: 220px; overflow: auto; margin: 0; padding: 0; }
.activity li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: 12px; overflow-wrap: anywhere; }
.activity li:last-child { border-bottom: 0; }
.activity time { flex-shrink: 0; color: #94a3b8; font-variant-numeric: tabular-nums; }
.activity li.failed { color: #a94442; }
.activity li.empty { color: #94a3b8; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%); width: max-content; max-width: min(620px, calc(100% - 28px)); padding: 12px 18px; color: #31623c; background: #eff9ef; border: 1px solid #a8d5ad; border-radius: 6px; box-shadow: 0 5px 24px rgb(15 23 42 / 12%); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast.failed { color: #a94442; background: #fff0f0; border-color: #ebccd1; }
footer { margin-top: 20px; color: #7b8ba0; text-align: center; font-size: 12px; }
#loginForm .hint { text-align: center; }
@media (max-width: 600px) {
  .page { margin-top: 16px; width: calc(100% - 24px); }
  .topbar { gap: 8px; margin-bottom: 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar > span { font-size: 11px; }
  .gm-panel { margin-bottom: 14px; scroll-margin-top: 100px; }
  .panel-heading { padding: 10px 14px; }
  .panel-body { padding: 14px; }
  input, select, .readonly-field { min-height: 44px; padding: 10px 11px; font-size: 16px; line-height: 22px; }
  .button { min-height: 44px; padding: 10px 12px; font-size: 14px; }
  .two-columns, .role-grid, .inline-form, .item-search-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .resource-grid form[data-action="send_currency"] { grid-template-columns: minmax(0, 1fr); }
  .role-grid { gap: 14px; }
  .platform-grid, .resource-grid { gap: 18px; }
  .resource-grid form + form { padding-top: 16px; border-top: 1px solid #e8edf3; }
  .quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin-bottom: 14px; padding: 6px 0; }
  .quick-links a { padding: 7px 4px; }
  .item-form { margin-top: 16px; }
  .item-search-grid { gap: 0; }
  .module-material-list { min-height: 44px; margin-top: 6px; padding: 10px 11px; }
  .button-row { grid-template-columns: minmax(0, 1fr); }
  .switch-form { align-items: stretch; flex-direction: column; }
  .cleanup-grid { gap: 18px; }
  .cleanup-grid article + article { padding-top: 16px; border-top: 1px solid #f2e5e5; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .button { transition: none; } }
