* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f5f6fa; color: #333; font-size: 14px; -webkit-font-smoothing: antialiased; }

/* ========== 首页布局 ========== */
.app-container { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f5f6fa; position: relative; padding-bottom: 60px; }
.app-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 20px 16px 30px; text-align: center; }
.app-header h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.app-header p { font-size: 13px; opacity: 0.85; }

/* ========== 底部导航栏 ========== */
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 56px; background: #fff; display: flex; border-top: 1px solid #eee; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: #999; font-size: 11px; transition: color 0.2s; padding: 4px 0; }
.bottom-nav a.active { color: #667eea; }
.bottom-nav a .nav-icon { font-size: 22px; margin-bottom: 2px; }

/* ========== 板块列表 ========== */
.section-grid { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: -16px; }
.section-card { background: #fff; border-radius: 12px; padding: 20px 14px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: #333; }
.section-card:active { transform: scale(0.97); }
.section-card .card-icon { font-size: 36px; margin-bottom: 8px; }
.section-card .card-title { font-size: 15px; font-weight: 600; }

/* ========== 板块详情 ========== */
.section-detail { padding: 16px; }
.section-detail .back-btn { display: inline-flex; align-items: center; color: #667eea; text-decoration: none; font-size: 14px; margin-bottom: 16px; }
.section-detail .detail-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.section-detail .detail-card h2 { font-size: 18px; margin-bottom: 12px; color: #333; display:flex;align-items:center;gap:8px; }
.section-detail .detail-card .content { line-height: 1.8; color: #555; font-size: 15px; }
.section-detail .detail-card .content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

/* 板块图标图片 */
.section-icon-img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
.card-icon-img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }

/* ========== 帖子列表 ========== */
.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-card { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); text-decoration: none; transition: transform 0.2s; display: block; }
.post-card:active { transform: scale(0.98); }
.post-card-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 6px; }
.post-card-date { font-size: 12px; color: #999; }

/* ========== 帖子详情 ========== */
.post-detail { margin-top: 12px; }
.post-title { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 12px; line-height: 1.5; }
.post-text { font-size: 15px; line-height: 1.8; color: #555; margin-bottom: 14px; word-break: break-all; }
.post-media-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.post-media-item img { width: 100%; border-radius: 10px; display: block; cursor: zoom-in; }
.post-media-item video { width: 100%; border-radius: 10px; display: block; background: #000; }
.post-meta { font-size: 12px; color: #bbb; text-align: right; }

/* 图片预览弹窗 */
.img-preview-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 10px; }
.img-preview-overlay img { max-width: 100%; max-height: 90vh; border-radius: 8px; object-fit: contain; }

/* ========== 留资咨询页（全屏） ========== */
.consult-page { min-height: 100vh; background: linear-gradient(180deg, #667eea 0%, #764ba2 40%, #f5f6fa 40%); padding: 0; }
.consult-page .top-bar { padding: 12px 16px; display: flex; align-items: center; }
.consult-page .back-home { background: rgba(255,255,255,0.25); color: #fff; border: none; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; backdrop-filter: blur(4px); }
.consult-page .consult-card { margin: 20px 16px; background: #fff; border-radius: 16px; padding: 28px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.consult-page .consult-card h2 { text-align: center; font-size: 20px; color: #333; margin-bottom: 6px; }
.consult-page .consult-card .subtitle { text-align: center; color: #999; font-size: 13px; margin-bottom: 24px; }
.consult-page .form-group { margin-bottom: 16px; }
.consult-page .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.consult-page .form-group input { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 15px; outline: none; transition: border-color 0.2s; }
.consult-page .form-group input:focus { border-color: #667eea; }
.consult-page .submit-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.consult-page .submit-btn:active { opacity: 0.9; }
.consult-page .success-msg { text-align: center; padding: 40px 20px; }
.consult-page .success-msg .check-icon { font-size: 56px; margin-bottom: 12px; }
.consult-page .success-msg h3 { font-size: 18px; color: #333; margin-bottom: 8px; }
.consult-page .success-msg p { color: #999; font-size: 14px; }

/* ========== 用户注册登录 ========== */
.auth-container { padding: 40px 24px; }
.auth-container h2 { text-align: center; font-size: 22px; color: #333; margin-bottom: 8px; }
.auth-container .auth-sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 28px; }
.auth-container .tab-switch { display: flex; margin-bottom: 24px; background: #f0f0f0; border-radius: 10px; padding: 3px; }
.auth-container .tab-switch button { flex: 1; padding: 10px; border: none; background: none; font-size: 14px; border-radius: 8px; cursor: pointer; color: #666; transition: all 0.2s; }
.auth-container .tab-switch button.active { background: #fff; color: #667eea; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.auth-container .form-group { margin-bottom: 16px; }
.auth-container .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.auth-container .form-group input { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 15px; outline: none; transition: border-color 0.2s; }
.auth-container .form-group input:focus { border-color: #667eea; }
.auth-container .auth-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.auth-container .auth-btn:active { opacity: 0.9; }
.auth-container .error-msg { background: #fff0f0; color: #e74c3c; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.auth-container .success-msg { background: #f0fff4; color: #27ae60; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ========== 用户中心 ========== */
.user-dashboard { padding: 16px; }
.user-card { background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 16px; padding: 24px; color: #fff; margin-bottom: 16px; }
.user-card .user-name { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.user-card .user-phone { font-size: 13px; opacity: 0.85; margin-bottom: 16px; }
.user-card .balance-row { display: flex; justify-content: space-between; align-items: center; }
.user-card .balance-label { font-size: 13px; opacity: 0.85; }
.user-card .balance-amount { font-size: 28px; font-weight: 700; }
.user-card .balance-amount small { font-size: 14px; font-weight: 400; }

.dash-section { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.dash-section h3 { font-size: 16px; color: #333; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.qr-wrapper { text-align: center; padding: 16px 0; }
.qr-wrapper .qr-box { display: inline-block; padding: 16px; background: #fff; border: 2px solid #eee; border-radius: 12px; margin-bottom: 12px; }
.qr-wrapper .qr-link { font-size: 12px; color: #667eea; word-break: break-all; margin-top: 8px; }
.qr-wrapper .copy-btn { margin-top: 8px; padding: 8px 20px; background: #667eea; color: #fff; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; }

.dash-section .stat-row { display: flex; gap: 12px; }
.dash-section .stat-item { flex: 1; text-align: center; padding: 12px 0; background: #f8f9ff; border-radius: 10px; }
.dash-section .stat-item .num { font-size: 24px; font-weight: 700; color: #667eea; }
.dash-section .stat-item .label { font-size: 12px; color: #999; margin-top: 4px; }

.dash-section .action-row { display: flex; gap: 12px; margin-top: 12px; }
.dash-section .action-btn { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.dash-section .action-btn.primary { background: #667eea; color: #fff; }
.dash-section .action-btn.outline { background: #fff; color: #667eea; border: 1.5px solid #667eea; }

.logout-link { text-align: center; margin-top: 20px; }
.logout-link a { color: #e74c3c; font-size: 14px; text-decoration: none; }

/* ========== 提现弹窗 ========== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 360px; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { font-size: 18px; margin-bottom: 16px; text-align: center; }
.modal-box .form-group { margin-bottom: 14px; }
.modal-box .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.modal-box .form-group input { width: 100%; padding: 10px 12px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; }
.modal-box .form-group input:focus { border-color: #667eea; }
.modal-box .btn-row { display: flex; gap: 10px; margin-top: 16px; }
.modal-box .btn-row button { flex: 1; padding: 11px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; }
.modal-box .btn-cancel { background: #f0f0f0; color: #666; }
.modal-box .btn-confirm { background: #667eea; color: #fff; }

/* ========== 后台管理 ========== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #1a1a2e; color: #fff; padding: 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 300; transition: transform 0.3s ease; }
.admin-sidebar .sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar .sidebar-header h2 { font-size: 16px; }
.admin-sidebar .sidebar-header p { font-size: 12px; opacity: 0.6; margin-top: 4px; }
.admin-sidebar nav a { display: block; padding: 12px 20px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; white-space: nowrap; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.08); color: #fff; border-left-color: #667eea; }
.admin-main { margin-left: 220px; flex: 1; padding: 24px; min-height: 100vh; background: #f5f6fa; }
.admin-main h1 { font-size: 22px; margin-bottom: 20px; color: #333; }

/* 后台移动端顶栏 */
.admin-topbar { display: none; position: fixed; top: 0; left: 0; right: 0; height: 52px; background: #1a1a2e; color: #fff; z-index: 250; align-items: center; padding: 0 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.admin-topbar .menu-btn { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.admin-topbar .menu-btn:active { background: rgba(255,255,255,0.1); }
.admin-topbar .topbar-title { font-size: 16px; font-weight: 600; margin-left: 12px; }
.admin-sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 290; }

/* 后台卡片 */
.admin-card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow-x: auto; }
.admin-card h3 { font-size: 16px; margin-bottom: 16px; color: #333; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }

/* 后台统计 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.stat-card .stat-num { font-size: 28px; font-weight: 700; color: #667eea; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-top: 6px; }

/* 后台表格 */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.admin-table th { background: #f8f9ff; padding: 10px 12px; text-align: left; font-weight: 600; color: #555; border-bottom: 2px solid #eee; white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
.admin-table tr:hover td { background: #fafbff; }

/* 跟进状态标签 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-pending { background: #fff3e0; color: #e67e22; }
.badge-following { background: #e3f2fd; color: #2196f3; }
.badge-enrolled { background: #e8f5e9; color: #4caf50; }
.badge-approved { background: #e8f5e9; color: #4caf50; }
.badge-rejected { background: #ffebee; color: #e74c3c; }
.badge-waiting { background: #fff3e0; color: #e67e22; }

/* 后台按钮 */
.btn { display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; text-decoration: none; border: none; font-weight: 500; white-space: nowrap; }
.btn-primary { background: #667eea; color: #fff; }
.btn-success { background: #4caf50; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input, .search-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; }
.search-bar input:focus, .search-bar select:focus { border-color: #667eea; }

/* 登录页 */
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e, #16213e); }
.login-box { background: #fff; border-radius: 16px; padding: 40px 32px; width: 360px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.login-box h2 { text-align: center; margin-bottom: 24px; color: #333; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.login-box .form-group input { width: 100%; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 14px; outline: none; }
.login-box .form-group input:focus { border-color: #667eea; }
.login-box .login-btn { width: 100%; padding: 14px; background: #667eea; color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; }
.login-box .error { color: #e74c3c; font-size: 13px; text-align: center; margin-top: 10px; }

/* 编辑器 */
.editor-area { width: 100%; min-height: 300px; border: 1px solid #ddd; border-radius: 8px; padding: 12px; font-size: 14px; line-height: 1.6; resize: vertical; outline: none; }
.editor-area:focus { border-color: #667eea; }

/* ========== 后台管理响应式 ========== */
@media (max-width: 768px) {
    .admin-topbar { display: flex; }
    .admin-sidebar { transform: translateX(-100%); width: 260px; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-sidebar-overlay.show { display: block; }
    .admin-main { margin-left: 0; padding: 16px; padding-top: 68px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-num { font-size: 22px; }
    .admin-card { padding: 14px; border-radius: 10px; }
    .admin-card h3 { font-size: 14px; }
    .admin-main h1 { font-size: 18px; margin-bottom: 14px; }
    .search-bar { flex-direction: column; }
    .search-bar input, .search-bar select { width: 100%; }
    .search-bar .btn { width: 100%; text-align: center; }
    /* 双列布局改单列 */
    .admin-main > div[style*="grid-template-columns: 1fr 1fr"],
    .admin-main > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
    .admin-main { padding: 12px; padding-top: 64px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-card .stat-num { font-size: 20px; }
    .stat-card .stat-label { font-size: 12px; }
}
