:root {
  --paper: #f4efe4;
  --card: #fffaf0;
  --ink: #20211f;
  --muted: #77746c;
  --line: #e2dbcb;
  --coral: #df604d;
  --coral-soft: #fbe7e1;
  --teal: #2f7d70;
  --sun: #e8bd4d;
  --dark: #20211f;
  --shadow: 0 18px 50px rgba(49, 42, 30, .08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 8% 0%, #fbf5e8 0, var(--paper) 42%, #efe8da 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #b33b2b; min-height: 20px; margin: 10px 0 0; }
code { background: #f1eadc; padding: 1px 5px; border-radius: 5px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(430px, 100%); padding: 34px; border-radius: 28px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand-dot {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: var(--dark); color: var(--sun); font-size: 23px; font-weight: 700;
}
.login-card h1 { margin: 18px 0 6px; font-size: 26px; letter-spacing: -.5px; }
.login-card form { margin-top: 24px; display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 600; color: #49463f; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fffdf8; color: var(--ink);
  border-radius: 12px; padding: 11px 12px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
textarea { resize: vertical; line-height: 1.55; }
button { font: inherit; cursor: pointer; }
.primary, .ghost, .danger, .link {
  border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700;
}
.primary { background: var(--coral); color: white; }
.primary:hover { filter: brightness(.96); }
.ghost { background: #f3ecdf; color: var(--ink); border: 1px solid var(--line); }
.ghost:hover { background: #ece3d2; }
.danger { background: #f7ded8; color: #a53121; }
.link { background: none; color: var(--muted); padding: 4px 8px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-card .hint { margin-top: 20px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 228px 1fr; }
.sidebar {
  background: #20211f; color: #f8f1e3; padding: 24px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; gap: 11px; align-items: center; padding: 0 8px 22px; }
.logo > span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #33352f; color: var(--sun); font-size: 19px; font-weight: 700; }
.logo b { display: block; font-size: 16px; letter-spacing: .2px; }
.logo small { color: #aaa594; font-size: 11px; }
nav { display: grid; gap: 5px; }
nav button {
  text-align: left; border: 0; background: transparent; color: #b9b3a4; padding: 11px 13px;
  border-radius: 11px; font-weight: 600;
}
nav button:hover { color: white; background: #2c2e29; }
nav button.active { color: #20211f; background: var(--sun); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 0; border-top: 1px solid #35372f; font-size: 12px; color: #b9b3a4; }
.side-foot .link { color: #b9b3a4; }

.main { padding: 28px 34px 50px; max-width: 1500px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.topbar h2 { margin: 0 0 4px; font-size: 25px; letter-spacing: -.5px; }
.topbar p { margin: 0; }
.status-dot { background: #e0efe9; color: #267061; padding: 7px 11px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 17px; box-shadow: 0 8px 24px #4b3d1c0a; }
.stat b { display: block; font-size: 28px; letter-spacing: -.8px; margin-bottom: 2px; }
.stat span { color: var(--muted); font-size: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin-bottom: 16px; box-shadow: 0 8px 26px #4b3d1c08; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.row .grow { flex: 1; min-width: 180px; }
.row label { flex: 0 0 auto; }
.check { display: flex; gap: 7px; align-items: center; padding-bottom: 11px; white-space: nowrap; }
.check input { width: auto; }
#packJson { width: 100%; min-height: 420px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; background: #292a26; color: #eee7d8; border-color: #3b3d36; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 8px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 9px; border-bottom: 1px solid #eee7d9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; border-radius: 100px; padding: 3px 8px; font-size: 11px; font-weight: 700; background: #ece5d7; color: #5b574e; }
.pill.ok { background: #dfeee8; color: #2b705f; }
.pill.warn { background: #f8e9c3; color: #7c5b10; }
.pill.bad { background: #f8dfd9; color: #973423; }
.post-list { display: grid; gap: 10px; }
.post { border: 1px solid var(--line); border-radius: 15px; padding: 13px; background: #fffdf8; }
.post-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.post p { margin: 0 0 9px; line-height: 1.6; white-space: pre-wrap; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--dark); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 20; max-width: 420px; }
.toast.bad { background: #9d3b2b; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; }
  nav { grid-template-columns: repeat(4, 1fr); }
  nav button { text-align: center; padding: 9px 5px; font-size: 12px; }
  .side-foot { display: none; }
  .main { padding: 20px 14px 40px; }
}
