/* ==================== 极简管理后台CSS ==================== */
/* 只包含必要样式，避免冲突 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --bg: #f3f4f6;
  --white: #ffffff;
  --border: #e5e7eb;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  
  /* CSS变量别名 */
  --cms-spacing-sm: 8px;
  --cms-spacing-md: 16px;
  --cms-spacing-lg: 24px;
  --cms-spacing-xl: 32px;
  --cms-text-light: #6b7280;
  --cms-text-lighter: #9ca3af;
  --cms-radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ==================== 登录页 - 全新风格 ==================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: drift 20s linear infinite;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(50px, 50px); }
}

.login-card {
  background: white;
  padding: 48px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.login-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.input-group label svg {
  color: #6366f1;
}

.input-group input[type="tel"],
.input-group input[type="text"],
.input-group input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s;
  outline: none;
  box-sizing: border-box;
}

.input-group input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.code-input-wrapper {
  display: flex;
  gap: 8px;
}

.code-input-wrapper input {
  flex: 1;
}

.code-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.code-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.code-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.login-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.login-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* 历史手机号 */
.phone-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.phone-history-item {
  padding: 6px 14px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-history-item:hover {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
  transform: translateY(-1px);
}

.phone-history-item svg {
  width: 14px;
  height: 14px;
}

/* 倒计时文本 */
.countdown-text {
  font-size: 13px;
  color: #6366f1;
  margin-top: 8px;
  font-weight: 500;
}

/* 短信模式显示 */
.sms-mode {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 3px solid #6366f1;
}

/* 提示消息 */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ==================== 管理后台布局 ==================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.brand-info {
  flex: 1;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* 导航菜单 */
.sidebar-nav {
  padding: 16px 12px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  border-radius: 10px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 主内容区 */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
.topbar {
  height: 70px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.topbar-btn svg {
  width: 20px;
  height: 20px;
}

/* 内容区域 */
.content-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

/* 侧边栏切换按钮（移动端显示） */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.sidebar-toggle:hover {
  background: var(--bg);
}

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}

/* 页面标题行 */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

.filter-input-search {
  width: 220px;
}

.col-actions {
  width: 340px;
  min-width: 200px;
}

/* 筛选按钮行（桌面端 inline） */
.filter-btn-row {
  display: contents;
}

/* 表格滑动提示（桌面端隐藏） */
.table-scroll-hint {
  display: none;
}

.table-action-btns {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.table-action-btns .btn {
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

/* ==================== 响应式 - 平板 ==================== */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  .main-content {
    margin-left: 220px;
  }
  .topbar {
    padding: 0 16px;
  }
  .content-area {
    padding: 20px;
  }
  .page-content {
    padding: 20px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }
}

/* ==================== 响应式 - 手机 ==================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  .admin-layout {
    overflow-x: hidden;
    max-width: 100vw;
  }
  /* -- 侧边栏 -- */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    overflow-x: hidden;
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  .sidebar-brand {
    padding: 16px;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
  }
  .brand-name {
    font-size: 15px;
  }
  .nav-item {
    padding: 10px 14px;
    font-size: 13px;
  }
  .nav-section-title {
    font-size: 10px;
    padding: 6px 14px;
  }

  /* -- 顶部栏固定 -- */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 12px;
    height: 50px;
    gap: 8px;
    z-index: 90;
  }
  .topbar-left {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }
  .topbar-left h1,
  .page-title {
    font-size: 15px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-right {
    flex-shrink: 0;
    gap: 6px;
  }
  .topbar-btn {
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
  }
  .topbar-btn span {
    display: none;
  }
  .topbar-btn svg {
    width: 18px;
    height: 18px;
  }

  /* -- 内容区 -- */
  .content-area {
    padding: 62px 12px 12px 12px;
    overflow-x: hidden;
  }
  .page {
    overflow-x: hidden;
    max-width: 100%;
  }
  .page-content {
    padding: 14px;
    border-radius: 8px;
    overflow-x: hidden;
    max-width: 100%;
  }
  .page-content h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  /* -- 仪表盘 -- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 14px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .stat-icon svg {
    width: 20px;
    height: 20px;
  }
  .stat-label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .stat-value {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .stat-change {
    font-size: 11px;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .quick-action-btn {
    padding: 14px 10px;
    font-size: 12px;
    gap: 8px;
  }
  .quick-action-btn svg {
    width: 24px;
    height: 24px;
  }
  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }
  .info-item {
    padding: 10px;
  }
  .info-label {
    font-size: 11px;
  }
  .info-value {
    font-size: 15px;
  }

  /* -- 页面标题行 -- */
  .page-header-row {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-header-row h2 {
    flex: 1 1 100%;
    font-size: 18px !important;
    margin: 0 !important;
  }
  .page-header-row > .btn {
    width: 100%;
    justify-content: center;
  }
  .page-header-row > div {
    flex-shrink: 0;
  }
  .page-header-row > div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 6px !important;
    width: 100%;
  }
  .page-header-row > div[style*="display: flex"] .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  /* -- 搜索输入框 -- */
  .filter-input-search {
    width: 100% !important;
  }

  /* -- 表格操作列 -- */
  .col-actions {
    width: auto;
    min-width: 100px;
  }
  .table-action-btns {
    gap: 3px;
  }
  .table-action-btns .btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  /* -- 页面头部 -- */
  .cms-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .cms-page-title {
    font-size: 18px;
  }
  .cms-page-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cms-page-actions .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }

  /* -- 筛选工具栏 -- */
  .filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    margin-bottom: 12px;
  }
  .filter-group {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .filter-group label {
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
  }
  .filter-group input,
  .filter-group select {
    flex: 1;
    width: auto !important;
    padding: 8px 10px;
    font-size: 13px;
    min-width: 0;
  }
  /* 筛选按钮行 */
  .filter-btn-row {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .filter-btn-row .btn {
    flex: 1;
    justify-content: center;
  }

  /* -- 表格 -- */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
  }
  .data-table {
    font-size: 12px;
    min-width: 700px;
  }
  .data-table th {
    padding: 10px 8px;
    font-size: 11px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 1;
  }
  .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  .data-table .btn-group,
  .data-table td > div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 4px !important;
  }
  .data-table .btn,
  .data-table .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }

  /* -- 表格滑动提示 -- */
  .table-scroll-hint {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    padding: 6px 0;
    margin: -4px 0 8px;
  }
  .table-scroll-hint::before {
    content: '← 左右滑动查看更多 →';
  }

  /* -- 分页 -- */
  .pagination {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .pagination-info {
    font-size: 12px;
  }
  .cms-pagination {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  /* -- 模态框 -- */
  .modal-content {
    width: 95% !important;
    max-width: 95vw !important;
    margin: 10px auto;
    max-height: 92vh;
    overflow: hidden;
    border-radius: 10px;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-header h3 {
    font-size: 16px;
  }
  .modal-body {
    padding: 14px 16px;
    max-height: calc(92vh - 130px);
    overflow-y: auto;
  }
  .modal-footer {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .modal-footer .btn {
    flex: 1;
    min-width: 80px;
    justify-content: center;
    text-align: center;
  }
  .cms-modal-content {
    width: 95%;
    max-width: 95vw;
  }
  .cms-modal-header {
    padding: 14px 16px;
  }
  .cms-modal-body {
    padding: 14px 16px;
  }
  .cms-modal-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* -- 表单 -- */
  .form-group {
    margin-bottom: 14px;
  }
  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 9px 10px;
    font-size: 13px;
  }

  /* -- Tab 按钮 -- */
  .tab-buttons {
    flex-wrap: wrap;
  }
  .tab-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
  }
  .config-tab {
    padding: 10px 14px;
    font-size: 13px;
  }
  .config-tab-bar {
    gap: 4px !important;
    margin: 14px 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .config-tab-bar .config-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
  }

  /* -- 按钮通用 -- */
  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }
  .btn-sm {
    padding: 4px 10px;
    font-size: 11px;
  }
  .btn-group {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* -- 卡片 -- */
  .cms-card {
    padding: 14px;
    margin-bottom: 12px;
  }
  .cms-card-header {
    font-size: 15px;
    margin-bottom: 10px;
  }

  /* -- 徽章 -- */
  .badge {
    padding: 2px 6px;
    font-size: 10px;
  }
  .status-badge {
    padding: 3px 8px;
    font-size: 11px;
  }

  /* -- 详情 -- */
  .detail-item {
    grid-template-columns: 90px 1fr;
    gap: 8px;
    padding: 8px 0;
  }
  .detail-item label {
    font-size: 12px;
  }
  .detail-item span {
    font-size: 12px;
  }
  .detail-group label {
    font-size: 12px;
  }
  .detail-group .detail-value {
    font-size: 12px;
  }

  /* -- Toast -- */
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    width: 100%;
    font-size: 13px;
    padding: 10px 14px;
  }

  /* -- 登录页 -- */
  .login-card {
    padding: 28px 20px;
    border-radius: 14px;
    margin: 12px;
    max-width: none;
    width: calc(100% - 24px);
  }
  .login-header {
    margin-bottom: 24px;
  }
  .login-header h2 {
    font-size: 22px;
  }
  .login-header p {
    font-size: 13px;
  }
  .input-group {
    margin-bottom: 18px;
  }
  .input-group input[type="tel"],
  .input-group input[type="text"],
  .input-group input[type="password"] {
    padding: 10px 12px;
    font-size: 14px;
  }
  .login-btn {
    padding: 12px 20px;
    font-size: 15px;
    margin-top: 20px;
  }
  .code-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ==================== 响应式 - 小屏手机 ==================== */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .stat-card {
    flex-direction: row;
    align-items: center;
    padding: 12px;
  }
  .stat-value {
    font-size: 20px;
  }
  .quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .quick-action-btn {
    padding: 12px 8px;
    font-size: 11px;
  }
  .page-content h2 {
    font-size: 16px;
  }
  .sidebar-brand .brand-subtitle {
    display: none;
  }
  .topbar-left h1,
  .page-title {
    font-size: 14px !important;
  }
  .filter-toolbar {
    padding: 8px;
  }
  .data-table {
    min-width: 500px;
    font-size: 11px;
  }
  .data-table th {
    padding: 6px;
    font-size: 9px;
  }
  .data-table td {
    padding: 8px 6px;
    font-size: 11px;
  }
  .login-card {
    padding: 24px 16px;
  }
  .login-header h2 {
    font-size: 20px;
  }
  .login-btn {
    padding: 11px 16px;
    font-size: 14px;
  }
}

/* 系统配置Tab */
.config-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.config-tab:hover {
  color: #374151;
  background: #f9fafb;
}

.config-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.config-tab svg {
  width: 20px;
  height: 20px;
}

.config-tab-content {
  display: none;
  padding-top: 24px;
}

.config-tab-content.active {
  display: block;
}

/* 页面头部 */
.cms-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.cms-page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.cms-page-actions {
  display: flex;
  gap: 12px;
}

/* 卡片 */
.cms-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.cms-card-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cms-card-body {
  padding: 16px 0;
}

/* 按钮 */
.cms-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.cms-btn-primary {
  background: var(--primary);
  color: white;
}

.cms-btn-primary:hover {
  background: #2563eb;
}

.cms-btn-secondary {
  background: #6b7280;
  color: white;
}

.cms-btn-success {
  background: var(--success);
  color: white;
}

.cms-btn-warning {
  background: var(--warning);
  color: white;
}

.cms-btn-danger {
  background: var(--danger);
  color: white;
}

.cms-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* 表格 */
.cms-table-wrapper {
  overflow-x: auto;
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
}

.cms-table th,
.cms-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cms-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
}

.cms-table tbody tr:hover {
  background: var(--bg);
}

/* 工具栏 */
.cms-toolbar {
  padding: 16px;
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 16px;
}

.cms-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cms-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cms-filter-label {
  font-size: 13px;
  color: var(--text-light);
}

.cms-input, .cms-select, .cms-textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.cms-input:focus, .cms-select:focus, .cms-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* 分页 */
.cms-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.cms-pagination-info {
  font-size: 13px;
  color: var(--text-light);
}

.cms-pagination-buttons {
  display: flex;
  gap: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.cms-text-center {
  text-align: center;
}

/* 模态框基础样式 */
.cms-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.cms-modal.show {
  display: flex !important;
}

.cms-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.cms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.cms-modal-title {
  font-size: 18px;
  font-weight: 600;
}

.cms-modal-close {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
}

.cms-modal-close:hover {
  color: var(--text);
}

.cms-modal-body {
  padding: 20px;
}

.cms-modal-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.cms-form-group {
  margin-bottom: 16px;
}

.cms-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}

/* 通用工具类 */
.cms-flex {
  display: flex;
}

.cms-flex-between {
  justify-content: space-between;
}

.cms-gap-sm { gap: 8px; }
.cms-gap-md { gap: 16px; }
.cms-gap-lg { gap: 24px; }

/* 状态徽章 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* 额外的工具类 */
.btn-group {
  display: flex;
  gap: 8px;
}

/* Toast通知 */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  min-width: 300px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.info {
  border-left: 4px solid var(--primary);
}

/* 添加用户模态框等 */
.countdown {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

.sms-mode-display {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: 4px;
}

/* 深色模式 */
[data-theme="dark"] {
  --text: #f3f4f6;
  --text-light: #9ca3af;
  --text-lighter: #6b7280;
  --bg: #111827;
  --white: #1f2937;
  --border: #374151;
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

[data-theme="dark"] .login-box {
  background: #1f2937;
  color: #f3f4f6;
}

[data-theme="dark"] .login-box h1 {
  color: #f3f4f6;
}

/* 加载动画 */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 历史手机号 */
#phone-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#phone-history span {
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

#phone-history span:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==================== 仪表盘样式 ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 30px;
  height: 30px;
  color: white;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.stat-change.positive {
  color: #10b981;
}

.stat-change.negative {
  color: #ef4444;
}

.stat-change.neutral {
  color: #6b7280;
}

.stat-change svg {
  width: 16px;
  height: 16px;
}

/* 快捷操作 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  color: #374151;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.quick-action-btn:hover {
  border-color: #6366f1;
  background: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.quick-action-btn svg {
  width: 32px;
  height: 32px;
  color: #6366f1;
}

/* 系统信息 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-item {
  padding: 16px;
  border-left: 3px solid #6366f1;
  background: #f9fafb;
  border-radius: 8px;
}

.info-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.info-value {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

/* ==================== 通用表格和表单样式 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-info {
  background: #3b82f6;
  color: white;
}

.btn-info:hover {
  background: #2563eb;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* 筛选工具栏 */
.filter-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 表格样式 */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.data-table thead {
  background: #f9fafb;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.pagination-info {
  font-size: 14px;
  color: #6b7280;
}

.pagination-info strong {
  color: #1f2937;
  font-weight: 600;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 160px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* 用户详情样式 */
.detail-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.detail-item span {
  font-size: 14px;
  color: #1f2937;
}

/* 暗色主题模态框 */
[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
  background: #1f2937;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #374151;
}

[data-theme="dark"] .modal-header h3 {
  color: #f3f4f6;
}

[data-theme="dark"] .modal-close {
  color: #9ca3af;
}

[data-theme="dark"] .modal-close:hover {
  background: #374151;
  color: #f3f4f6;
}

[data-theme="dark"] .modal-footer {
  border-top-color: #374151;
  background: #111827;
}

[data-theme="dark"] .form-group label {
  color: #d1d5db;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .form-group input:disabled {
  background: #111827;
  color: #6b7280;
}

[data-theme="dark"] .detail-item {
  border-bottom-color: #374151;
}

[data-theme="dark"] .detail-item label {
  color: #9ca3af;
}

[data-theme="dark"] .detail-item span {
  color: #f3f4f6;
}

/* ==================== Tab 样式 ==================== */
.tab-container {
  background: white;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-buttons {
  display: flex;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.tab-btn.active {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

[data-theme="dark"] .tab-container {
  background: #1f2937;
}

[data-theme="dark"] .tab-btn {
  color: #9ca3af;
}

[data-theme="dark"] .tab-btn:hover {
  background: #374151;
  color: #f3f4f6;
}

[data-theme="dark"] .tab-btn.active {
  background: #3b82f6;
  color: white;
}

/* ==================== Badge样式 ==================== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  text-align: center;
  white-space: nowrap;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-secondary {
  background: #e5e7eb;
  color: #6b7280;
}

.badge-primary {
  background: #dbeafe;
  color: #1e40af;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="dark"] .badge-success {
  background: #065f46;
  color: #d1fae5;
}

[data-theme="dark"] .badge-secondary {
  background: #4b5563;
  color: #d1d5db;
}

[data-theme="dark"] .badge-primary {
  background: #1e40af;
  color: #dbeafe;
}

/* 详情模态框样式 */
.detail-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.detail-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  font-size: 13px;
}

.detail-group .detail-value {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.detail-group .detail-value code {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

[data-theme="dark"] .detail-group {
  border-bottom-color: #374151;
}

[data-theme="dark"] .detail-group label {
  color: #d1d5db;
}

[data-theme="dark"] .detail-group .detail-value {
  color: #e5e7eb;
}

[data-theme="dark"] .detail-group .detail-value code {
  background: #374151;
  color: #e5e7eb;
}

/* info按钮样式 */
.btn-info {
  background: #3b82f6;
  color: white;
  border: 1px solid #2563eb;
}

.btn-info:hover {
  background: #2563eb;
  border-color: #1d4ed8;
}

[data-theme="dark"] .btn-info {
  background: #2563eb;
  border-color: #1e40af;
}

[data-theme="dark"] .btn-info:hover {
  background: #1d4ed8;
  border-color: #1e3a8a;
}

/* 删除确认模态框样式 */
#delete-confirm-modal .modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

[data-theme="dark"] #delete-confirm-modal .modal-header {
  background: #7f1d1d !important;
  border-bottom-color: #991b1b !important;
}

[data-theme="dark"] #delete-confirm-modal .modal-header h3 {
  color: #fecaca !important;
}

[data-theme="dark"] #delete-confirm-modal .modal-body {
  color: #e5e7eb;
}

[data-theme="dark"] #delete-confirm-modal .modal-body div[style*="background: #fef3c7"] {
  background: #78350f !important;
  border-left-color: #f59e0b !important;
}

[data-theme="dark"] #delete-confirm-modal .modal-body div[style*="background: #fef3c7"] p {
  color: #fcd34d !important;
}

/* ==================== 手机端卡片列表系统 ==================== */
.mobile-card-list {
  display: none;
}

.m-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.m-card:active {
  box-shadow: 0 2px 8px rgba(99,102,241,0.18);
}
.m-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  gap: 8px;
}
.m-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-card-body {
  padding: 0 14px 10px;
}
.m-card-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}
.m-card-field:last-child {
  border-bottom: none;
}
.m-label {
  color: #6b7280;
  flex-shrink: 0;
  margin-right: 12px;
}
.m-card-field > span:last-child,
.m-card-field > div:last-child {
  text-align: right;
  color: #1f2937;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-card-actions {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
.m-card.expanded .m-card-actions {
  max-height: 120px;
  padding: 10px 14px;
}
.m-action-btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 0;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  background: #e0e7ff;
  color: #4338ca;
}
.m-action-btn:active {
  background: #c7d2fe;
}
.m-action-btn.warn {
  background: #fef3c7;
  color: #92400e;
}
.m-action-btn.warn:active {
  background: #fde68a;
}
.m-action-btn.danger {
  background: #fee2e2;
  color: #991b1b;
}
.m-action-btn.danger:active {
  background: #fecaca;
}
.m-action-btn.success {
  background: #d1fae5;
  color: #065f46;
}
.m-action-btn.success:active {
  background: #a7f3d0;
}

/* 懒加载提示 */
.m-load-more {
  display: none;
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #9ca3af;
}
.m-load-more.loading::after {
  content: '加载中...';
}
.m-load-more.no-more::after {
  content: '— 没有更多了 —';
}
.m-load-more.empty::after {
  content: '暂无数据';
}

/* 手机端空状态 */
.m-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* 手机端筛选栏 */
.m-filter-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-card-list {
    display: block;
    overflow-x: hidden;
    max-width: 100%;
  }
  .m-load-more {
    display: block;
  }
  .m-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
  }
  .m-filter-bar input,
  .m-filter-bar select {
    flex: 1 1 45%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .m-filter-bar .btn {
    flex-shrink: 0;
  }
  .table-container,
  .data-table-wrapper,
  .table-scroll-hint {
    display: none !important;
  }
  .pagination,
  .pagination-container,
  .pagination-bar {
    display: none !important;
  }
  .filter-toolbar,
  .toolbar {
    display: none !important;
  }
  .tab-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
  .page-header-row {
    gap: 8px;
  }
  .page-header-row select,
  .page-header-row .form-group {
    min-width: 0 !important;
    width: 100%;
  }

  /* BUG管理手机端筛选区域 */
  #my-bug-management-content .bug-filter-area {
    flex-direction: column !important;
    gap: 8px !important;
  }
  #my-bug-management-content .bug-filter-area > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  #my-bug-management-content .bug-filter-area .bug-filter-buttons {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #my-bug-management-content .bug-filter-area .bug-filter-buttons button {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    margin-left: 0 !important;
  }

  /* BUG列表项手机端 */
  .bug-item {
    padding: 10px 12px !important;
  }
  .bug-item-header {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .bug-item-title {
    font-size: 14px !important;
  }
  .bug-item-meta {
    font-size: 11px !important;
  }
  .bug-item-header > div:last-child {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  /* 更新管理手机端 */
  .update-mgmt-grid {
    grid-template-columns: 1fr !important;
  }
  .update-version-hint {
    flex-direction: column !important;
    gap: 6px !important;
    align-items: flex-start !important;
  }
  .update-version-hint span {
    white-space: normal !important;
  }

  /* 游戏手册手机端卡片 */
  .handbook-mobile-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  .handbook-mobile-card .hb-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 8px;
    cursor: pointer;
  }
  .handbook-mobile-card .hb-field {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: #374151;
  }
  .handbook-mobile-card .hb-field .hb-label {
    color: #6b7280;
    flex-shrink: 0;
    margin-right: 8px;
  }
  .handbook-mobile-card .hb-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
  }
  .handbook-mobile-card .hb-actions button {
    flex: 1;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
  }
}

/* 手机端卡片 暗色主题 */
[data-theme="dark"] .m-card {
  background: #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
[data-theme="dark"] .m-card-title {
  color: #e2e8f0;
}
[data-theme="dark"] .m-card-field {
  border-bottom-color: #334155;
}
[data-theme="dark"] .m-label {
  color: #94a3b8;
}
[data-theme="dark"] .m-card-field > span:last-child,
[data-theme="dark"] .m-card-field > div:last-child {
  color: #e2e8f0;
}
[data-theme="dark"] .m-card-actions {
  background: #0f172a;
  border-top-color: #334155;
}
[data-theme="dark"] .m-action-btn {
  background: #312e81;
  color: #a5b4fc;
}
[data-theme="dark"] .m-action-btn.warn {
  background: #78350f;
  color: #fcd34d;
}
[data-theme="dark"] .m-action-btn.danger {
  background: #7f1d1d;
  color: #fca5a5;
}
[data-theme="dark"] .m-action-btn.success {
  background: #064e3b;
  color: #6ee7b7;
}
[data-theme="dark"] .m-load-more {
  color: #64748b;
}
[data-theme="dark"] .m-filter-bar input,
[data-theme="dark"] .m-filter-bar select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
