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

/* ---------- 登录 ---------- */
.login-wrap { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.login-card {
  width: min(420px, 92vw); padding: 36px 32px; text-align: center;
  border-radius: 22px; border: 1px solid rgba(247,176,94,.28);
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.login-card h1 { margin: 14px 0 6px; font-size: 22px; letter-spacing: 2px; }
.login-card p { margin: 0 0 22px; font-size: 12.5px; color: var(--dim); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  width: 100%; padding: 12px 16px; border-radius: 12px; font-size: 14px;
  background: rgba(8,10,15,.72); border: 1px solid var(--line); color: var(--txt);
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: rgba(247,176,94,.6); box-shadow: 0 0 0 3px rgba(247,176,94,.12); }
.login-msg { min-height: 20px; margin-top: 10px; font-size: 12.5px; color: #f2a2a2; }
.back-link { display: inline-block; margin-top: 14px; font-size: 12.5px; color: var(--dim-2); text-decoration: none; }
.back-link:hover { color: var(--accent-2); }

/* ---------- 布局 ---------- */
.admin-shell { position: relative; z-index: 2; display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line-soft); background: rgba(8,10,14,.72);
  backdrop-filter: blur(16px); padding: 20px 16px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; }
.side-brand strong { display: block; font-size: 13.5px; }
.side-brand em { font-style: normal; font-size: 10.5px; letter-spacing: 2px; color: var(--dim-2); }
.side-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side-nav button {
  text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--dim); font-family: inherit;
  transition: .18s ease;
}
.side-nav button:hover { color: var(--txt); background: var(--panel); }
.side-nav button.active { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(247,176,94,.32); }
.side-foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.admin-main { padding: 26px 30px 80px; min-width: 0; }
.admin-topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(7,8,12,.96), rgba(7,8,12,.82));
  backdrop-filter: blur(12px);
}
.admin-topbar h2 { margin: 0 0 4px; font-size: 20px; }
.admin-topbar p { margin: 0; font-size: 12.5px; color: var(--dim); }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.save-state { font-size: 12px; color: var(--dim-2); }
.save-state.dirty { color: var(--accent); }

/* ---------- 表单 ---------- */
.panel { display: none; }
.panel.active { display: block; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--dim); letter-spacing: .4px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 13px; border-radius: 11px; font-size: 13.4px;
  background: rgba(8,10,15,.7); border: 1px solid var(--line); color: var(--txt);
  font-family: inherit; transition: border-color .2s ease;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: rgba(247,176,94,.6); box-shadow: 0 0 0 3px rgba(247,176,94,.1);
}
.field .hint { font-size: 11.2px; color: var(--dim-2); }

.group-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.group-title h3 { margin: 0; font-size: 15px; letter-spacing: .6px; }
.group-title span { font-size: 11.5px; color: var(--dim-2); }

.list-editor { display: flex; flex-direction: column; gap: 12px; }
.row-card {
  position: relative; padding: 18px 18px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line-soft);
}
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.row-head b { font-size: 13px; color: var(--accent-2); letter-spacing: 1px; }
.row-actions { display: flex; gap: 8px; }
.mini-btn {
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--dim); font-family: inherit;
}
.mini-btn:hover { color: var(--txt); border-color: rgba(247,176,94,.4); }
.mini-btn.danger:hover { color: #ffb4b4; border-color: rgba(255,120,120,.5); }
.add-row {
  align-self: flex-start; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); border: 1px dashed rgba(247,176,94,.5); color: var(--accent-2);
  font-size: 12.5px; font-family: inherit;
}
.add-row:hover { background: rgba(247,176,94,.22); }

/* ---------- 上传 ---------- */
.upload-box {
  margin-top: 18px; padding: 20px; border-radius: 16px;
  border: 1px dashed rgba(247,176,94,.4); background: rgba(247,176,94,.05);
}
.upload-box h3 { margin: 0 0 6px; font-size: 15px; }
.upload-box p { margin: 0 0 14px; font-size: 12.3px; color: var(--dim); }
.drop-zone {
  display: grid; place-items: center; gap: 8px; padding: 26px; border-radius: 12px;
  border: 1px dashed var(--line); background: rgba(8,10,15,.5); color: var(--dim); cursor: pointer;
  transition: .2s ease;
}
.drop-zone.hover { border-color: rgba(247,176,94,.6); background: rgba(247,176,94,.08); color: var(--txt); }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 12px; display: none; }
.progress.show { display: block; }
.progress i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s ease; }
.upload-log { margin-top: 10px; font-size: 12px; color: var(--dim-2); white-space: pre-wrap; }

.file-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }
.file-table th, .file-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.file-table th { color: var(--dim-2); font-weight: 500; font-size: 11.5px; letter-spacing: 1px; }
.file-table td a { color: var(--accent-2); text-decoration: none; word-break: break-all; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 18px 16px 70px; }
  .admin-topbar { position: static; flex-direction: column; }
}
