/* QQ Bot Admin - 简洁移动端样式 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #F5F7FB; color: #1F2937; }
body { font-size: 14px; line-height: 1.5; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

:root {
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-sub: #6B7280;
  --border: #E5E7EB;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
}

/* 顶部 header */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px;
  color: var(--text); font-size: 14px;
}
.menu-btn { font-size: 22px; }
.menu-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--text); position: relative;
}
.menu-btn span::before, .menu-btn span::after {
  content: ''; position: absolute; left: 0; width: 22px; height: 2px; background: var(--text);
}
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }
.header-title { font-size: 16px; font-weight: 600; flex: 1; text-align: center; }
.logout-btn { color: var(--text-sub); font-size: 13px; }

/* 主内容 */
.content { padding: 16px; max-width: 800px; margin: 0 auto; padding-bottom: 80px; }

/* 卡片 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  background: var(--card); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.text-sm { font-size: 13px; }
.text-sub { color: var(--text-sub); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }

.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-8 { gap: 8px; }
.flex-1 { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn-ghost:hover { background: rgba(99,102,241,0.08); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #DC2626; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表单 */
.form-item { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text);
  outline: none; transition: border 0.15s;
}
.form-textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-sub); }

/* 列表项 */
.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* 开关 */
.switch {
  width: 44px; height: 24px; border-radius: 12px;
  background: #D1D5DB; position: relative;
  cursor: pointer; transition: background 0.2s;
  flex-shrink: 0;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--bg); color: var(--text-sub); }
.tag-primary { background: rgba(99,102,241,0.1); color: var(--primary); }
.tag-success { background: rgba(16,185,129,0.1); color: var(--success); }
.tag-warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.tag-danger { background: rgba(239,68,68,0.1); color: var(--danger); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 16px; padding: 24px;
  width: 100%; max-width: 420px; max-height: 85vh; overflow: auto;
  position: relative; transform: scale(0.95); transition: transform 0.2s;
}
.modal-mask.show .modal { transform: scale(1); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; padding-right: 32px; }
.modal-body { margin-bottom: 16px; }
.modal-footer { display: flex; gap: 8px; }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 80%; max-width: 320px; background: #fff;
  transform: translateX(-100%); transition: transform 0.25s;
  overflow-y: auto;
}
.drawer-mask.show .drawer { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.brand { font-size: 16px; font-weight: 600; }
.drawer-close { font-size: 24px; color: var(--text-sub); }
.drawer-user { padding: 16px; border-bottom: 1px solid var(--border); }
.user-name { font-size: 15px; font-weight: 500; }
.user-quota { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.drawer-section { padding: 8px 0; border-bottom: 1px solid var(--border); }
.drawer-section-title { font-size: 12px; color: var(--text-sub); padding: 8px 16px 4px; }
.drawer-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 16px; font-size: 14px; color: var(--text);
  background: none; border: none; cursor: pointer;
}
.drawer-item:hover, .drawer-item.active { background: rgba(99,102,241,0.08); color: var(--primary); }
.drawer-item.danger { color: var(--danger); }

/* 提示 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px;
  background: rgba(31,41,55,0.9); color: #fff; font-size: 14px;
  z-index: 9999; opacity: 0; transition: opacity 0.2s;
  pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }

/* 警告提示 */
.warn-card {
  background: #FEF3C7; border: 1px solid #FDE68A;
  border-radius: 10px; padding: 12px; margin-bottom: 12px;
}

/* 错误页 */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h2 { color: var(--text); margin-bottom: 12px; }
.error-page p { color: var(--text-sub); }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 400px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.login-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 24px; color: var(--text); }

/* 字段展示 */
.field { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.field-label { color: var(--text-sub); font-size: 13px; }
.field-value { color: var(--text); font-size: 14px; }

/* 响应式 */
@media (min-width: 640px) {
  .content { padding: 24px; }
}
