/* Qiku 平台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #f3f4f6;
  --card-bg: #fff;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* 登录页 */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h1 { color: #fff; font-size: 2rem; }
.auth-header p { color: rgba(255,255,255,0.8); margin-top: 4px; }
.auth-box { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
.auth-tabs { display: flex; margin-bottom: 16px; border-radius: 8px; background: var(--bg); padding: 4px; }
.tab-btn { flex: 1; padding: 8px; border: none; background: none; border-radius: 6px; font-size: 0.95rem; cursor: pointer; }
.tab-btn.active { background: #fff; box-shadow: var(--shadow); font-weight: 600; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group { margin-bottom: 14px; }
.form-group input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: var(--primary); }
.captcha-row { display: flex; gap: 8px; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 42px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-bottom: 8px; min-height: 18px; }
.btn { width: 100%; padding: 12px; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; transition: opacity .2s; }
.btn-primary { background: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; width: auto; }

/* 主页面 */
.main-header { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--card-bg); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 100; box-shadow: var(--shadow); }
.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.menu-toggle { font-size: 1.4rem; background: none; border: none; cursor: pointer; padding: 4px 8px; }
.site-title { font-size: 1.1rem; color: var(--primary); }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 6px; position: relative; }
.badge { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; font-size: 0.65rem; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* 侧边栏 */
.sidebar { position: fixed; top: 56px; left: 0; width: 240px; height: calc(100vh - 56px); background: var(--card-bg); z-index: 99; transform: translateX(-100%); transition: transform .3s ease; box-shadow: 2px 0 8px rgba(0,0,0,0.05); }
.sidebar.open { transform: translateX(0); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.close-sidebar { background: none; border: none; font-size: 1.2rem; cursor: pointer; }
.nav-list { list-style: none; padding: 8px 0; }
.nav-item { padding: 14px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-secondary); transition: all .2s; }
.nav-item:hover, .nav-item.active { background: var(--bg); color: var(--primary); }
.nav-item.active { border-right: 3px solid var(--primary); }

/* 主内容 */
.main-content { padding: 72px 16px 80px; max-width: 800px; margin: 0 auto; }
.page-content { display: none; animation: fadeIn .3s ease; }
.page-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 卡片 */
.card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

/* 列表 */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.list-item p { font-size: 0.85rem; color: var(--text-secondary); }
.list-item .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.list-item .meta span { font-size: 0.75rem; color: var(--text-secondary); }

/* 底部导航 */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: var(--card-bg); display: none; align-items: center; justify-content: space-around; box-shadow: 0 -1px 3px rgba(0,0,0,0.08); z-index: 100; }
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .main-content { padding-bottom: 72px; }
}
.nav-btn { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: 0.65rem; color: var(--text-secondary); cursor: pointer; }
.nav-btn span { font-size: 0.65rem; }
.nav-btn.active { color: var(--primary); }

/* 遮罩 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 98; display: none; }
.overlay.show { display: block; }

/* 弹窗 */
.modal { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; background: rgba(0,0,0,0.4); }
.modal.show { display: flex; }
.modal-content { background: #fff; border-radius: var(--radius); padding: 20px; width: 90%; max-width: 400px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; font-size: 1.3rem; cursor: pointer; color: var(--text-secondary); }

/* Toast */
.toast { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 0.85rem; opacity: 0; transition: all .3s; z-index: 300; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 加载 */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.7); z-index: 250; display: flex; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 通用组件 */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state .icon { font-size: 3rem; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.grid-item { background: var(--card-bg); border-radius: var(--radius); padding: 12px; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.grid-item .icon { font-size: 2rem; }
.grid-item .name { font-size: 0.85rem; margin-top: 6px; }

.btn-group { display: flex; gap: 8px; margin-top: 12px; }
.tag { display: inline-block; padding: 2px 8px; background: var(--bg); border-radius: 4px; font-size: 0.75rem; color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
