* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: bold; letter-spacing: 1px; background: none !important; padding: 0 !important; }
.logo-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; }

nav a { color: white; text-decoration: none; margin-left: 24px; padding: 6px 12px; border-radius: 4px; transition: background 0.3s; }
nav a:hover { background: rgba(255,255,255,0.2); }

/* Pages */
.page { display: none; padding: 2rem 0; min-height: calc(100vh - 160px); }
.page.active { display: block; }
.loading { text-align: center; padding: 40px; color: #666; }

/* Hero Banner */
.hero-banner {
    position: relative;
    color: white;
    padding: 80px 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(26,60,120,0.30) 0%, rgba(40,80,160,0.20) 50%, rgba(20,50,100,0.25) 100%),
        url('https://images.unsplash.com/photo-1587825140708-dfaf72ae4b04?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(26,115,232,0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(102,126,234,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(118,75,162,0.15) 0%, transparent 50%);
    z-index: 1;
}

.hero-banner h1, .hero-banner p {
    position: relative;
    z-index: 2;
}

.hero-banner h1 { font-size: 2.5rem; margin-bottom: 12px; }
.hero-banner p { font-size: 1.2rem; opacity: 0.95; }

/* Filter Bar */
.filter-bar { display: flex; gap: 16px; margin-bottom: 24px; }
.filter-bar select, .filter-bar input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}
.filter-bar input { flex: 1; }

/* Event Cards */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }

.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.event-card:hover { transform: translateY(-6px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

.event-hero {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

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

.event-body { padding: 20px; }
.event-body h3 { margin-bottom: 10px; color: #1a73e8; }
.event-meta { color: #666; font-size: 0.9rem; margin-bottom: 8px; }
.event-category { display: inline-block; background: #e8f0fe; color: #1a73e8; padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; margin-right: 8px; }
.event-mode { display: inline-block; background: #fce8e6; color: #d93025; padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; }

/* Event Detail */
.event-detail-hero {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    background: #f8f9fa;
}

.event-detail-hero img { 
    width: 100%; 
    height: auto; 
    display: block; 
    border-radius: 12px; 
}

.event-detail-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.event-info { background: white; padding: 30px; border-radius: 12px; }
.event-sidebar { position: sticky; top: 80px; }

.ticket-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 12px;
}

.ticket-item .ticket-info { flex: 1; }
.ticket-item .ticket-name { font-weight: bold; margin-bottom: 4px; }
.ticket-item .ticket-price { color: #1a73e8; font-size: 1.2rem; font-weight: bold; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { background: white; padding: 24px; border-radius: 12px; margin-bottom: 20px; }
.form-section h3 { margin-bottom: 16px; color: #1a73e8; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* Buttons */
.btn-primary {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}
.btn-primary:hover { background: #1557b0; }

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}
.btn-secondary:hover { background: #5a6268; }

.btn-danger { background: #dc3545; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.btn-danger:hover { background: #c82333; }

/* Auth Card */
.auth-card {
    background: white;
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.auth-card h2 { text-align: center; margin-bottom: 24px; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-actions { display: flex; gap: 12px; }

.admin-event-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-event-info { flex: 1; }
.admin-event-actions { display: flex; gap: 8px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-card .stat-value { font-size: 2.5rem; font-weight: bold; color: #1a73e8; }
.stat-card .stat-label { color: #666; margin-top: 8px; }

/* Messages */
.message { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.message-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.message-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

/* Share Card & QR */
.share-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}
.share-link-row { display: flex; gap: 8px; }
.share-link-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 0.85rem;
}
.btn-copy {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.btn-copy:hover { background: #bbdefb; }

.qr-section {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}
.qr-tip { text-align: center; font-size: 0.8rem; color: #666; margin-top: 4px; }
.qr-actions { margin-top: 12px; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Hero preview & upload */
#hero-preview, #edit-hero-preview { margin-top: 12px; }
#hero-preview img, #edit-hero-preview img { max-width: 100%; border-radius: 8px; }

.upload-tip {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #888;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid #1a73e8;
}

.upload-status {
    position: relative;
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px dashed #ddd;
    background: #fafafa;
}
.upload-status img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.upload-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.upload-success { border-color: #4caf50; }
.upload-error { border-color: #f44336; background: #ffebee; }

/* Field management */
.field-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}
.field-label { font-weight: 500; flex: 1; }
.field-type-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.field-actions { display: flex; gap: 4px; }

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.btn-share {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}
.btn-share:hover { opacity: 0.85; }
.btn-weixin { background: #07c160; }
.btn-whatsapp { background: #25d366; }
.btn-x { background: #1da1f2; }

/* Footer */
footer { background: #333; color: white; padding: 1.5rem 0; text-align: center; margin-top: 40px; }

/* Responsive */
@media (max-width: 768px) {
    .event-detail-content { grid-template-columns: 1fr; }
    .event-sidebar { position: static; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero-banner h1 { font-size: 1.8rem; }
    .filter-bar { flex-direction: column; }
    .events-grid { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; gap: 12px; }
    nav { display: flex; flex-wrap: wrap; justify-content: center; }
    
    /* 移动端隐藏二维码，节省空间 */
    .qr-section { display: none; }
    .qr-actions { display: none; }
    
    /* 移动端报名表单优化 */
    .btn-primary, .btn-secondary { width: 100%; padding: 14px; font-size: 1rem; }
}
