:root {
  color: #17211b;
  background: #f2f5f1;
  font-family: Inter, "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #17211b;
  --muted: #657168;
  --line: #d7ded8;
  --surface: #ffffff;
  --surface-soft: #f7f9f6;
  --brand: #176b46;
  --brand-soft: #e6f2eb;
  --danger: #a5342f;
  --warn: #8a5b16;
  --shadow: 0 16px 40px rgba(20, 40, 28, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); }
.login-intro { padding: clamp(48px, 8vw, 120px); display: flex; flex-direction: column; justify-content: space-between; background: #173d2d; color: white; }
.login-intro__mark { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.login-intro h2 { max-width: 640px; margin: 0; font-size: clamp(36px, 5vw, 68px); line-height: 1.08; letter-spacing: -.04em; }
.login-intro p { max-width: 560px; margin: 24px 0 0; color: #cde0d5; line-height: 1.75; }
.login-panel { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-card { width: min(100%, 390px); }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-card h1 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 34px; color: var(--muted); line-height: 1.7; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; color: var(--ink); background: var(--surface-soft); outline: none; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 107, 70, .12); }
.button { border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; font-weight: 750; transition: .15s ease; }
.button--primary { width: 100%; margin-top: 18px; color: white; background: var(--brand); }
.button--primary:hover { background: #0d5737; }
.button--quiet { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button--danger { color: var(--danger); border-color: #edc8c5; background: #fff8f7; }
.form-error { min-height: 24px; margin: 12px 0 0; color: var(--danger); font-size: 14px; }
.privacy-note { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.6; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; color: #e7f0eb; background: #173d2d; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 28px; font-weight: 800; letter-spacing: -.02em; }
.brand__logo { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: #173d2d; background: #bbdfc9; }
.nav { display: grid; gap: 5px; }
.nav a { padding: 11px 12px; border-radius: 7px; color: #bfd3c7; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav a[aria-current="page"], .nav a:hover { color: white; background: rgba(255,255,255,.1); }
.sidebar__foot { position: absolute; left: 18px; right: 18px; bottom: 20px; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar__foot span { display: block; overflow: hidden; color: white; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__foot small { color: #a9c0b3; }
.content { min-width: 0; padding: 28px clamp(22px, 4vw, 58px) 50px; }
.topbar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.breadcrumb { color: var(--muted); font-size: 14px; }
.user-actions { display: flex; align-items: center; gap: 10px; }
.user-pill { max-width: 230px; overflow: hidden; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { margin: 3px 0 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
.page-head p { max-width: 660px; margin: 8px 0 0; color: var(--muted); line-height: 1.65; }
.warning { margin: 0 0 22px; padding: 13px 16px; border: 1px solid #ead7b8; border-left: 4px solid #b4771d; border-radius: 7px; color: #6e4915; background: #fffaf0; font-size: 14px; line-height: 1.6; }
.app-grid, .server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.app-card, .server-card { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.app-card { display: block; padding: 24px; color: inherit; text-decoration: none; }
.app-card:hover { border-color: #9ab7a7; transform: translateY(-1px); }
.app-card__tag { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.app-card h2 { margin: 12px 0 7px; font-size: 20px; }
.app-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.server-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.server-card h2 { margin: 3px 0 0; font-size: 21px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--brand); font-size: 13px; font-weight: 750; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--down { color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.metric { padding: 15px 18px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 16px; }
.details { padding: 18px 22px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 13px; }
.detail-row span:first-child { color: var(--muted); }
.detail-row span:last-child { overflow: hidden; font-weight: 650; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.operators { padding-top: 13px; border-top: 1px solid var(--line); margin-top: 10px; }
.operators__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.operator { padding: 4px 8px; border-radius: 5px; color: #435047; background: var(--surface-soft); font-size: 12px; }
.server-actions { display:flex; justify-content:flex-end; margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.confirm-dialog { width:min(520px, calc(100vw - 28px)); border:1px solid var(--line); border-radius:12px; padding:26px; color:var(--ink); background:var(--surface); box-shadow:0 30px 80px rgba(12,30,18,.28); }
.confirm-dialog::backdrop { background:rgba(11,26,17,.5); }
.confirm-dialog h2 { margin:8px 0; }
.confirm-dialog p { color:var(--muted); line-height:1.6; }
.confirm-dialog .field { margin-top:14px; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.toast { position:fixed; z-index:20; right:24px; bottom:24px; padding:13px 17px; border-radius:8px; color:white; background:#173d2d; box-shadow:var(--shadow); font-weight:700; }
.audit-section { margin-top:28px; }
.section-head h2 { margin:5px 0 14px; font-size:22px; }
.audit-list { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--surface); }
.audit-row { display:grid; grid-template-columns:54px minmax(0,1fr) auto; gap:14px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line); font-size:13px; }
.audit-row:last-child { border-bottom:0; }
.audit-row small { display:block; margin-top:3px; color:var(--muted); }
.audit-row time { color:var(--muted); font-size:12px; white-space:nowrap; }
.audit-result { color:var(--brand); font-weight:800; }
.audit-result--failed { color:var(--danger); }
.empty { padding: 42px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-intro { display: none; }
  .login-panel { min-height: 100vh; }
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand__text, .nav span, .sidebar__foot { display: none; }
  .nav a { text-align: center; }
  .server-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { position: static; display: flex; width: 100%; height: auto; align-items: center; justify-content: space-between; padding: 10px 14px; }
  .brand { padding: 0; }
  .nav { display: flex; }
  .nav a { padding: 9px 10px; }
  .content { padding: 20px 15px 36px; }
  .topbar { margin-bottom: 22px; }
  .user-pill { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .app-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
}
