* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f9fafb;
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* 通用 */
.h-safe-bottom { height: env(safe-area-inset-bottom, 0px); }
.overflow-x-auto { overflow-x: auto; }

/* 顶部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #f3f4f6;
}
.header-inner {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    position: relative;
}
.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}
.header-btn-right {
    position: absolute;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color .2s;
}
.header-btn-right:hover { color: #4b5563; }
.header-btn-left {
    position: absolute;
    left: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

/* 主内容 */
.main { padding: 16px; padding-bottom: 32px; }

/* 公众号卡片 */
.qr-banner {
    background: linear-gradient(135deg, #111827 0%, #374151 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}
.qr-banner::before {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}
.qr-banner::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 40px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}
.qr-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}
.qr-banner-info { flex: 1; min-width: 0; }
.qr-banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}
.qr-banner-tag-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4ade80;
}
.qr-banner-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.qr-banner-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}
.qr-banner-meta {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}
.qr-banner-meta strong { font-weight: 500; }
.qr-banner-meta-arrow { opacity: 0.5; }
.qr-banner-meta-sub { color: rgba(255, 255, 255, 0.5); }
.qr-banner-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}
.qr-banner-code-wrap {
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}
.qr-banner-code-wrap img {
    display: block;
    width: 128px;
    height: 128px;
    object-fit: contain;
    pointer-events: auto;
    -webkit-touch-callout: default;
}
.qr-banner-code-text {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 报名查询按钮 */
.query-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.query-btn:active {
    transform: scale(0.98);
    background: #1f2937;
}

/* 二维码放大弹层 */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 32px;
}
.qr-modal.show { display: flex; }
.qr-modal img {
    width: 80vw;
    max-width: 360px;
    height: auto;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
    pointer-events: auto;
}
.qr-modal-tip {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-top: 20px;
    text-align: center;
    line-height: 1.6;
}
.qr-modal-close {
    margin-top: 24px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

/* 活动列表 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}
.section-count {
    font-size: 12px;
    color: #9ca3af;
}
.activity-list { display: flex; flex-direction: column; gap: 12px; }

.activity-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.2s;
    display: block;
    border: 1px solid transparent;
}
.activity-card:hover {
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.03);
}
.activity-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.activity-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.activity-status-dot.status-open {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
.activity-status-dot.status-closed,
.activity-status-dot.status-ended,
.activity-status-dot.status-not-started,
.activity-status-dot.status-full {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}
.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-count {
    font-size: 12px;
    color: #9ca3af;
}
.activity-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}
.activity-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 活动详情 */
.detail-images {
    position: relative;
    background: #000;
    width: 100%;
    max-width: 100%;
}
.detail-images img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    display: block;
}
.detail-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}
.detail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    padding: 0;
}
.detail-dot.active {
    background: #fff;
    width: 16px;
}
.detail-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}
.detail-arrow.prev { left: 8px; }
.detail-arrow.next { right: 8px; }

.detail-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
}
.detail-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.detail-info { flex: 1; min-width: 0; }
.detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    word-break: break-all;
    overflow-wrap: break-word;
}
.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}
.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.detail-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.8;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.detail-time-list { display: flex; flex-direction: column; gap: 8px; }
.detail-time-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    word-break: break-all;
    overflow-wrap: break-word;
    flex-wrap: wrap;
}
.detail-time-icon { color: #9ca3af; }
.detail-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.detail-status.not-started { background: #fef3c7; color: #92400e; }
.detail-status.open { background: #dcfce7; color: #166534; }
.detail-status.ended { background: #fee2e2; color: #991b1b; }

/* 按钮 */
.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #111827;
    color: #fff;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background: #1f2937; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}
.btn-secondary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: #fff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-secondary:active { transform: scale(0.99); }

/* 表单 */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.15s;
    outline: none;
}
.form-input:focus {
    border-color: #111827;
    background: #fff;
}
.form-error {
    margin-top: 6px;
    font-size: 12px;
    color: #ef4444;
}
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}
.form-select:focus { border-color: #111827; background: #fff; }
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    font-family: inherit;
}
.form-textarea:focus { border-color: #111827; background: #fff; }

/* 序号展示 */
.serial-box {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 20px;
}
.serial-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}
.serial-number {
    font-size: 48px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.serial-tip {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* 成功页 */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.success-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}
.success-desc {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}
.info-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.info-dt { font-size: 13px; color: #9ca3af; }
.info-dd { font-size: 14px; font-weight: 500; color: #111827; word-break: break-all; }

/* 二维码卡片 */
.qr-code-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.qr-code-img { width: 96px; height: 96px; object-fit: contain; }
.qr-code-title {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    text-align: center;
}
.qr-code-caption {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

/* 动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeInUp 0.4s ease-out both; }
