* { box-sizing: border-box; }
body { margin: 0; background: #f3f5f7; color: #20242a; font: 13px/1.5 Arial, "Microsoft YaHei", sans-serif; }
.hidden { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; background: #eef2f6; }
.login-box { width: 340px; padding: 28px; background: #fff; border: 1px solid #e6e8eb; border-radius: 4px; box-shadow: 0 12px 28px rgba(24, 35, 52, .08); }
.login-box h1 { margin: 0 0 20px; font-size: 20px; font-weight: 600; }
.login-box label { display: block; margin: 10px 0 6px; color: #5f6670; }
.form-msg { min-height: 20px; color: #d23f31; }
.app-shell { min-height: 100vh; display: flex; }
.side { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 176px; overflow-y: auto; background: #202b3d; color: #d9e1ec; padding: 12px 0; }
.brand { height: 40px; padding: 8px 18px; color: #fff; font-size: 16px; font-weight: 600; }
.nav-item { display: block; width: 100%; height: 38px; padding: 0 18px; border: 0; background: transparent; color: #d9e1ec; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: #16a085; color: #fff; }
.main { flex: 1; min-width: 0; margin-left: 176px; }
.topbar { position: sticky; top: 0; z-index: 9; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: #fff; border-bottom: 1px solid #e7eaee; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.muted, .hint { color: #7c8490; }
.hint { margin-top: 8px; }
.page { display: none; padding: 14px 16px 28px; }
.page.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.metric { background: #fff; border: 1px solid #e6e8eb; border-radius: 4px; padding: 12px 14px; }
.metric span { display: block; color: #7c8490; }
.metric b { display: block; margin-top: 6px; font-size: 22px; }
.panel { max-width: 100%; overflow-x: auto; background: #fff; border: 1px solid #e6e8eb; border-radius: 4px; padding: 12px; margin-bottom: 12px; }
.panel-title { height: 30px; font-size: 15px; font-weight: 600; border-bottom: 1px solid #edf0f3; margin: -2px 0 12px; }
.compact-table { margin: 0; }
.compact-table th, .compact-table td { padding: 7px 8px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px 12px; }
.form-grid label, .textarea-grid label, .wide-label { display: grid; gap: 5px; color: #5f6670; }
.textarea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.layui-input, .layui-textarea, .layui-select { height: 32px; border: 1px solid #d9dee5; border-radius: 3px; padding: 5px 8px; }
.layui-textarea { height: auto; resize: vertical; }
.mono { font-family: Consolas, Monaco, monospace; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.inline-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.file-input { max-width: 240px; font-size: 12px; }
.preflight-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.preflight-summary span { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 8px; border-radius: 3px; border: 1px solid #e6e8eb; }
.tag-ok { color: #0f8f70; background: #edf9f5; }
.tag-warn { color: #99680d; background: #fff8e5; }
.tag-error { color: #c0392b; background: #fff1f0; }
.status-ok { color: #0f8f70; }
.status-warn { color: #99680d; }
.status-error { color: #c0392b; }
.log-box { height: calc(100vh - 140px); overflow: auto; background: #101820; color: #d8dee9; border-radius: 4px; padding: 10px; font-family: Consolas, Monaco, monospace; font-size: 12px; }
.log-line { white-space: pre-wrap; border-bottom: 1px solid rgba(255,255,255,.06); padding: 3px 0; }
.log-line .time { color: #8fa1b3; }
.log-line .level-error { color: #ff7875; }
.log-line .level-warn { color: #ffd666; }
.toast { position: fixed; right: 20px; top: 18px; max-width: 360px; padding: 10px 14px; border-radius: 4px; background: #202b3d; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 20; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); z-index: 30; }
.modal-card { width: 360px; background: #fff; border-radius: 4px; padding: 18px; }
.modal-card h2 { margin: 0 0 12px; font-size: 16px; }
.modal-card label { display: grid; gap: 6px; margin-bottom: 10px; }
.modal-copy { margin: 0 0 12px; color: #5f6670; line-height: 1.7; }
.check-row { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; color: #20242a !important; }
.check-row input { width: 14px; height: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #999; }
.status-online { background: #16a085; }
.status-offline { background: #d23f31; }
.status-pending { background: #f0ad4e; }
@media (max-width: 900px) {
  .side { width: 132px; }
  .main { margin-left: 132px; }
  .metric-grid, .form-grid, .textarea-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; min-height: 52px; align-items: flex-start; flex-direction: column; padding: 10px; gap: 8px; }
  .top-actions, .inline-actions { justify-content: flex-start; }
  .file-input { max-width: 100%; }
}
