:root {
  --bg: #07153d;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(214, 226, 255, 0.18);
  --text: #ffffff;
  --muted: #aebadb;
  --soft: #d7def4;
  --green: #56c44d;
  --blue: #69a6ff;
  --danger: #ff6b7a;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 24% -8%, rgba(106, 160, 255, 0.26), transparent 36%),
    radial-gradient(circle at 100% 12%, rgba(86, 196, 77, 0.16), transparent 28%),
    linear-gradient(180deg, #06143a 0%, #091a46 100%);
}

a { color: inherit; text-decoration: none; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  width: min(920px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 22, 65, 0.86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.login-art {
  min-height: 420px;
  padding: 44px;
  background:
    linear-gradient(135deg, rgba(80, 132, 255, 0.24), rgba(86, 196, 77, 0.14)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='560' viewBox='0 0 900 560'%3E%3Crect width='900' height='560' fill='%230b215e'/%3E%3Cpath d='M0 420h900v140H0z' fill='%230c7e78'/%3E%3Cpath d='M70 420 245 110l180 310z' fill='%230c6c54'/%3E%3Cpath d='M315 420 505 74l210 346z' fill='%2316a16d'/%3E%3Ccircle cx='680' cy='120' r='58' fill='%23ffd77a'/%3E%3Cpath d='M0 470h900' stroke='%2334c8d6' stroke-width='18'/%3E%3C/svg%3E") center/cover;
}

.login-art span, .topbar p, .stat-card span { color: var(--soft); font-size: 13px; letter-spacing: 0.04em; }
.login-art h1 { margin: 96px 0 12px; font-size: 40px; }
.login-art p { max-width: 360px; color: var(--soft); line-height: 1.8; }

.login-form { padding: 44px; background: rgba(5, 15, 46, 0.72); }
.login-form h2 { margin: 0 0 24px; font-size: 28px; }

label { display: grid; gap: 8px; color: var(--soft); font-size: 14px; }
input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

input[type="file"] {
  padding: 9px;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #d9e7ff;
  background: rgba(255, 255, 255, 0.1);
}

textarea { resize: vertical; }
select option { color: #101b3f; }

.login-form label + label { margin-top: 16px; }

.primary-button, .ghost-button, .actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button { color: #fff; background: linear-gradient(180deg, var(--green), #43ad3c); }
.ghost-button { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.login-form .primary-button { width: 100%; margin-top: 24px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(5, 15, 46, 0.7);
  backdrop-filter: blur(16px);
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 32px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(180deg, var(--blue), #376ee6); font-weight: 900; }
.brand small { display: block; margin-top: 4px; color: var(--muted); }

nav { display: grid; gap: 8px; }
nav a { padding: 13px 14px; border-radius: 12px; color: var(--soft); }
nav a.active, nav a:hover { color: #fff; background: var(--panel-strong); }

.main { margin-left: 248px; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: 30px; }
.admin-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--soft); background: var(--panel); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.stat-card { padding: 22px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 34px; }
.stat-card p { margin: 8px 0 0; color: var(--muted); }

.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 22px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 12px; border-bottom: 1px solid rgba(214, 226, 255, 0.12); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 600; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.color-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }
.inline-sort-cell {
  min-width: 72px;
  color: #d9e7ff;
  font-weight: 700;
  cursor: pointer;
}
.inline-sort-cell:hover {
  color: #ffffff;
  background: rgba(105, 166, 255, 0.08);
}
.inline-sort-form { margin: 0; }
.inline-sort-input {
  width: 76px;
  min-height: 32px;
  padding: 4px 8px;
  border-color: rgba(105, 166, 255, 0.72);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  background: rgba(105, 166, 255, 0.14);
}
.status { padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.status.on { color: #baffad; }
.status.off { color: #ffd0d5; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions a { color: #a9c8ff; }
.actions form { margin: 0; }
.actions button { min-height: 30px; color: #fff; background: rgba(255, 107, 122, 0.18); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.file-input { border-style: dashed; background: rgba(105, 166, 255, 0.08); }
.storage-note {
  padding: 14px 16px;
  border: 1px solid rgba(214, 226, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.storage-note strong { display: block; margin-bottom: 6px; }
.storage-note p { margin: 0; color: var(--soft); line-height: 1.7; }
.alert, .success { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; }
.alert { color: #ffd0d5; background: rgba(255, 107, 122, 0.12); }
.success { color: #baffad; background: rgba(86, 196, 77, 0.12); }

@media (max-width: 860px) {
  .login-card { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; }
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .stats-grid, .form-grid { grid-template-columns: 1fr; }
}
