:root { color-scheme: light; }
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: #fff; color: #252c29; font-size: 16px; }
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; background: #f4f7f5; border-bottom: 1px solid #dce3de; }
h1 { font-size: 24px; font-weight: 650; margin: 0; }
h2 { font-size: 20px; font-weight: 600; margin: 0; }
.header-account,.button-group,.section-heading,.list-heading,.list-title,.patch-footer,.dialog-header,.dialog-footer { display: flex; align-items: center; gap: 10px; }
.section-heading,.list-heading,.patch-footer,.dialog-header { justify-content: space-between; }
.header-account { font-size: 14px; }
.workspace { padding: 24px; }
.top-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding-bottom: 24px; border-bottom: 1px solid #dce3de; }
.section-heading { margin-bottom: 14px; min-height: 40px; }
.image-frame { height: 215px; background: #f8faf9; border: 1px solid #dce3de; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #69726d; }
.image-frame img { width: 100%; height: 100%; object-fit: contain; }
[hidden] { display: none !important; }
.patch-section textarea { height: 215px; resize: vertical; }
.patch-footer { margin-top: 10px; flex-wrap: wrap; }
.save-status { font-size: 14px; color: #69726d; margin: 8px 0 0; }
.save-status.success { color: #157443; }
.save-status.warning { color: #976207; }
.save-status.error { color: #b02a37; }
.list-section { margin-top: 24px; }
.list-heading { gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.list-title { flex-wrap: wrap; }
.record-count { color: #157443; background: #e8f3ec; padding: 3px 9px; border-radius: 4px; font-size: 14px; }
.list-title .save-status { margin: 0; }
.button-group { flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border-radius: 5px; font-size: 15px; white-space: normal; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.icon-button { width: 40px; height: 40px; min-width: 40px; padding: 8px; }
.table-container { width: 100%; overflow-x: auto; }
#serverTable { min-width: 1480px; font-size: 14px; margin-bottom: 0; }
.table thead th { background: #303b35; color: #fff; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.table td { vertical-align: middle; }
#serverTable td { min-width: 92px; max-width: 300px; white-space: pre-wrap; overflow-wrap: anywhere; }
#serverTable td:nth-child(1) { min-width: 132px; white-space: nowrap; }
#serverTable td:nth-child(2),#serverTable td:nth-child(10) { min-width: 180px; }
#serverTable td:nth-child(3) { min-width: 140px; }
#serverTable td:nth-child(4) { min-width: 175px; }
#serverTable td:nth-child(5) { min-width: 150px; white-space: nowrap; }
#serverTable td:nth-child(8) { min-width: 200px; }
#serverTable .row-actions { display: flex; gap: 6px; min-width: 90px; }
#serverTable .status-select { font-size: 14px; width: 170px; background-color: #fff; color: #252c29; }
.status-upgrading > td { background: #fff8e1; }
.status-rebooting > td { background: #eaf7fb; }
.status-updated > td { background: #eef9f0; }
.status-waiting_update > td { background: #fffbea; }
.status-waiting_reboot > td { background: #fff1f2; }
.status-user_paused > td,.status-hk_it_takeover > td { background: #f1f3f5; }
.empty-state { padding: 48px 16px; text-align: center; color: #69726d; background: #f8faf9; }
.alert { white-space: pre-wrap; overflow-wrap: anywhere; }
.app-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #dce3de; border-radius: 6px; overflow: auto; }
.wide-dialog { width: min(1000px, calc(100vw - 24px)); }
.app-dialog::backdrop { background: #0007; }
.dialog-header { padding: 16px 20px; border-bottom: 1px solid #dce3de; position: sticky; top: 0; background: #fff; z-index: 1; }
.dialog-body { padding: 20px; }
.dialog-footer { padding: 14px 20px; border-top: 1px solid #dce3de; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-label { font-size: 15px; }
.role-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.role-list label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.role-field { grid-column: 1 / -1; }
.required-label::after { content: ' *'; color: #b02a37; }
.preview-table { max-height: 360px; }
.preview-table table { min-width: 650px; }
.preview-options { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.preview-options label { display: flex; align-items: center; gap: 8px; }
.history-table { min-width: 620px; font-size: 14px; }
.login-page { min-height: 100dvh; display: grid; place-items: center; background: #f4f7f5; padding: 20px; }
.login-panel { width: min(420px,100%); padding: 32px; background: #fff; border: 1px solid #dce3de; border-radius: 6px; }
.login-panel h1 { font-size: 24px; margin-bottom: 28px; }
@media (max-width: 760px) {
  .app-header { padding: 14px 16px; align-items: flex-start; }
  .app-header h1 { font-size: 20px; max-width: 210px; }
  .header-account { gap: 5px; max-width: 140px; overflow-wrap: anywhere; }
  .workspace { padding: 16px; }
  .top-grid { grid-template-columns: 1fr; gap: 24px; }
  .image-frame { height: 180px; }
  .patch-section textarea { height: 155px; }
  .toolbar { gap: 7px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-header,.dialog-body,.dialog-footer { padding: 14px; }
  .role-list { grid-template-columns: 1fr; }
  .login-panel { padding: 24px; }
}
