/* admin.css - 参考 yihaozuan.com 云金价后台登录页风格，酒红色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #5a0e12;
  --bg-dark: #3a0709;
  --bg-light: #7b1113;
  --gold: #f4d07c;
  --red: #ff3333;
  --red-btn: #e74c3c;
  --red-btn-d: #c0392b;
  --text: #f4d07c;
  --text2: #e8c0c2;
  --text3: #b8888a;
  --white: #fff;
  --line: #a02a2e;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Consolas", monospace;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); }

/* ===== 登录页 ===== */
.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 20px 30px;
  background: linear-gradient(180deg, #7b1113 0%, #5a0e12 45%, #3a0709 100%);
}

.login__hero {
  text-align: center;
  margin-bottom: 24px;
}
.login__logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,.2);
  margin: 0 auto 14px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login__logo img { width: 90%; height: 90%; object-fit: contain; }
.login__hero h2 { font-size: 22px; color: var(--gold); letter-spacing: 3px; margin-bottom: 8px; }
.login__hero p { font-size: 13px; color: var(--text2); }

.login__card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  backdrop-filter: blur(4px);
}
.login__card .input {
  width: 100%;
  height: 46px;
  border: 1px solid #d9d9d9;
  border-radius: 24px;
  padding: 0 18px;
  font-size: 14px;
  background: var(--white);
  color: #333;
  outline: none;
  margin-bottom: 16px;
}
.login__card .input:focus { border-color: var(--red-btn); }

.btn--login {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 24px;
  background: var(--red-btn);
  color: var(--white);
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
  transition: background .2s;
}
.btn--login:hover { background: var(--red-btn-d); }

.login__err { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 10px; text-align: center; }

.login__footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.8;
}
.login__footer p:first-child { color: var(--red-btn); font-size: 14px; }

/* ===== 通用控件 ===== */
.input, textarea.input, select {
  background: var(--bg-dark);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.input:focus, select:focus { border-color: var(--gold); }
textarea.input { resize: vertical; }

.btn {
  background: var(--bg-light);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn--primary { background: var(--red-btn); border-color: var(--red-btn); color: var(--white); font-weight: 700; }
.btn--primary:hover { background: var(--red-btn-d); border-color: var(--red-btn-d); color: var(--white); }
.btn--ghost { background: transparent; }
.badge { font-size: 12px; color: var(--text2); background: var(--bg-dark); border: 1px solid var(--line); padding: 3px 10px; border-radius: 10px; }
.help { font-size: 11px; color: var(--text3); margin-right: auto; }
.note { font-size: 11px; color: var(--text2); line-height: 1.7; margin-top: 8px; background: var(--bg-dark); padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); }

/* ===== 管理面板 ===== */
.app { display: flex; flex-direction: column; min-height: 100vh; position: relative; }
/* 数据加载中遮罩 */
.app-loading {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: rgba(26,12,14,.85); color: var(--gold);
  font-size: 15px; letter-spacing: 1px;
  transition: opacity .25s ease;
}
.app-loading.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border-light);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 12px;
}
.topbar__left { display: flex; align-items: center; gap: 14px; }
.topbar__left h1 { font-size: 18px; color: var(--gold); }
.topbar__right { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--bg-dark); border-bottom: 1px solid var(--line); }
.tab {
  background: none;
  border: none;
  color: var(--text2);
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.tab--active { color: var(--gold); border-bottom-color: var(--gold); }

.panel { padding: 16px 20px; }
.panel__bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.panel__title { font-size: 15px; color: var(--gold); font-weight: 700; }
.panel__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-dark); }
.atable { width: 100%; border-collapse: collapse; min-width: 1100px; }
.atable th, .atable td { padding: 8px 8px; text-align: center; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.atable thead th { color: var(--text3); font-weight: 500; font-size: 12px; background: var(--bg-dark); }
.th-group { background: rgba(244, 192, 124, .06); color: var(--gold); }
.subhead th { font-size: 11px; color: var(--text2); padding: 5px; }
.atable tbody tr:hover { background: rgba(255,255,255,.03); }
.atable input {
  width: 78px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 5px 6px;
  border-radius: 5px;
  font-size: 13px;
  text-align: center;
  font-family: var(--mono);
}
.atable input.cell-name { width: 100px; text-align: left; font-family: var(--font); }
.atable input.cell-grp { width: 84px; text-align: left; font-family: var(--font); }
.atable input.cell-sort { width: 46px; }
.atable input:focus { border-color: var(--gold); outline: none; }
.atable select { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 5px 4px; border-radius: 5px; font-size: 12px; }
.final { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.final-sell { color: var(--gold); }
.final-buy { color: #ff7a45; }
.muted { color: var(--text3) !important; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }

/* 快讯标签（后台内联） */
.flash-tag-inline { font-size: 11px; padding: 1px 6px; border-radius: 2px; font-weight: 700; white-space: nowrap; }
.tag-new { background: #ff3333; color: #fff; }
.tag-market { background: #f4d07c; color: #5a0e12; }
.tag-notice { background: #19d28a; color: #fff; }
.tag-data { background: #3a7bff; color: #fff; }

/* ===== 商城商品表格 ===== */
.atable-prod { min-width: 1000px; }
.atable-prod input.cell-price { width: 70px; font-family: var(--mono); }
.atable-prod input.cell-desc { width: 130px; text-align: left; font-family: var(--font); font-size: 12px; }
.atable-prod select { min-width: 70px; }
.switch input { width: auto; }

/* ===== 设置卡片 ===== */
.conf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--bg-dark); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h3 { font-size: 14px; margin-bottom: 14px; color: var(--gold); }
.card label { display: block; margin-bottom: 12px; font-size: 12px; color: var(--text2); }
.card label .input { margin-top: 5px; }
.card .btn { margin-top: 6px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--bg-dark); border: 1px solid var(--gold); color: var(--text); padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 999; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

@media (max-width: 720px) {
  .topbar, .panel, .tabs { padding-left: 14px; padding-right: 14px; }
  .topbar__left h1 { font-size: 16px; }
  .login__card { padding: 22px 18px; }
}
