/* ========== 基础 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #F0F2F5; color: #1F2329; font-size: 14px;
}
.hidden { display: none !important; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

/* ========== 登录页 ========== */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1F2329 0%, #2D2A26 60%, #3A332C 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #FFF; border-radius: 16px;
  padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center;
}
.login-logo { font-size: 48px; }
.login-title { font-size: 22px; font-weight: 700; margin-top: 10px; color: #1F2329; }
.login-sub { font-size: 12px; color: #999; margin-top: 4px; letter-spacing: 1px; }
.login-form { margin-top: 28px; }
.login-input {
  width: 100%; height: 44px; border: 1px solid #E5E6EB; border-radius: 10px;
  padding: 0 14px; font-size: 14px; margin-bottom: 14px; transition: border-color .2s;
}
.login-input:focus { border-color: #E8936A; }
.login-btn {
  width: 100%; height: 44px; border-radius: 10px; background: #1F2329; color: #FFF;
  font-size: 15px; font-weight: 600; margin-top: 6px; transition: opacity .2s;
}
.login-btn:hover { opacity: 0.85; }
.login-msg { font-size: 13px; color: #E85D5D; margin-top: 12px; min-height: 18px; }

/* ========== 顶栏 ========== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 100;
  background: #FFF; border-bottom: 1px solid #E8E9EC;
  display: flex; align-items: center; padding: 0 16px;
}
.menu-toggle {
  display: none; width: 36px; height: 36px; border-radius: 8px; background: transparent;
  font-size: 20px; color: #1F2329; margin-right: 8px;
}
.menu-toggle:hover { background: #F2F3F5; }
.topbar-brand { display: flex; align-items: center; }
.topbar-logo { font-size: 22px; margin-right: 8px; }
.topbar-title { font-size: 16px; font-weight: 700; color: #1F2329; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-role {
  font-size: 11px; color: #E8936A; background: #FDF3EC; border: 1px solid #F5DCC8;
  border-radius: 10px; padding: 2px 10px;
}
.topbar-user { font-size: 14px; color: #333; }
.topbar-logout {
  font-size: 13px; color: #666; background: #F2F3F5; border-radius: 8px; padding: 6px 14px;
  transition: background .2s;
}
.topbar-logout:hover { background: #E5E6EB; }

/* ========== 布局 ========== */
.layout { display: flex; padding-top: 52px; min-height: 100vh; }

/* ========== 侧边导航 ========== */
.sidebar {
  width: 220px; flex-shrink: 0; background: #1F2329; color: #D0D3D8;
  position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
  z-index: 90; transition: transform .25s ease;
}
.nav { padding: 10px 0; }
.nav-group-title {
  padding: 14px 18px 6px; font-size: 12px; color: #6B7280; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; cursor: pointer; color: #D0D3D8; font-size: 14px;
  transition: background .15s;
}
.nav-item:hover { background: #2A2F36; color: #FFF; }
.nav-item.active { background: #E8936A; color: #FFF; font-weight: 600; }
.nav-arrow { font-size: 10px; transition: transform .2s; opacity: .7; }
.nav-arrow.open { transform: rotate(90deg); }
.nav-children { display: none; }
.nav-children.open { display: block; }
.nav-child {
  padding: 9px 18px 9px 38px; cursor: pointer; color: #9AA0A8; font-size: 13px;
  transition: background .15s;
}
.nav-child:hover { background: #2A2F36; color: #FFF; }
.nav-child.active { background: #2A2F36; color: #E8936A; font-weight: 600; }

.sidebar-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 85;
}

/* ========== 内容区 ========== */
.content { flex: 1; padding: 20px; min-width: 0; }
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #FFF; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: #86909C; margin-top: 4px; }
.stat-card.accent { background: linear-gradient(135deg, #E8936A, #F3B790); color: #FFF; }
.stat-card.accent .stat-label { color: rgba(255,255,255,0.85); }

/* 表格卡片 */
.panel { background: #FFF; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 16px; overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid #F0F1F3; gap: 10px;
}
.panel-title { font-size: 15px; font-weight: 600; }
.panel-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 13px; color: #86909C; font-weight: 500;
  padding: 10px 16px; border-bottom: 1px solid #F0F1F3; white-space: nowrap;
}
.tbl td { padding: 11px 16px; border-bottom: 1px solid #F5F6F7; font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FAFBFC; }
.tbl .empty-row td { text-align: center; color: #B0B6BF; padding: 30px 0; }

/* 输入控件 */
.input, .select, .textarea {
  height: 34px; border: 1px solid #E5E6EB; border-radius: 8px; padding: 0 10px;
  font-size: 13px; background: #FFF; transition: border-color .2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #E8936A; }
.textarea { height: auto; padding: 8px 10px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px;
  background: #F2F3F5; color: #333; transition: opacity .2s, background .2s;
}
.btn:hover { opacity: .85; }
.btn-primary { background: #E8936A; color: #FFF; font-weight: 600; }
.btn-dark { background: #1F2329; color: #FFF; font-weight: 600; }
.btn-danger { background: #E85D5D; color: #FFF; }
.btn-success { background: #4CD964; color: #FFF; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; margin-right: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 徽章 */
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.badge.pending { background: #FFF3E0; color: #B26A00; }
.badge.approved { background: #E8F8EE; color: #2E9E5B; }
.badge.rejected { background: #FDECEC; color: #E85D5D; }
.badge.normal { background: #E8F8EE; color: #2E9E5B; }
.badge.banned { background: #FDECEC; color: #E85D5D; }
.badge.super { background: #FDF3EC; color: #E8936A; }
.badge.admin { background: #EBF0FF; color: #4E6EF2; }
.badge.reviewer { background: #EAF7FF; color: #2E9EDB; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; justify-content: flex-end; }
.pager-info { font-size: 12px; color: #86909C; margin-right: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 92%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: #FFF; border-radius: 14px; z-index: 210; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #F0F1F3; position: sticky; top: 0; background: #FFF; z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: 8px; background: #F2F3F5; color: #666; font-size: 14px; }
.modal-body { padding: 18px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: #333; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; border: 1px solid #E5E6EB; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; background: #FFF;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #E8936A; }
.form-textarea { min-height: 90px; resize: vertical; }
.form-row2 { display: flex; gap: 12px; }
.form-row2 .form-group { flex: 1; }

/* Toast */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(31,35,41,0.92); color: #FFF; font-size: 13px;
  padding: 10px 22px; border-radius: 20px; z-index: 300; max-width: 80%;
}

/* 描述卡片 */
.info-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.info-card { background: #FFF; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.info-card h3 { font-size: 15px; margin-bottom: 6px; }
.info-card p { font-size: 13px; color: #86909C; line-height: 1.7; }
.info-card .count { font-size: 22px; font-weight: 700; color: #E8936A; margin-top: 10px; }

/* 审核卡片 */
.audit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.audit-card { background: #FFF; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.audit-head { display: flex; align-items: center; gap: 10px; }
.audit-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.audit-name { font-size: 15px; font-weight: 600; }
.audit-meta { font-size: 12px; color: #86909C; margin-top: 3px; }
.audit-desc { font-size: 13px; color: #555; line-height: 1.6; margin-top: 10px; }
.audit-actions { display: flex; gap: 8px; margin-top: 12px; }

/* 空态 */
.empty-tip { text-align: center; color: #B0B6BF; padding: 40px 0; font-size: 14px; }

/* ========== 响应式：手机 < 900px ========== */
@media (max-width: 899px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 52px; bottom: 0; height: calc(100vh - 52px);
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .panel-tools { width: 100%; }
  .input { flex: 1; min-width: 0; }
  .topbar-user { display: none; }
}
