/* 全局样式 */
* {
    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-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #34495e;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.back-links {
    margin-top: 1.5rem;
    text-align: center;
}

.back-links a {
    color: #3498db;
    text-decoration: none;
    margin: 0 0.5rem;
    font-size: 0.9rem;
}

.back-links a:hover {
    text-decoration: underline;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-inline input {
    flex: 1;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219150;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* 提示框 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-dismissible .close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Dashboard 样式 */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.user-info {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    position: relative;
}

.nav-link:hover {
    background-color: #34495e;
}

.nav-link.active {
    background-color: #3498db;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    background-color: #95a5a6;
    color: white;
    margin-left: 0.5rem;
}

.badge-success {
    background-color: #27ae60;
}

.badge-danger {
    background-color: #e74c3c;
}

.badge-warning {
    background-color: #f39c12;
}

.badge-info {
    background-color: #3498db;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid #34495e;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #f5f5f5;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    color: #2c3e50;
    font-size: 2rem;
}

/* 活动卡片 */
.activities-list,
.activities-grid {
    display: grid;
    gap: 1.5rem;
}

.activities-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.activity-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
}

.activity-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.activity-card.ended {
    opacity: 0.7;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.activity-header h3 {
    color: #2c3e50;
    font-size: 1.25rem;
}

.activity-desc {
    color: #7f8c8d;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.activity-info,
.activity-meta,
.activity-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.activity-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

/* 活动详情表单 */
.activity-detail {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-detail h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.activity-detail p {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

/* 活动操作按钮 */
.activity-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.activity-actions form {
    display: inline;
}

/* 活动审批人信息 */
.activity-approver {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ecf0f1;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.activity-approver span {
    display: block;
    margin-bottom: 0.25rem;
}

/* 预约表单 */
.booking-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

.booking-form h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* 表单卡片 */
.form-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.form-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* 申请卡片 */
.applications-list,
.members-list,
.blacklist-list {
    display: grid;
    gap: 1rem;
}

.application-card,
.member-card,
.blacklist-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.application-card h3,
.member-card h4,
.blacklist-card h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.application-card p,
.member-card p,
.blacklist-card p {
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.application-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* 理事管理部分 */
.council-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .council-section {
        grid-template-columns: 1fr;
    }
}

/* 黑名单部分 */
.blacklist-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .blacklist-section {
        grid-template-columns: 1fr;
    }
}

/* 预约列表表格 */
.bookings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bookings-table th,
.bookings-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.bookings-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.bookings-table tr:hover {
    background-color: #f8f9fa;
}

.bookings-table code {
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* 搜索框 */
.search-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.search-box form {
    display: flex;
    gap: 1rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 预约结果 */
.booking-result {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.booking-result h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.result-card {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.result-card p {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* 取消预约区域 */
.cancel-booking-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

/* 预约表单禁用状态 */
.booking-form.disabled {
    opacity: 0.6;
}

.booking-form.disabled h4 {
    color: #95a5a6;
}

.booking-form.disabled p {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* 活动满员状态 */
.activity-card.full {
    border: 2px solid #e74c3c;
}

/* 空状态 */
.empty,
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 章节标题 */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
}

/* 活动小卡片 */
.activities-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.activity-card-small {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.activity-card-small h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.activity-card-small p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .activities-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .bookings-table {
        display: block;
        overflow-x: auto;
    }
}

/* 文本居中 */
.text-center {
    text-align: center;
}

/* 页面特定样式 */
.guest-page {
    background-color: #f8f9fa;
}

/* 模态弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
    background-color: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}

.modal-close:hover {
    background-color: #e74c3c;
    color: white;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 代码框样式 */
.code-box {
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #2c3e50;
    border: 1px solid #ddd;
}

/* 邀请码列表 */
.invitation-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .invitation-section {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* 邀请码显示区域 */
.codes-display {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.codes-display code {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* 错误提示 */
.error {
    color: #e74c3c;
}

/* 小字提示 */
.small {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* 邀请码列表 */
.invitation-list {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.invitation-list h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* 活动详情样式 */
.activity-detail {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.activity-detail h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.activity-detail p {
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

/* 按钮颜色扩展 */
.btn-info {
    background-color: #3498db;
    color: white;
}

.btn-info:hover {
    background-color: #2980b9;
}

/* 必填标记 */
.required {
    color: #e74c3c;
}
