/* 后台管理样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  background: #0b1020; color: #e8edf6; min-height: 100vh; padding: 24px;
}
a { color: #60a5fa; }

/* 登录 */
.login-wrap { max-width: 360px; margin: 12vh auto; background: #121a2e; border: 1px solid #233; border-radius: 16px; padding: 34px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-wrap h1 { font-size: 20px; margin-bottom: 6px; }
.login-wrap p { color: #93a1b8; font-size: 13px; margin-bottom: 22px; }
.login-wrap input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #2a3650; background: #0d1424; color: #fff; font-size: 14px; }
.login-wrap input:focus { outline: none; border-color: #3b82f6; }
.login-wrap button { width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 10px; background: linear-gradient(120deg,#3b82f6,#8b5cf6); color: #fff; font-weight: 700; cursor: pointer; }
.login-err { color: #f87171; font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-hint { font-size: 12px; color: #64748b; margin-top: 14px; }

/* 布局 */
.admin { display: grid; grid-template-columns: 200px 1fr; gap: 22px; max-width: 1200px; margin: 0 auto; }
.sidebar { background: #121a2e; border: 1px solid #233; border-radius: 16px; padding: 18px; height: fit-content; position: sticky; top: 24px; }
.sidebar .brand { font-family: monospace; font-weight: 800; letter-spacing: 1px; margin-bottom: 18px; }
.sidebar .brand span { color: #3b82f6; }
.sidebar button.tab { display: block; width: 100%; text-align: left; padding: 11px 13px; border: 0; border-radius: 10px; background: transparent; color: #93a1b8; font-size: 14px; cursor: pointer; margin-bottom: 4px; transition: .2s; }
.sidebar button.tab:hover { background: #1a2440; color: #fff; }
.sidebar button.tab.active { background: linear-gradient(120deg,#3b82f6,#8b5cf6); color: #fff; }
.sidebar .side-foot { margin-top: 16px; border-top: 1px solid #233; padding-top: 14px; display: grid; gap: 8px; }
.sidebar .side-foot a, .sidebar .side-foot button { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: #1a2440; border: 0; color: #cbd5e1; cursor: pointer; text-align: center; text-decoration: none; }
.sidebar .side-foot a:hover, .sidebar .side-foot button:hover { background: #243152; }

.panel { background: #121a2e; border: 1px solid #233; border-radius: 16px; padding: 26px; }
.panel h2 { font-size: 18px; margin-bottom: 4px; }
.panel .sub { color: #93a1b8; font-size: 13px; margin-bottom: 22px; }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #93a1b8; margin-bottom: 7px; }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid #2a3650; background: #0d1424; color: #fff; font-size: 14px; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #3b82f6; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.img-settings label { display: block; font-size: 13px; color: #93a1b8; margin-bottom: 7px; }
@media (max-width: 620px) { .row2, .row4 { grid-template-columns: 1fr; } .admin { grid-template-columns: 1fr; } .sidebar { position: static; } }

/* 列表项卡片 */
.item-card { background: #0d1424; border: 1px solid #233; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.item-card .ic-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.item-card .ic-head b { font-size: 13px; color: #60a5fa; font-family: monospace; }
.btn-sm { padding: 6px 12px; border-radius: 8px; border: 1px solid #2a3650; background: #1a2440; color: #cbd5e1; font-size: 12px; cursor: pointer; }
.btn-sm.danger { color: #f87171; border-color: #4a2330; }
.btn-sm.danger:hover { background: #2a1620; }
.btn-add { padding: 10px 16px; border-radius: 10px; border: 1px dashed #3b82f6; background: rgba(59,130,246,.1); color: #60a5fa; font-size: 13px; cursor: pointer; margin-bottom: 18px; }

/* 上传 */
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid #2a3650; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs .t { position: relative; }
.thumbs .t button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #ef4444; color: #fff; font-size: 11px; cursor: pointer; }
input[type=file] { font-size: 12px; color: #93a1b8; }

/* 保存条 */
.savebar { position: sticky; bottom: 0; display: flex; gap: 12px; justify-content: flex-end; align-items: center; margin-top: 10px; padding: 14px 0 4px; border-top: 1px solid #233; }
.savebar .status { margin-right: auto; font-size: 13px; color: #34d399; min-height: 18px; }
.btn-save { padding: 12px 26px; border: 0; border-radius: 10px; background: linear-gradient(120deg,#3b82f6,#8b5cf6); color: #fff; font-weight: 700; cursor: pointer; }
.btn-save:disabled { opacity: .6; cursor: default; }
.btn-revert { padding: 12px 22px; border: 1px solid #2a3650; border-radius: 10px; background: #1a2440; color: #cbd5e1; font-weight: 600; cursor: pointer; }
.btn-revert:hover { background: #243152; color: #fff; }

/* 颜色/主题 */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.swatch.active { border-color: #fff; }
.mode-toggle { display: flex; gap: 10px; }
.mode-toggle button { padding: 10px 18px; border-radius: 10px; border: 1px solid #2a3650; background: #0d1424; color: #93a1b8; cursor: pointer; }
.mode-toggle button.active { border-color: #3b82f6; color: #fff; background: #1a2440; }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #34d399; color: #06281c; padding: 12px 22px; border-radius: 10px; font-weight: 700; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; }
