/* ========================================
   演讲会H5签到核销管理系统 - 全局样式
   ======================================== */

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

:root {
    --primary: #1a3c5e;
    --primary-light: #2a5f8f;
    --primary-dark: #0f2440;
    --accent: #c9a84c;
    --accent-light: #e0c878;
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --warning: #f57f17;
    --warning-bg: #fff8e1;
    --info: #1565c0;
    --info-bg: #e3f2fd;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e0e0e0;
    --text: #212121;
    --text-secondary: #757575;
    --text-light: #9e9e9e;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* 容器 */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
}

/* 头部 */
.header {
    text-align: center;
    padding: 32px 0 24px;
}

.header .logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 1px;
}

.header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 卡片 */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-light);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #fff;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 2px 8px rgba(26, 60, 94, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #b8942f);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #43a047);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #e53935);
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-group .btn {
    flex: 1;
}

/* 输入框 */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    transition: all var(--transition);
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,60,94,0.1);
}

.input-field::placeholder {
    color: var(--text-light);
}

/* 信息展示 */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

/* 二维码区域 */
.qr-wrapper {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    margin: 16px 0;
}

.qr-wrapper img {
    width: 220px;
    height: 220px;
    display: block;
    margin: 0 auto;
}

.qr-wrapper.refunded {
    border-color: var(--danger);
    opacity: 0.6;
}

.qr-wrapper.refunded img {
    filter: grayscale(100%) opacity(0.5);
}

.qr-refund-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-number.danger { color: var(--danger); }
.stat-number.success { color: var(--success); }
.stat-number.warning { color: var(--warning); }

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 列表 */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.list-item:hover {
    box-shadow: var(--shadow);
}

.list-item-left {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.list-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.list-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    text-align: center;
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

.toast-info {
    background: var(--info);
    color: #fff;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 加载 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-body { margin-bottom: 20px; }

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

/* 顶部导航栏 */
.navbar {
    background: var(--primary-dark);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
}

.navbar-back {
    font-size: 15px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
}

.navbar-action {
    font-size: 14px;
    color: var(--accent-light);
    cursor: pointer;
    background: none;
    border: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.pagination .page-info {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 入口按钮组 */
.entry-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.entry-btn {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
}

.entry-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.entry-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 14px;
    flex-shrink: 0;
}

.entry-btn-icon.attendee {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--info);
}

.entry-btn-icon.checker {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--success);
}

.entry-btn-icon.admin {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: var(--warning);
}

.entry-btn-title {
    font-size: 17px;
    font-weight: 600;
}

.entry-btn-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 文件上传 */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}

.upload-zone:hover {
    border-color: var(--primary-light);
    background: #f0f4f8;
}

.upload-zone .upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.upload-zone p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-zone .hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 扫码区域 */
.scan-area {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    aspect-ratio: 1;
}

.scan-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 0 1000px rgba(0,0,0,0.4);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { top: 0; }
    50% { top: calc(100% - 2px); }
    100% { top: 0; }
}

/* 响应式 */
@media (max-width: 360px) {
    .container { padding: 12px 10px; }
    .card { padding: 16px 14px; }
    .btn { padding: 12px 20px; font-size: 15px; }
    .header h1 { font-size: 20px; }
}