/* ===== 后台专用样式（前台 style.css 基础之上）===== */

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 360px; box-shadow: 0 8px 32px #00000040; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.login-sub { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 24px; }
.login-form .field { margin-bottom: 14px; }
.login-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-form .input { width: 100%; }
.login-form .btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }

/* Dashboard 布局 */
.dash-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.dash-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.dash-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.dash-title .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--g-4); }

.dash-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.dash-tab {
  padding: 10px 16px; border: none; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent;
  transition: .15s;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active { color: var(--text); border-bottom-color: var(--g-3); }

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

/* 工具栏 */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { min-width: 180px; }
.toolbar .count { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
td.cell-user { min-width: 160px; }
.cell-user-inner { display: flex; align-items: center; gap: 8px; }
.cell-user-inner img { width: 24px; height: 24px; border-radius: 50%; }
.cell-user-name { font-weight: 500; }
.cell-user-login { font-size: 12px; color: var(--muted); }
.cell-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cell-price { color: var(--gold); font-family: var(--mono); font-weight: 700; }
.cell-actions { display: flex; gap: 4px; }
.cell-actions .btn { padding: 3px 8px; font-size: 12px; }

.status-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.status-pill.s1 { color: var(--green); background: #0e442940; }
.status-pill.s0 { color: var(--yellow); background: #d2992218; }
.status-pill.s2 { color: var(--faint); background: var(--surface-2); }

/* 导入区 */
.import-area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.import-textarea {
  width: 100%; min-height: 200px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 12px; font: 13px/1.6 var(--mono); resize: vertical;
  outline: none;
}
.import-textarea:focus { border-color: var(--g-3); box-shadow: 0 0 0 3px #2ea04333; }
.import-hint { font-size: 12px; color: var(--muted); margin: 8px 0; }
.import-results { margin-top: 16px; }
.import-result-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.import-result-row .ok { color: var(--green); }
.import-result-row .fail { color: var(--red); }
.import-stats { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; }
.import-stats .stat { padding: 8px 16px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
.import-stats .stat b { font-family: var(--mono); font-size: 18px; display: block; }

/* 设置表单 */
.settings-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-width: 560px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-group .input, .form-group .select { width: 100%; }
.form-group .hint { font-size: 11px; color: var(--faint); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--g-3); }

/* 编辑弹窗 */
.edit-modal { max-width: 440px; }
.edit-modal .form-group { margin-bottom: 14px; }
.edit-modal .btn-row { display: flex; gap: 8px; margin-top: 20px; }
.edit-modal .btn-row .btn { flex: 1; justify-content: center; }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; }
.pager .info { font-size: 12px; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 20px; font-size: 13px; z-index: 200; box-shadow: 0 8px 24px #00000060;
  animation: slide-up .2s;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes slide-up { from { transform: translate(-50%, 20px); opacity: 0; } }
