/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

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

.hidden {
    display: none !important;
}

/* ==================== 头部样式 ==================== */
.header {
    background: var(--surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    padding: 8px 20px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* ==================== 主内容区域 ==================== */
.main-content {
    min-height: calc(100vh - 72px);
    padding: 24px 0;
}

/* ==================== 筛选区域 ==================== */
.filters {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.filter-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 140px;
}

.filter-separator {
    align-self: center;
    color: var(--text-light);
}

.filter-categories {
    flex: 1;
    min-width: 200px;
}

.category-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.category-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* ==================== 日历视图 ==================== */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text);
}

.calendar-grid {
    display: grid;
    gap: 24px;
}

.calendar-day {
    margin-bottom: 16px;
}

.calendar-day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-day-date {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.calendar-day-weekday {
    color: var(--text-light);
}

.events-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.event-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.event-card-image {
    height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-card-content {
    padding: 16px;
}

.event-card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.event-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.event-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.event-card-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-large {
    max-width: 900px;
}

.modal-full {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100%;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--background);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-light);
    z-index: 10;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

/* ==================== 活动详情 ==================== */
.event-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.event-detail-image {
    height: 100%;
    min-height: 300px;
}

.event-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 300px;
}

.event-detail-info {
    padding: 24px;
}

.event-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.event-detail-info h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.event-venue {
    color: var(--text-light);
    margin-bottom: 8px;
}

.event-time {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.event-time .timezone {
    display: block;
    font-size: 0.75rem;
    color: var(--warning);
}

.event-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

.seat-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-light);
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-dot.available {
    background: var(--success);
}

.legend-dot.selected {
    background: var(--primary);
}

.legend-dot.sold {
    background: var(--secondary);
}

/* ==================== 座位选择 ==================== */
.seat-selection {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.seat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.seat-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.selected-seats-info {
    text-align: right;
    background: var(--background);
    padding: 12px 20px;
    border-radius: 8px;
}

.selected-seats-info p {
    margin: 4px 0;
    font-size: 0.875rem;
}

.selected-seats-info strong {
    color: var(--primary);
    font-size: 1.125rem;
}

.stage-indicator {
    text-align: center;
    padding: 16px;
    background: linear-gradient(to bottom, #fef3c7, transparent);
    color: #d97706;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 4px;
}

.seat-map {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background);
}

.seat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

/* SVG 座位 */
.seat {
    cursor: pointer;
    transition: all 0.2s ease;
}

.seat.available {
    fill: var(--success);
}

.seat.available:hover {
    fill: #16a34a;
}

.seat.selected {
    fill: var(--primary);
}

.seat.sold {
    fill: var(--secondary);
    cursor: not-allowed;
}

.seat-label {
    font-size: 10px;
    fill: white;
    pointer-events: none;
    text-anchor: middle;
}

/* ==================== 门票 ==================== */
.ticket {
    padding: 24px;
}

.ticket-header {
    text-align: center;
    margin-bottom: 20px;
}

.ticket-header h2 {
    color: var(--primary);
}

.ticket-body {
    background: var(--background);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.ticket-body h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text);
}

.ticket-body > p {
    color: var(--text-light);
    margin-bottom: 8px;
}

.ticket-seats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.ticket-seat {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.ticket-price {
    font-size: 1.5rem;
    color: var(--success);
    font-weight: 600;
    margin: 16px 0;
}

.qrcode {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.qrcode img {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background: white;
}

.ticket-booking-id {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    font-family: monospace;
}

.ticket-footer {
    display: flex;
    gap: 12px;
}

/* ==================== 管理员仪表盘 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.chart-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 1.125rem;
    margin-bottom: 20px;
    color: var(--text);
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    min-width: 120px;
    font-size: 0.875rem;
}

.chart-bar-value {
    min-width: 60px;
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-light);
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--background);
    border-radius: 12px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.bookings-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.table-responsive {
    overflow-x: auto;
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
}

.bookings-table th,
.bookings-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.bookings-table th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-light);
}

.bookings-table td {
    font-size: 0.875rem;
}

.bookings-table .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.bookings-table .status.confirmed {
    background: #dcfce7;
    color: #166534;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-input, .filter-select {
        width: 100%;
    }

    .events-row {
        grid-template-columns: 1fr;
    }

    .event-detail {
        grid-template-columns: 1fr;
    }

    .event-detail-image {
        height: 200px;
    }

    .event-detail-image img {
        min-height: 200px;
    }

    .seat-header {
        flex-direction: column;
        gap: 16px;
    }

    .selected-seats-info {
        text-align: left;
        width: 100%;
    }

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

    .nav-btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }

    .nav {
        width: 100%;
    }

    .nav-btn {
        flex: 1;
    }

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

    .seat-legend {
        flex-direction: column;
        gap: 8px;
    }

    .seat-map {
        padding: 10px;
    }

    .ticket-footer {
        flex-direction: column;
    }
}
