:root {
  --side: 236px;
}

.admin-body { background: var(--bg-soft); }

.admin-shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------------------------------------------------- 侧栏 */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.95);
}
.side .brand { padding: 6px 10px 20px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.side-link.active {
  background: rgba(233, 185, 73, 0.12);
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(233, 185, 73, 0.22);
}
.side-link .dot-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(242, 104, 107, 0.2);
  color: #ffb0b2;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.side-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------- 主区 */

.admin-main { padding: clamp(20px, 4vw, 38px); min-width: 0; }
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.admin-top h1 { font-size: 24px; }
.admin-top p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }

.panel { display: none; }
.panel.active { display: block; animation: fade 0.2s ease; }

.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  padding: 22px;
  margin-bottom: 16px;
}
.panel-card h2 {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-card h2::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(var(--gold-soft), var(--gold-deep));
}
.panel-card .hint { color: var(--muted); font-size: 12px; margin-bottom: 14px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label, .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  border-color: rgba(233, 185, 73, 0.5);
  box-shadow: 0 0 0 3px rgba(233, 185, 73, 0.1);
}
.form-grid textarea { resize: vertical; min-height: 74px; line-height: 1.65; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.check input { width: auto; }

/* 重复项 */

.rep-list { display: grid; gap: 10px; }
.rep-row {
  position: relative;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: start;
}
.rep-row .wide { grid-column: 1 / -1; }
.rep-row .rep-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #6c7385;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.rep-row .rep-remove:hover { color: var(--red); border-color: rgba(242, 104, 107, 0.3); background: rgba(242, 104, 107, 0.1); }
.rep-row label { font-size: 11.5px; }
.rep-row input, .rep-row textarea, .rep-row select {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.rep-row textarea { min-height: 58px; resize: vertical; }
.rep-row .row-index {
  position: absolute;
  top: 8px;
  right: 38px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #566;
}

.add-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.add-btn:hover { border-color: rgba(233, 185, 73, 0.4); color: var(--gold-soft); }

.save-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 18, 0.92);
  backdrop-filter: blur(12px);
  margin-top: 8px;
}

/* 概览数据 */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ov-card {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}
.ov-card span { color: var(--muted); font-size: 12px; }
.ov-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 24px;
  color: var(--gold-soft);
  letter-spacing: -0.02em;
}

/* 表格操作 */

.table-wrap table td .btn { margin-right: 6px; margin-bottom: 4px; }
.tag { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* 上传区 */

.upload-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
}
.upload-box > label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.upload-box .input { margin-top: 6px; }
.file-drop {
  grid-column: 1 / -1;
  padding: 22px;
  border-radius: 12px;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.file-drop:hover, .file-drop.drag { border-color: rgba(233, 185, 73, 0.45); background: rgba(233, 185, 73, 0.05); }
.file-drop strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 13px; }

/* 登录页 */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, rgba(233, 185, 73, 0.1), transparent 60%), #06070a;
}
.login-card {
  width: min(400px, 100%);
  padding: 32px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #12141c, #0a0c12);
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side .brand { display: none; }
  .side-link { white-space: nowrap; }
  .side-foot { display: none; }
  .admin-main { padding: 18px 14px; }
  .save-bar { position: static; }
}
