:root {
  --ink: #102a2a;
  --ink-soft: #355052;
  --muted: #6a8284;
  --faint: #90a4a5;
  --brand: #2f8f7a;
  --brand-deep: #1f6e5f;
  --brand-soft: #e7f5f0;
  --navy: #0e2a30;
  --navy-soft: #15383f;
  --page: #f3f7f6;
  --card: #ffffff;
  --line: #e2ece9;
  --line-strong: #cadbd6;
  --danger: #b5524f;
  --danger-soft: #fbeceb;
  --warn: #a9761f;
  --warn-soft: #fbf3e2;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(14, 42, 48, 0.07);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 500px at 8% 0%, #17444a 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, #1d5b4f 0%, transparent 62%),
    var(--navy);
  position: relative;
  overflow: hidden;
}

.login-art { position: absolute; inset: 0; pointer-events: none; }
.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.orbit-a { width: 560px; height: 560px; left: -180px; top: -220px; }
.orbit-b { width: 760px; height: 760px; right: -300px; bottom: -380px; }
.dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #6fd2b8; opacity: 0.7; }
.dot-a { left: 18%; top: 26%; }
.dot-b { right: 22%; top: 18%; width: 7px; height: 7px; background: #f3c574; }
.dot-c { right: 32%; bottom: 22%; width: 5px; height: 5px; }

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 34px 32px 28px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
}

.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand strong { display: block; font-size: 16px; }
.login-brand small { color: var(--muted); font-size: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #43b39a, #1f6e5f);
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -1px;
  box-shadow: 0 8px 18px rgba(47, 143, 122, 0.3);
}

.login-card h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.4px; }
.login-sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.login-btn { width: 100%; margin-top: 6px; }
.login-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 13px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 143, 122, 0.13);
}
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.inline-field select,
.inline-field input {
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  outline: none;
}
.inline-field.grow { flex: 1; min-width: 180px; }
.inline-field.grow input { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.span-2 { grid-column: span 2; }
.form-hint { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- 按钮 ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #eef3f2;
  color: var(--ink-soft);
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary {
  background: linear-gradient(135deg, #37a189, #237764);
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 143, 122, 0.22);
}
.button.quiet { background: #fff; border: 1px solid var(--line-strong); }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.button.danger { background: var(--danger-soft); color: var(--danger); }
.link-button { border: 0; background: none; padding: 0; color: #8fb8ae; font-size: 13px; }
.link-button:hover { color: #fff; }

/* ---------- 框架 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: 100vh;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--navy) 0%, #102f35 100%);
  color: #d8e6e3;
  flex-shrink: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand strong { display: block; color: #fff; font-size: 14px; }
.sidebar-brand small { color: #8fb8ae; font-size: 11px; }
.sidebar-close { display: none; margin-left: auto; border: 0; background: none; color: #fff; font-size: 24px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b9cfca;
  text-align: left;
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.is-active { background: rgba(111, 210, 184, 0.16); color: #fff; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #5f8e85; }
.nav-item.is-active .nav-dot { background: #6fd2b8; box-shadow: 0 0 0 4px rgba(111, 210, 184, 0.15); }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d99a3d;
  color: #fff;
  font-size: 11px;
  text-align: center;
}
.sidebar-foot { margin-top: auto; padding: 18px 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-foot p { margin: 0 0 6px; color: #fff; font-size: 13px; }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.topbar-title { flex: 1; }
.topbar-title p { margin: 0 0 2px; color: var(--brand); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.topbar-title h1 { margin: 0; font-size: 26px; letter-spacing: -0.5px; }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-size: 18px; }

.alert {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #f0cfcb;
  border-radius: 12px;
  background: #fdf1ef;
  color: var(--danger);
  font-size: 13px;
}

/* ---------- 卡片 / 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.stat-label { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; }
.stat-value { margin: 0; font-size: 30px; font-weight: 750; letter-spacing: -1px; line-height: 1.2; }
.stat-note { margin: 6px 0 0; color: var(--faint); font-size: 12px; }

.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; }
.section-head h2 { margin: 0 0 4px; font-size: 17px; }
.section-head p { margin: 0; color: var(--muted); font-size: 12.5px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table th { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; background: #fafcfb; }
.table tbody tr:hover { background: #fafcfb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table .wrap { white-space: normal; min-width: 220px; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--faint); font-size: 11.5px; }
.empty-row td { padding: 36px 14px; color: var(--faint); text-align: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3f2;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.badge.ok { background: var(--brand-soft); color: var(--brand-deep); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #eef1f2; color: #6b7d80; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.pager-actions { display: flex; gap: 8px; }

/* ---------- 反馈 ---------- */
.feedback-list { display: flex; flex-direction: column; }
.feedback-item { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.feedback-product { color: var(--brand-deep); font-size: 12px; font-weight: 700; }
.feedback-meta { color: var(--faint); font-size: 12px; }
.feedback-content { margin: 0 0 8px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.feedback-reply { margin: 8px 0 0; padding: 10px 12px; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; background: #f7fbfa; color: var(--ink-soft); font-size: 12.5px; white-space: pre-wrap; }
.feedback-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.feedback-detail { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #f6faf9; color: var(--ink-soft); font-size: 13px; white-space: pre-wrap; }

/* ---------- 版本 ---------- */
.release-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 6px 22px 22px; }
.release-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfefd; }
.release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.release-head h3 { margin: 0; font-size: 15.5px; }
.release-version { color: var(--brand-deep); font-size: 12px; font-weight: 700; }
.release-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0 0 14px; }
.release-meta div { min-width: 0; }
.release-meta dt { color: var(--faint); font-size: 11px; }
.release-meta dd { margin: 1px 0 0; color: var(--ink-soft); font-size: 12.5px; word-break: break-all; }
.release-notes { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; white-space: pre-wrap; }
.release-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.release-foot small { color: var(--faint); font-size: 11px; }

/* ---------- 官网 ---------- */
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 6px 22px 22px; }
.site-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fcfefd; }
.site-card h3 { margin: 0 0 4px; font-size: 15.5px; }
.site-url { color: var(--muted); font-size: 12px; word-break: break-all; }
.site-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; }
.site-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 30, 34, 0.55);
  backdrop-filter: blur(2px);
}
.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.modal-card.wide { width: min(680px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #f1f5f4; font-size: 20px; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 40px));
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(14, 42, 48, 0.94);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}
.toast.error { background: rgba(150, 54, 50, 0.96); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-grid, .site-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.3);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main { padding: 20px 18px 40px; }
  .menu-btn { display: block; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 25px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .topbar-title h1 { font-size: 21px; }
  .section-head { flex-direction: column; }
  .toolbar { padding: 14px 16px; }
  .inline-field { width: 100%; }
  .inline-field select, .inline-field input { flex: 1; }
  .inline-field.grow { width: 100%; }
  .table th, .table td { padding: 10px 12px; }
  .pager { flex-direction: column; align-items: flex-start; }
  .release-grid, .site-grid { padding: 4px 16px 16px; }
  .feedback-item { padding: 16px; }
  .login-card { padding: 28px 22px 22px; }
}
