/* =========================================================
   好想砍传奇 · 后台样式
   沿用前台设计语言：浅底 / 深色点缀 / 暗红强调 / 零阴影
   ========================================================= */

:root {
  --bg:        #f7f6f3;
  --white:     #ffffff;
  --dark:      #1c1a17;
  --dark-2:    #14120f;
  --red:       #b02a2a;
  --red-hover: #c93333;
  --gold:      #e0a94e;
  --green:     #6fbf85;
  --text:      #333333;
  --text-2:    #666666;
  --text-3:    #999999;
  --tx-dark:   #f0ead9;
  --tx-dark-2: #9d968a;
  --line:      #e8e5de;
  --line-dark: #33302a;
  --r-card:    10px;
  --r-btn:     6px;
  --wrap:      1000px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h2, h3 { font-weight: bold; line-height: 1.4; }
input, textarea, button { font-family: inherit; font-size: 14px; }
button { cursor: pointer; border: none; background: none; }

.adm-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ============ 顶部 ============ */
.adm-header {
  background: var(--dark);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 50;
}
.adm-header .adm-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}
.adm-brand { display: flex; align-items: center; gap: 12px; }
.adm-logo {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: bold;
  flex-shrink: 0;
}
.adm-brand-txt {
  color: var(--tx-dark);
  font-size: 16px;
  letter-spacing: 1px;
}
.adm-user { display: flex; align-items: center; gap: 16px; }
.adm-hello { font-size: 13px; color: var(--tx-dark-2); }
.adm-hello b { color: var(--gold); }
.adm-link { font-size: 13px; color: var(--gold); }
.adm-link:hover { color: #f2c775; }
.adm-btn-ghost {
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-btn);
  color: var(--tx-dark-2);
  transition: .2s;
}
.adm-btn-ghost:hover { border-color: var(--red); color: #fff; background: var(--red); }

/* ============ 登录 ============ */
.adm-login {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.login-box {
  width: 380px;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: var(--r-card);
  padding: 36px 32px 28px;
  text-align: center;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
}
.login-box h2 { font-size: 22px; color: var(--dark); letter-spacing: 2px; }
.login-sub { font-size: 13px; color: var(--text-3); margin-bottom: 26px; }
.login-box .adm-field { text-align: left; }
.login-msg {
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
  margin-top: 10px;
}
.login-tip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
}
.login-tip b { color: var(--red); }

/* ============ 标签页 ============ */
.adm-main { padding: 26px 0 80px; }
.adm-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.adm-tab {
  padding: 10px 20px;
  font-size: 15px;
  color: var(--text-2);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: .2s;
}
.adm-tab:hover { color: var(--red); }
.adm-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: bold;
}

.adm-panel { display: none; }
.adm-panel.active { display: block; }

/* ============ 卡片 ============ */
.adm-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px 26px;
  margin-bottom: 16px;
}
.adm-card h3 {
  font-size: 17px;
  color: var(--dark);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-card h3::before {
  content: "";
  width: 3px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}
.adm-hint {
  font-size: 13px;
  color: var(--text-3);
  margin: -8px 0 18px;
  line-height: 1.7;
}

/* ============ 表单 ============ */
.adm-field { margin-bottom: 18px; }
.adm-field label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 7px;
  font-weight: bold;
}
.adm-field input[type="text"],
.adm-field input[type="password"],
.adm-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: #fdfdfc;
  color: var(--text);
  transition: border-color .2s, background .2s;
  line-height: 1.6;
}
.adm-field input:focus,
.adm-field textarea:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
}
.adm-field textarea { resize: vertical; font-family: inherit; }
.adm-field-tip {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}

/* 开关行 */
.adm-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.adm-switch-row:last-child { border-bottom: none; padding-bottom: 0; }
.adm-switch-row > div label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 2px;
}
.adm-switch-desc {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute;
  inset: 0;
  background: #d8d5cd;
  border-radius: 26px;
  transition: background .2s;
  cursor: pointer;
}
.switch i::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::before { transform: translateX(22px); }

/* ============ 按钮 ============ */
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--r-btn);
  font-size: 14px;
  font-weight: bold;
  border: 1px solid var(--red);
  color: var(--red);
  background: transparent;
  transition: .2s;
}
.btn:hover { background: var(--red); color: #fff; }
.btn-solid { background: var(--red); color: #fff; }
.btn-solid:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-block { width: 100%; padding: 11px 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ 二维码上传 ============ */
.adm-uploader {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.adm-qr-preview {
  position: relative;
  width: 220px;
  height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  background: #fbfaf8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.adm-qr-preview:hover,
.adm-qr-preview.dragover {
  border-color: var(--red);
  background: #fff;
}
.adm-qr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
.adm-qr-empty {
  text-align: center;
  color: var(--text-3);
  padding: 20px;
}
.adm-qr-empty b { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.adm-qr-empty span { font-size: 12px; }
.adm-qr-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .88);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--red);
  font-weight: bold;
}
.adm-qr-loading.on { display: flex; }

.adm-upload-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.adm-upload-side .btn { min-width: 130px; text-align: center; }
.adm-tip {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.9;
  margin-top: 4px;
}

/* ============ 版本选择编辑器 ============ */
.ver-edit {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: #fdfdfc;
  padding: 18px 20px 20px;
  margin-bottom: 14px;
}
.ver-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.ver-edit-head b { font-size: 15px; color: var(--dark); }
.ver-edit-head-btns { display: flex; align-items: center; gap: 8px; }
.ver-hide {
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  transition: .2s;
}
.ver-hide:hover { border-color: #e0a94e; color: #a97c1f; background: #fdf7ec; }
.ver-hidden-badge {
  font-style: normal;
  font-size: 11px;
  color: #a97c1f;
  background: #fdf3dd;
  border: 1px solid #ecd9ae;
  border-radius: 4px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.ver-edit.is-hidden { background: #faf9f6; }
.ver-edit.is-hidden .ver-edit-head b { color: #999; }
/* 颜色设置行 */
.ver-edit-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 10px 12px;
  background: #fbfaf8;
  border: 1px dashed var(--line);
  border-radius: 6px;
  margin-bottom: 14px;
}
.ver-color-item { display: inline-flex; align-items: center; gap: 7px; }
.ver-color-item label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ver-color-item input[type="color"] {
  width: 34px;
  height: 26px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
.ver-color-clear {
  font-size: 11px;
  color: var(--text-3);
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: underline;
}
.ver-color-clear:hover { color: var(--red); }
/* 品牌头像上传（小号预览） */
.adm-uploader-sm { grid-template-columns: 120px 1fr; gap: 18px; }
.adm-avatar-preview {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.adm-avatar-preview:hover,
.adm-avatar-preview.dragover { border-color: var(--red); background: #fff; }
.adm-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: none; }
.adm-avatar-preview .adm-qr-loading { display: none; }
.adm-avatar-preview.uploading .adm-qr-loading { display: flex; }
.ver-del {
  font-size: 12px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 10px;
  transition: .2s;
}
.ver-del:hover { border-color: var(--red); color: var(--red); }
.ver-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 18px;
}
.ver-edit-grid .adm-field { margin-bottom: 12px; }
.ver-edit-upload {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 4px;
}
.ver-edit-pic {
  position: relative;
  width: 132px;
  height: 92px;
  flex-shrink: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s;
}
.ver-edit-pic:hover { border-color: var(--red); }
.ver-edit-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ver-edit-pic-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}
.ver-edit-pic-loading {
  font-size: 13px;
  color: var(--red);
  font-weight: bold;
}
.ver-edit-upload-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ============ 部署信息 ============ */
.adm-info-list { display: grid; gap: 10px; }
.adm-info-list div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.adm-info-list div:last-child { border-bottom: none; }
.adm-info-list span { color: var(--text-3); width: 80px; flex-shrink: 0; }
.adm-info-list code {
  font-family: Consolas, Monaco, monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--red);
}

/* ============ 保存条 ============ */
.adm-savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-top: 8px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(247, 246, 243, 0));
}
.adm-save-state { font-size: 13px; color: var(--green); }
.adm-save-state.err { color: var(--red); }
.adm-save-state.busy { color: var(--text-3); }

/* ============ 提示 ============ */
.adm-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(14px);
  background: var(--dark);
  color: var(--gold);
  border: 1px solid var(--line-dark);
  padding: 10px 24px;
  border-radius: var(--r-btn);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 200;
  white-space: nowrap;
}
.adm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .adm-header .adm-wrap { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .adm-brand-txt { font-size: 14px; }
  .adm-user { gap: 10px; }
  .adm-hello { display: none; }
  .adm-tab { padding: 10px 12px; font-size: 14px; }
  .adm-card { padding: 18px 16px; }
  .adm-uploader { grid-template-columns: 1fr; }
  .adm-qr-preview { width: 100%; max-width: 240px; height: 240px; margin: 0 auto; }
  .adm-upload-side { align-items: stretch; }
  .adm-upload-side .btn { width: 100%; }
  .adm-savebar { flex-wrap: wrap; }
  .adm-savebar .btn { flex: 1; text-align: center; }
  .ver-edit-grid { grid-template-columns: 1fr; gap: 0; }
  .ver-edit-upload { flex-direction: column; align-items: flex-start; }
  .adm-uploader-sm { grid-template-columns: 1fr; }
  .adm-avatar-preview { width: 100%; max-width: 160px; height: 160px; margin: 0 auto; }
  .ver-edit-colors { flex-direction: column; }
}
