/* ========================================
   活动聚 - 全局样式（PC + 手机端自适应）
   ======================================== */

/* ---- 变量 ---- */
:root {
    --primary: #FF6B35;
    --primary-dark: #E85A2A;
    --primary-light: #FFF0E8;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --info: #2196F3;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #F5F5F5;
    --white: #FFF;
    --border: #E5E5E5;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

/* ---- 重置 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* 触控设备优化 */
@media (hover: none) and (pointer: coarse) {
    a, button, .btn, .city-option, .filter-tag, .sort-tab, .tag-option, .profile-tab, .pagination button {
        -webkit-tap-highlight-color: transparent;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }

.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }

.btn-success { background: var(--success); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #D32F2F; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: var(--text); }
.form-group .required::after { content: ' *'; color: var(--danger); }

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--white);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-select { cursor: pointer; appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-group.error .form-input, .form-group.error .form-textarea { border-color: var(--danger); }
.form-group.error .form-error { display: block; }

/* ---- 导航栏 ---- */
.header {
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    height: 60px;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text) !important;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon { font-size: 26px; }
.nav-links { display: flex; align-items: center; gap: 8px; margin-left: 20px; }
.nav-links a {
    color: var(--text-light);
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-light); }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* 城市选择器 */
.city-selector {
    position: relative;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg);
    user-select: none;
    white-space: nowrap;
}
.city-selector:hover { background: var(--border); }
.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 8px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    min-width: 360px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 200;
}
.city-dropdown.show { display: grid; }
.city-option {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
}
.city-option:hover { background: var(--primary-light); color: var(--primary); }

/* 用户下拉 */
.user-dropdown { position: relative; cursor: pointer; }
.user-avatar img, .avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.avatar-placeholder {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    min-width: 180px;
    display: none;
    z-index: 200;
}
.dropdown-menu.show { display: block; }
.dropdown-header { padding: 12px 16px 8px; font-size: 14px; border-bottom: 1px solid var(--border); }
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}
.dropdown-menu a:hover { background: var(--bg); color: var(--text); }
.dropdown-menu hr { margin: 4px 0; border: none; border-top: 1px solid var(--border); }

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text);
    margin-left: auto;
}

/* 移动端侧栏 */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    z-index: 300;
    transition: right 0.3s;
    overflow-y: auto;
}
.mobile-sidebar.open { right: 0; }
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 250;
    display: none;
}
.sidebar-overlay.show { display: block; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); font-size: 16px; }
.sidebar-close { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.sidebar-nav a {
    display: block;
    padding: 14px 20px;
    color: var(--text);
    font-size: 15px;
    border-bottom: 1px solid var(--bg);
    transition: background 0.2s;
}
.sidebar-nav a:hover { background: var(--bg); }
.sidebar-nav hr { margin: 8px 0; border: none; border-top: 1px solid var(--border); }

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 24px;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 14px;
    box-shadow: var(--shadow-hover);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-hiding { animation: toastOut 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

/* ---- 底部 ---- */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding: 40px 0 20px;
}
.footer-content { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand h3 { font-size: 18px; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); }
.footer-links h4 { font-size: 14px; margin-bottom: 12px; }
.footer-links a { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---- 卡片 ---- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* ---- 主内容 ---- */
.main-content { padding: 24px 0; flex: 1; }

/* ---- 活动卡片 ---- */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.activity-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.activity-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.activity-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #E8E8E8;
}

.activity-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }

.activity-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.activity-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
}

.activity-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.activity-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #F0F0F0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- 页面通用 ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title { font-size: 24px; font-weight: 700; }

/* ---- 筛选栏 ---- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    color: var(--text-light);
    white-space: nowrap;
}
.filter-tag:hover, .filter-tag.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.sort-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 3px;
    flex-wrap: wrap;
}
.sort-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-light);
    transition: all 0.2s;
    white-space: nowrap;
}
.sort-tab:hover { color: var(--primary); }
.sort-tab.active { background: var(--white); color: var(--primary); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ---- 搜索框 ---- */
.search-box {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}
.search-box input {
    flex: 1;
    padding: 8px 14px;
    border: none;
    outline: none;
    font-size: 14px;
    min-width: 0;
}
.search-box input::placeholder { color: var(--text-muted); opacity: 1; }
.search-box button {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
.search-box button:hover { background: var(--primary-dark); }

/* ---- 图片上传预览 ---- */
.image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-top: 8px;
    display: none;
}

/* ---- 模态框 ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h3 { margin-bottom: 12px; font-size: 18px; }
.modal-close { float: right; background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* ---- 分页 ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    min-width: 40px;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination button:disabled { color: var(--text-muted); cursor: not-allowed; }

/* ---- 活动详情页 ---- */
.activity-detail { max-width: 800px; margin: 0 auto; }

.activity-detail-header { margin-bottom: 24px; }

.activity-detail-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.activity-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}
.activity-detail-meta span { display: flex; align-items: center; gap: 4px; }

.activity-detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.activity-detail-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.activity-detail-body {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.activity-detail-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

/* 活动详情页 PC 端双栏布局 */
.detail-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.detail-main {
    flex: 1;
    min-width: 0;
}
.detail-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 参与者进度条 */
.participant-progress {
    height: 8px;
    background: #F0F0F0;
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}
.participant-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

/* 参与者头像列表 */
.participant-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.participant-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg);
}
.participant-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- 评论区 ---- */
.comment-section { margin-top: 32px; }
.comment-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.comment-form .user-avatar { flex-shrink: 0; width: 40px; height: 40px; }
.comment-form-content { flex: 1; min-width: 0; }
.comment-form-content textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 60px;
    font-size: 14px;
}
.comment-form-content textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #F5F5F5;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--bg);
    overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.comment-time { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.comment-text { font-size: 14px; color: var(--text); line-height: 1.6; word-break: break-word; }
.comment-reply { font-size: 13px; color: var(--text-muted); cursor: pointer; margin-top: 8px; }
.comment-reply:hover { color: var(--primary); }

/* 回复区域 */
.comment-replies {
    margin-left: 52px;
    padding-left: 16px;
    border-left: 2px solid #F0F0F0;
}
.comment-replies .comment-item { padding: 12px 0; border-bottom: none; }
.comment-replies .comment-avatar { width: 32px; height: 32px; }

/* ---- 认证页面（登录/注册）---- */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-card h2 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.auth-switch { text-align: center; font-size: 14px; margin-top: 20px; color: var(--text-muted); }

/* ---- 活动发布/编辑页 ---- */
.activity-form-page { max-width: 700px; margin: 0 auto; }
.activity-form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
}

/* 标签选择器 */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-selector .tag-option {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.tag-selector .tag-option:hover { border-color: var(--primary); }
.tag-selector .tag-option.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* 费用设置 */
.fee-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    inset: 0;
    background: #CCC;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.fee-fields { display: none; margin-top: 12px; }
.fee-fields.show { display: block; }

/* ---- 个人中心 ---- */
.profile-page { max-width: 800px; margin: 0 auto; }
.profile-header-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}
.profile-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .avatar-placeholder { width: 100%; height: 100%; font-size: 32px; }
.profile-info { flex: 1; min-width: 0; }
.profile-info h3 { font-size: 20px; margin-bottom: 4px; }
.profile-info p { font-size: 14px; color: var(--text-muted); margin-bottom: 2px; }

.profile-tabs {
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.profile-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-light);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.profile-tab:hover { color: var(--primary); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---- 管理后台 ---- */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar {
    width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.admin-sidebar a {
    display: block;
    padding: 12px 24px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}
.admin-sidebar .sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.admin-content { flex: 1; padding: 24px; overflow-x: auto; min-width: 0; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }

/* 管理后台图表区 */
.admin-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.admin-charts .chart-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.admin-charts .chart-card h4 { margin-bottom: 12px; font-size: 15px; }

/* ---- 数据表格 ---- */
.data-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.data-table table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: #FAFAFA;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #F5F5F5;
}
.data-table tr:hover td { background: #FAFAFA; }

/* ---- 状态标签 ---- */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.status-draft { background: #F5F5F5; color: #999; }
.status-published { background: #E8F5E9; color: #388E3C; }
.status-cancelled { background: #FFEBEE; color: #D32F2F; }
.status-completed { background: #E3F2FD; color: #1976D2; }

/* ---- 加载动画 ---- */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}
.loading::before {
    content: '⏳ ';
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---- 空状态 ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 16px; margin-bottom: 8px; }
.empty-state .empty-hint { font-size: 13px; }


/* ========================================
   响应式设计 - 平板（≤1024px）
   ======================================== */
@media (max-width: 1024px) {
    .activity-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-charts { grid-template-columns: 1fr; }

    /* 活动详情侧边栏变窄 */
    .detail-sidebar { width: 260px; }
}

/* ========================================
   响应式设计 - 平板竖屏 / 大屏手机（≤768px）
   ======================================== */
@media (max-width: 768px) {
    /* -- 容器 -- */
    .container { padding: 0 12px; }

    /* -- 导航栏 -- */
    .header-inner { gap: 10px; }
    .nav-links { display: none; }
    .header-actions .user-dropdown { display: none; }
    .guest-actions .btn { display: inline-flex; }
    .mobile-menu-btn { display: block; }
    .logo { font-size: 18px; }
    .logo-icon { font-size: 22px; }

    /* 城市选择器：手机上缩小 */
    .city-selector { font-size: 12px; padding: 5px 8px; }
    .city-dropdown {
        left: auto;
        right: -40px; /* 右对齐防溢出 */
        min-width: 280px;
        grid-template-columns: repeat(3, 1fr);
    }

    /* -- 活动卡片 -- */
    .activity-grid { grid-template-columns: 1fr; gap: 14px; }
    .activity-card-img { height: 200px; }

    /* -- 筛选栏 -- */
    .filter-bar {
        padding: 12px;
        gap: 10px;
    }
    .filter-bar .sort-tabs { width: 100%; }
    .filter-bar .sort-tabs + label { margin-left: auto !important; }

    /* -- 搜索框 -- */
    .search-box { width: 100%; }
    .search-box input { font-size: 16px; } /* 防止 iOS 缩放 */

    /* -- 活动详情页 -- */
    .detail-layout { flex-direction: column; }
    .detail-sidebar { width: 100%; }
    .activity-detail-title { font-size: 22px; }
    .activity-detail-meta { flex-direction: column; gap: 8px; }
    .activity-detail-body { padding: 16px; }
    .activity-detail-sidebar { padding: 16px; }
    .activity-detail-cover { max-height: 280px; }

    /* -- 评论 -- */
    .comment-replies { margin-left: 20px; }
    .comment-replies .comment-avatar { width: 28px; height: 28px; }
    .comment-avatar { width: 36px; height: 36px; }
    .comment-form .user-avatar { width: 36px; height: 36px; }
    .comment-item { padding: 12px 0; }

    /* -- 个人中心 -- */
    .profile-page { max-width: 100%; }
    .profile-header-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }
    .profile-avatar { width: 70px; height: 70px; }
    .profile-header-card .btn { align-self: center; }
    .profile-tab { font-size: 13px; padding: 10px 8px; }

    /* -- 表单页 -- */
    .auth-card { padding: 28px 20px; max-width: 100%; margin: 0 8px; }
    .auth-card h2 { font-size: 22px; }
    .activity-form-card { padding: 20px 16px; }

    /* -- Toast -- */
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 400px;
        align-items: center;
    }
    .toast {
        max-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    @keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

    /* -- 分页 -- */
    .pagination { gap: 4px; }
    .pagination button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
    }

    /* -- 底部 -- */
    .footer { padding: 30px 0 16px; }
    .footer-content { gap: 24px; flex-direction: column; }
    .footer-brand, .footer-links { text-align: center; }
    .footer-bottom { margin-top: 20px; }

    /* -- 管理后台 -- */
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        -webkit-overflow-scrolling: touch;
    }
    .admin-sidebar > *:first-child {
        /* 标题区域：移动端折叠为按钮 */
        padding: 12px 16px;
        font-size: 16px;
        border-bottom: none;
        flex-shrink: 0;
        white-space: nowrap;
    }
    .admin-sidebar a {
        padding: 14px 16px;
        border-right: none;
        border-bottom: 2px solid transparent;
        flex-shrink: 0;
    }
    .admin-sidebar a.active {
        border-right: none;
        border-bottom: 2px solid var(--primary);
        background: transparent;
    }
    .admin-sidebar .sidebar-footer { display: none; }
    .admin-content { padding: 16px 12px; }

    .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 22px; }

    /* 管理后台图表 */
    .admin-charts { grid-template-columns: 1fr; gap: 14px; }

    /* -- 数据表格 -- */
    .data-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius);
    }
    .data-table th, .data-table td { padding: 10px 12px; font-size: 13px; }
    .admin-content .data-table {
        margin: 0 -4px;
        width: auto;
    }

    /* 页面标题 */
    .page-title { font-size: 20px; }

    /* iOS 输入防止缩放 + 触控优化 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="datetime-local"],
    textarea { font-size: 16px !important; }

    .btn, button { min-height: 44px; }
    .btn-sm { min-height: 36px; padding: 8px 14px; }

    /* 模态框全屏 */
    .modal { max-width: 100%; margin: 0 12px; border-radius: var(--radius-lg); padding: 20px; }
    .modal-overlay { padding: 12px; align-items: flex-end; }
}

/* ========================================
   响应式设计 - 小屏手机（≤480px）
   ======================================== */
@media (max-width: 480px) {
    /* -- 导航栏 -- */
    .header-inner { height: 52px; gap: 8px; }
    .logo { font-size: 16px; }
    .logo .logo-text { display: none; } /* 只显示图标 */
    .city-selector { display: none; } /* 太小了直接隐藏 */
    .city-dropdown {
        min-width: 240px;
        grid-template-columns: repeat(3, 1fr);
    }

    /* -- 活动卡片 -- */
    .activity-grid { gap: 12px; }
    .activity-card-img { height: 170px; }
    .activity-card-body { padding: 12px; }
    .activity-card-title { font-size: 15px; }

    /* -- 筛选栏 -- */
    .filter-bar {
        padding: 10px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    .filter-tag { padding: 5px 12px; font-size: 12px; }
    .sort-tab { padding: 5px 10px; font-size: 12px; }

    /* -- 活动详情 -- */
    .activity-detail-title { font-size: 18px; }
    .activity-detail-meta { font-size: 13px; }
    .activity-detail-body { padding: 14px; }
    .activity-detail-sidebar { padding: 14px; }

    /* -- 评论 -- */
    .comment-replies { margin-left: 12px; padding-left: 10px; }
    .comment-avatar { width: 32px; height: 32px; }
    .comment-replies .comment-avatar { width: 24px; height: 24px; }
    .comment-form { gap: 8px; }
    .comment-form .user-avatar { width: 32px; height: 32px; }
    .comment-form-content textarea { min-height: 50px; font-size: 14px; }
    .comment-author { font-size: 13px; }
    .comment-text { font-size: 13px; }

    /* -- 认证页 -- */
    .auth-card { padding: 24px 16px; }
    .auth-card h2 { font-size: 20px; }

    /* -- 活动表单 -- */
    .activity-form-card { padding: 16px 12px; }

    /* -- 个人中心 -- */
    .profile-header-card { padding: 16px; }
    .profile-avatar { width: 60px; height: 60px; }
    .profile-info h3 { font-size: 18px; }
    .profile-tab { font-size: 12px; padding: 8px 6px; }

    /* -- 管理后台 -- */
    .admin-stats { grid-template-columns: 1fr; }
    .admin-content { padding: 12px 8px; }
    .stat-card .stat-value { font-size: 20px; }

    /* -- 分页 -- */
    .pagination { gap: 3px; }
    .pagination button {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 32px;
    }

    /* -- Toast -- */
    .toast-container { width: calc(100% - 20px); }
    .toast { padding: 10px 16px; font-size: 13px; }

    /* -- 页面标题 -- */
    .page-title { font-size: 18px; }
    .page-header { flex-direction: column; align-items: flex-start; }

    /* -- 标签选择器 -- */
    .tag-selector .tag-option { padding: 5px 12px; font-size: 12px; }

    /* -- 按钮 -- */
    .btn-lg { padding: 10px 20px; font-size: 15px; }
}

/* ========================================
   响应式设计 - 大屏幕优化（≥1400px）
   ======================================== */
@media (min-width: 1400px) {
    .container { max-width: 1300px; }
    .activity-grid { grid-template-columns: repeat(4, 1fr); }
}
