/* ========== 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #d97706;
  --primary-light: #f59e0b;
  --dark: #1a3a2e;
  --dark-2: #243f35;
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #1f2430;
  --text-sub: #6b7280;
  --text-light: #9ca3af;
  --danger: #e11d48;
  --success: #047857;
  --border: #eef0f4;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }

/* ========== 登录页 ========== */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #101d18 0%, #1a3a2e 55%, #2c4f3f 100%);
  padding: 24px;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px 36px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand h1 { font-size: 28px; color: var(--dark); letter-spacing: 4px; }
.login-brand p { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.brand-beads { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.bead {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-block;
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.25);
  animation: floatBead 2.4s ease-in-out infinite;
}
.b1 { background: #c0392b; }
.b2 { background: #f59e0b; animation-delay: 0.3s; }
.b3 { background: #2980b9; animation-delay: 0.6s; }
@keyframes floatBead {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.login-form .field { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e6ee;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.login-form input:focus { border-color: var(--primary-light); }
.btn { cursor: pointer; border: none; border-radius: 10px; font-size: 15px; padding: 12px 20px; transition: all .2s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; }
.login-tip { margin-top: 14px; text-align: center; color: var(--danger); font-size: 13px; min-height: 18px; }

/* ========== 主布局 ========== */
.main-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #101d18, #1a3a2e);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.side-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.side-name { font-size: 17px; font-weight: 700; letter-spacing: 2px; }
.side-nav { flex: 1; padding: 16px 12px; }
.nav-item {
  display: block;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  transition: all .2s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(217,119,6,0.35); }
.side-foot { padding: 16px 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.admin-info { font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 10px; }
.admin-info .role { display: inline-block; font-size: 11px; background: rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 8px; margin-left: 6px; }
.btn-logout {
  width: 100%;
  padding: 9px 0;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); }

.content { flex: 1; margin-left: 220px; padding: 0 28px 40px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.topbar h2 { font-size: 22px; color: var(--text); }

/* ========== 通用卡片 ========== */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(26,58,46,0.06);
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ========== 统计卡片 ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(26,58,46,0.06);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -18px; top: -18px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(217,119,6,0.05));
}
.stat-label { font-size: 13px; color: var(--text-sub); }
.stat-num { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--dark); }
.stat-num.hot { color: var(--primary); }
.stat-extra { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ========== 趋势图（CSS 柱状图） ========== */
.trend-wrap { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 10px; }
.trend-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 60%; max-width: 44px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  transition: height .5s ease;
}
.trend-item:hover .trend-bar { filter: brightness(1.1); }
.trend-label { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.trend-count { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }

/* ========== 表格 ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
th { color: var(--text-sub); font-weight: 500; font-size: 13px; background: #fafbfd; }
tr:hover td { background: #fafbfd; }
td.cell-main { font-weight: 600; }
.thumb {
  width: 40px; height: 40px; border-radius: 8px;
  object-fit: cover; background: #f3f4f6;
  vertical-align: middle;
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 12px;
  font-weight: 500;
}
.tag-pending { background: #fef3c7; color: #b45309; }
.tag-active { background: #d1fae5; color: #047857; }
.tag-disabled { background: #fee2e2; color: #dc2626; }
.tag-rejected { background: #f3f4f6; color: #6b7280; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-ok { background: #d1fae5; color: #047857; }

/* ========== 状态点 ========== */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-pending { background: #f59e0b; }
.dot-active { background: #10b981; }
.dot-disabled { background: #ef4444; }
.dot-rejected { background: #9ca3af; }

/* ========== 按钮组 ========== */
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: #fff; border: 1px solid #e2e6ee; color: var(--text-sub); }
.btn-ghost:hover { border-color: var(--primary-light); color: var(--primary); }
.btn-ghost-primary { background: #fff7ed; border: 1px solid #fed7aa; color: var(--primary); }
.btn-ghost-primary:hover { background: #ffedd5; }
.btn-danger { background: #fff1f2; border: 1px solid #fecdd3; color: var(--danger); }
.btn-danger:hover { background: #ffe4e6; }
.btn-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--success); }
.btn-success:hover { background: #d1fae5; }
.op-group { display: flex; gap: 8px; }

/* ========== 筛选栏 ========== */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select {
  padding: 9px 12px;
  border: 1px solid #e2e6ee;
  border-radius: 9px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary-light); }
.filter-bar input { width: 220px; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 16px; color: var(--text-sub); font-size: 13px; }
.pager button { padding: 6px 14px; }

/* ========== 详情行 ========== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 28px; }
.detail-row .dl { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.detail-row .dv { font-size: 14px; color: var(--text); }
.detail-row .dv img { max-width: 200px; border-radius: 8px; }

/* ========== 表单 ========== */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #e2e6ee;
  border-radius: 9px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--primary-light); }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(16,24,20,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 520px;
  max-width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff;
}
.modal-head h3 { font-size: 17px; }
.modal-close { cursor: pointer; color: var(--text-light); font-size: 18px; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(26,58,46,0.92);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 空状态 ========== */
.empty { text-align: center; padding: 60px 0; color: var(--text-light); font-size: 14px; }
.empty .icon { font-size: 42px; margin-bottom: 10px; }

/* ========== 响应式 ========== */
@media (max-width: 860px) {
  .sidebar { width: 64px; }
  .side-name, .nav-item span { display: none; }
  .content { margin-left: 64px; padding: 0 16px 30px; }
  .nav-item { text-align: center; padding: 12px 4px; font-size: 18px; }
  .admin-info { font-size: 11px; text-align: center; }
  .side-logo { margin: 0 auto; }
}
