/* ============================================================
   MCDownloader 管理后台 —— Minecraft 像素风
   ============================================================ */
:root {
  --bg: #0d1117;
  --panel: #141c26;
  --panel-2: #1a2430;
  --line: #2a3542;
  --line-strong: #3b4a5a;
  --text: #e9e7da;
  --dim: #a8b2bd;
  --faint: #6c7885;
  --grass: #6ecf3c;
  --diamond: #3dd8e0;
  --diamond-dark: #1f9fae;
  --gold: #f6c945;
  --redstone: #e5483c;
  --ink: #000;
  --radius: 4px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --pixel: "Courier New", Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--diamond); text-decoration: none; }
::selection { background: rgba(61,216,224,.3); }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-thumb { background: #3b4a5a; border: 3px solid var(--bg); }

/* ---------- 登录页 ---------- */
#loginPage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(800px 500px at 20% 0%, rgba(110,207,60,.1), transparent 55%),
              radial-gradient(800px 500px at 100% 100%, rgba(61,216,224,.12), transparent 55%),
              linear-gradient(180deg, var(--bg), #101820);
}
.login-box {
  width: min(400px, 92%); background: var(--panel); border: 4px solid var(--line-strong);
  padding: 38px 32px; box-shadow: 10px 10px 0 rgba(0,0,0,.6);
}
.login-box .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-box .logo img { width: 42px; height: 42px; image-rendering: pixelated; border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.login-box .logo b { font-size: 21px; letter-spacing: 1px; }
.login-box .logo .grad { color: var(--diamond); text-shadow: 2px 2px 0 rgba(0,0,0,.9); }
.login-box .sub { color: var(--dim); font-size: 13px; margin-bottom: 26px; }
.login-box label { display: block; font-size: 13px; color: var(--dim); margin: 15px 0 7px; font-weight: 700; }
.login-box input {
  width: 100%; padding: 13px 14px; border: 3px solid var(--line-strong);
  background: #0a0f15; color: var(--text); font-size: 15px; outline: none;
  transition: border-color .15s; font-family: var(--font);
}
.login-box input:focus { border-color: var(--diamond); }
.login-box button {
  width: 100%; margin-top: 24px; padding: 14px; border: 3px solid var(--ink); cursor: pointer;
  background: var(--diamond); color: #03282c; font-size: 15px; font-weight: 800;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s; font-family: var(--font);
}
.login-box button:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); }
.login-box button:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.login-box .err { color: #ff9b93; font-size: 13px; margin-top: 14px; display: none; font-weight: 700; }
.login-box .tip { color: var(--faint); font-size: 11.5px; margin-top: 18px; text-align: center; }

/* ---------- 主布局 ---------- */
#adminPage { display: none; min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 230px;
  background: var(--panel); border-right: 4px solid var(--line);
  padding: 20px 16px; display: flex; flex-direction: column;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar .logo img { width: 36px; height: 36px; image-rendering: pixelated; border: 3px solid var(--ink); }
.sidebar .logo b { font-size: 17px; }
.sidebar .logo .grad { color: var(--diamond); text-shadow: 2px 2px 0 rgba(0,0,0,.9); }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu button {
  text-align: left; padding: 12px 15px; border: 3px solid transparent; cursor: pointer;
  background: transparent; color: var(--dim); font-size: 14.5px; font-weight: 700; font-family: var(--font);
  transition: background .15s, color .15s, border-color .15s;
}
.menu button:hover { background: rgba(255,255,255,.05); color: var(--text); }
.menu button.active { background: #16333a; color: var(--diamond); border-color: var(--diamond-dark); box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.sidebar .foot a, .sidebar .foot button {
  display: block; width: 100%; text-align: left; padding: 11px 15px; border: 3px solid transparent;
  background: transparent; color: var(--dim); font-size: 13.5px; cursor: pointer; font-family: var(--font); font-weight: 700;
}
.sidebar .foot a:hover, .sidebar .foot button:hover { color: var(--text); background: rgba(255,255,255,.05); }

.main { margin-left: 230px; padding: 30px clamp(20px, 4vw, 48px); }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 26px; font-weight: 900; letter-spacing: 1px; text-shadow: 2px 2px 0 rgba(0,0,0,.8); }
.page-head p { color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.section-panel { display: none; }
.section-panel.active { display: block; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--panel); border: 3px solid var(--line); padding: 22px; box-shadow: 6px 6px 0 rgba(0,0,0,.55); }
.stat-card .n {
  font-size: 34px; font-weight: 900; color: var(--diamond); font-family: var(--pixel);
  text-shadow: 3px 3px 0 rgba(0,0,0,.9);
}
.stat-card .l { font-size: 12.5px; color: var(--faint); margin-top: 4px; font-weight: 700; }

/* 面板 */
.panel { background: var(--panel); border: 3px solid var(--line); padding: 24px; margin-bottom: 22px; box-shadow: 6px 6px 0 rgba(0,0,0,.5); }
.panel h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; letter-spacing: .5px; }
.panel .desc { color: var(--dim); font-size: 13px; margin-bottom: 14px; line-height: 1.8; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 2px solid var(--line); }
th { color: var(--faint); font-weight: 700; font-size: 12px; letter-spacing: .5px; }
td { color: var(--text); }
tr:hover td { background: rgba(255,255,255,.03); }
.code { font-family: var(--pixel); font-size: 12.5px; color: var(--diamond); }
.tag { display: inline-block; padding: 3px 10px; border: 2px solid var(--ink); font-size: 11.5px; font-weight: 800; box-shadow: 2px 2px 0 rgba(0,0,0,.4); }
.tag.normal { color: #cfe8ff; background: #1e3a5f; }
.tag.permanent { color: #e6d9ff; background: #3b2a63; }
.tag.special { color: #fff3c4; background: #5f4a16; }
.tag.on { color: #06150a; background: var(--grass); }
.tag.off { color: #fff; background: var(--redstone); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 17px; border: 3px solid var(--ink);
  cursor: pointer; font-size: 13.5px; font-weight: 800; color: #fff; font-family: var(--font);
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, filter .12s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: #1f9fae; color: #03282c; }
.btn-green { background: var(--grass); color: #06150a; }
.btn-danger { background: var(--redstone); color: #fff; }
.btn-ghost { background: #1a2430; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; box-shadow: 0 3px 0 var(--ink); }
.btn:hover { filter: brightness(1.08); }

/* 表单 */
.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; align-items: flex-end; }
.form-field { flex: 1; min-width: 200px; }
.form-field label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 7px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 11px 13px; border: 3px solid var(--line-strong);
  background: #0a0f15; color: var(--text); font-size: 14px; outline: none; font-family: var(--font);
  transition: border-color .15s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--diamond); }
.form-field textarea { resize: vertical; min-height: 70px; }
.form-field select option { background: var(--bg-2, #101820); }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px); z-index: 300;
  background: #101820; color: #e9e7da; padding: 13px 24px; border: 3px solid var(--line-strong);
  box-shadow: 5px 5px 0 rgba(0,0,0,.6); font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .3s, transform .3s;
}

@media (max-width: 820px) {
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .main { margin-left: 0; }
}
