/* ====== 基础样式 ====== */
* { 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: #f0f9f0;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: #2e7d32; text-decoration: none; }
a:hover { color: #1b5e20; }
img { max-width: 100%; height: auto; }

/* ====== 通用容器 ====== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ====== 头部导航 ====== */
.header {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(67,160,71,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 {
    font-size: 20px;
    font-weight: 600;
}
.header h1 a { color: #fff; }
.header .nav-links a {
    color: rgba(255,255,255,0.9);
    margin-left: 15px;
    font-size: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}
.header .nav-links a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ====== 卡片样式 ====== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e8f5e9;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.card-body { padding: 20px; }

/* ====== 活动列表卡片 ====== */
.event-card {
    display: flex;
    flex-direction: row;
}
.event-card .event-logo {
    width: 120px;
    min-height: 100px;
    background-size: cover;
    background-position: center;
    background-color: #e8f5e9;
    flex-shrink: 0;
}
.event-card .event-info {
    padding: 15px;
    flex: 1;
    min-width: 0;
}
.event-card .event-title {
    font-size: 17px;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-card .event-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 4px;
}
.event-card .event-meta span { margin-right: 12px; }
.event-card .badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-free {
    background: #e8f5e9;
    color: #2e7d32;
}
.badge-paid {
    background: #fff3e0;
    color: #e65100;
}
.badge-ended {
    background: #f5f5f5;
    color: #999;
}

/* ====== 活动详情头部 ====== */
.event-header {
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: #c8e6c9;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.event-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
}
.event-header .header-title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    padding: 15px 20px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    width: 100%;
}

/* ====== 详情信息条 ====== */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
    background: #f9fdf9;
    border-bottom: 1px solid #e8f5e9;
}
.info-bar .info-item {
    flex: 1;
    min-width: 120px;
    font-size: 13px;
    color: #555;
}
.info-bar .info-item strong {
    display: block;
    color: #2e7d32;
    font-size: 12px;
    margin-bottom: 2px;
}

/* ====== 富文本内容区 ====== */
.content-area {
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
}
.content-area img { max-width: 100%; border-radius: 8px; margin: 10px 0; }

/* ====== 按钮 ====== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    line-height: 1.5;
}
.btn-primary {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    color: #fff;
    box-shadow: 0 3px 10px rgba(67,160,71,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #388e3c, #43a047);
    box-shadow: 0 4px 15px rgba(67,160,71,0.4);
    color: #fff;
}
.btn-secondary {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.btn-secondary:hover { background: #c8e6c9; }
.btn-danger {
    background: #ef5350;
    color: #fff;
}
.btn-danger:hover { background: #d32f2f; }
.btn-sm {
    padding: 5px 14px;
    font-size: 13px;
    border-radius: 6px;
}
.btn-block { display: block; width: 100%; }

/* ====== 固定底部报名按钮 ====== */
.fixed-bottom-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 99;
    text-align: center;
}
.fixed-bottom-btn .btn {
    max-width: 400px;
    width: 80%;
    font-size: 17px;
    padding: 12px 0;
    border-radius: 25px;
}
.bottom-spacer { height: 70px; }

/* ====== 表单样式 ====== */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}
.form-group label .required {
    color: #e53935;
    margin-left: 2px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #c8e6c9;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
    color: #333;
    outline: none;
}
.form-control:focus {
    border-color: #43a047;
    box-shadow: 0 0 0 3px rgba(67,160,71,0.15);
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
select.form-control {
    appearance: auto;
}

/* ====== 列表表格 ====== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table th {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #c8e6c9;
}
table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}
table tr:hover td { background: #f9fdf9; }
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}
.status-pending { background: #fff8e1; color: #f57f17; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

/* ====== 评论区 ====== */
.comment-list { margin-top: 15px; }
.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child { border-bottom: none; }
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.comment-nickname {
    font-weight: 600;
    color: #2e7d32;
    font-size: 14px;
}
.comment-time {
    font-size: 12px;
    color: #999;
}
.comment-content {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}
.comment-location {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}

/* ====== 表情选择 ====== */
.emoji-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    padding: 8px;
    background: #f9fdf9;
    border-radius: 8px;
    border: 1px solid #e8f5e9;
}
.emoji-bar span {
    font-size: 22px;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    transition: background 0.2s;
}
.emoji-bar span:hover { background: #e8f5e9; }

/* ====== 分页 ====== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    background: #fff;
}
.pagination span.current {
    background: #43a047;
    color: #fff;
    border-color: #43a047;
}

/* ====== 提示框 ====== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}
.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}
.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

/* ====== 空状态 ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .icon { font-size: 50px; margin-bottom: 10px; }
.empty-state p { font-size: 15px; }

/* ====== 后台样式 ====== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1b5e20, #2e7d32);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    overflow-y: auto;
}
.admin-sidebar .logo {
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.admin-sidebar .menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.admin-sidebar .menu a:hover,
.admin-sidebar .menu a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: #a5d6a7;
}
.admin-sidebar .menu a .icon { margin-right: 8px; }
.admin-main {
    flex: 1;
    margin-left: 220px;
    background: #f5f9f5;
    min-height: 100vh;
}
.admin-topbar {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-topbar h2 { font-size: 18px; color: #333; }
.admin-content { padding: 24px; }

/* ====== 后台统计卡片 ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-top: 3px solid #43a047;
}
.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: #2e7d32;
}
.stat-card .label {
    font-size: 13px;
    color: #777;
    margin-top: 4px;
}

/* ====== 后台表格增强 ====== */
.admin-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-table .table-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-table .table-header h3 {
    font-size: 16px;
    color: #333;
}

/* ====== 模态框 ====== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 17px; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .header h1 { font-size: 17px; }
    .header .nav-links a { margin-left: 8px; font-size: 13px; padding: 4px 8px; }
    
    .event-card { flex-direction: column; }
    .event-card .event-logo { width: 100%; height: 140px; }
    
    .admin-sidebar {
        position: fixed;
        left: -220px;
        transition: left 0.3s;
    }
    .admin-sidebar.open { left: 0; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 15px; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card .number { font-size: 24px; }
    
    .info-bar { flex-direction: column; gap: 8px; }
    
    table { font-size: 13px; }
    table th, table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .container { padding: 0 10px; }
    .card-body { padding: 15px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ====== 加载动画 ====== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #c8e6c9;
    border-top-color: #43a047;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 搜索栏 ====== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-bar .form-control { flex: 1; min-width: 200px; }
.search-bar .btn { flex-shrink: 0; }

/* ====== 工具栏 ====== */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.toolbar .spacer { flex: 1; }

/* ====== 切换开关 ====== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { display: none; }
.switch .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}
.switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch input:checked + .slider { background: #43a047; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ====== 汉堡菜单按钮 ====== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
}
.sidebar-overlay.active { display: block; }