/**
 * 俊侑股份有限公司尾牙抽獎系統
 * 主要樣式表
 */

/* ===== 全域設定 ===== */
:root {
    /* 色彩系統 - 吉祥話燙金色系 */
    --primary: linear-gradient(135deg, #ffd700 0%, #ff9800 50%, #ff5722 100%);
    --primary-solid: #ff9800;
    --secondary: linear-gradient(135deg, #ffd700 0%, #ff8f00 50%, #e65100 100%);
    --accent: linear-gradient(135deg, #ffe082 0%, #ffd700 50%, #ffb300 100%);
    --success: #10b981;
    --warning: #ffd700;
    --danger: #ef4444;
    --gold: #ffd700;

    /* 背景色 */
    --bg-dark: #0b0f19;
    --bg-card: rgba(22, 28, 45, 0.85);
    --bg-card-hover: rgba(35, 45, 70, 0.95);

    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    /* 間距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* 圓角 */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    /* 陰影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(255, 215, 0, 0.45);
}

/* 1. 喜慶朱紅 (Festive Red) - 深紅酒黑底 + 璀璨金紅 */
body.theme-period {
    --primary: linear-gradient(135deg, #ffd700 0%, #ff4d4f 50%, #d3202f 100%);
    --primary-solid: #ff4d4f;
    --secondary: linear-gradient(135deg, #ffd700 0%, #ff4d4f 100%);
    --accent: linear-gradient(135deg, #ffe082 0%, #ffd700 100%);
    --success: #10b981;
    --warning: #ffd700;
    --danger: #ef4444;

    --bg-dark: #18080a;
    --bg-card: rgba(45, 18, 22, 0.88);
    --bg-card-hover: rgba(60, 24, 30, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #fecdd3;
    --text-muted: #fda4af;

    --shadow-glow: 0 0 25px rgba(255, 77, 79, 0.45);
    background-image:
        radial-gradient(circle at 20% 40%, rgba(239, 68, 68, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.15) 0%, transparent 50%);
}

/* 2. 紫醉金迷 (Violet Gold) - 深魅夜紫 + 金紫幻彩 */
body.theme-warm {
    --primary: linear-gradient(135deg, #ffd700 0%, #ec4899 50%, #8b5cf6 100%);
    --primary-solid: #c084fc;
    --secondary: linear-gradient(135deg, #ffd700 0%, #a855f7 100%);
    --accent: linear-gradient(135deg, #ffd700 0%, #f472b6 100%);
    --success: #10b981;
    --warning: #ffd700;
    --danger: #ef4444;

    --bg-dark: #0e091b;
    --bg-card: rgba(28, 18, 50, 0.88);
    --bg-card-hover: rgba(40, 26, 70, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #e9d5ff;
    --text-muted: #c084fc;

    --shadow-glow: 0 0 25px rgba(168, 85, 247, 0.45);
    background-image:
        radial-gradient(circle at 20% 40%, rgba(168, 85, 247, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.12) 0%, transparent 50%);
}

/* 3. 曜石黑金 (Black Gold) - 極致黑金 + 奢華香檳金 */
body.theme-luxury {
    --primary: linear-gradient(135deg, #fff275 0%, #ffd700 50%, #c69214 100%);
    --primary-solid: #ffd700;
    --secondary: linear-gradient(135deg, #ffd700 0%, #e6a100 100%);
    --accent: linear-gradient(135deg, #ffffff 0%, #ffd700 100%);
    --success: #10b981;
    --warning: #ffd700;
    --danger: #ef4444;

    --bg-dark: #090a0d;
    --bg-card: rgba(20, 22, 28, 0.9);
    --bg-card-hover: rgba(30, 32, 40, 0.98);

    --text-primary: #ffffff;
    --text-secondary: #fef08a;
    --text-muted: #ca8a04;

    --shadow-glow: 0 0 25px rgba(255, 215, 0, 0.5);
    background-image:
        radial-gradient(circle at 20% 40%, rgba(255, 215, 0, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(202, 138, 4, 0.12) 0%, transparent 50%);
}

/* 4. 炫彩極光 (Aurora Cyan) - 深邃青黑 + 青藍金光 */
body.theme-flash {
    --primary: linear-gradient(135deg, #ffd700 0%, #06b6d4 50%, #3b82f6 100%);
    --primary-solid: #06b6d4;
    --secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --accent: linear-gradient(135deg, #67e8f9 0%, #ffd700 100%);
    --success: #10b981;
    --warning: #ffd700;
    --danger: #ef4444;

    --bg-dark: #061118;
    --bg-card: rgba(12, 32, 45, 0.88);
    --bg-card-hover: rgba(18, 45, 65, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #cffafe;
    --text-muted: #22d3ee;

    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.45);
    background-image:
        radial-gradient(circle at 20% 40%, rgba(6, 182, 212, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.12) 0%, transparent 50%);
}

/* ===== 基礎樣式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-dark);
    /* 預設背景金色燙金光暈 */
    background-image:
        radial-gradient(circle at 15% 25%, rgba(255, 215, 0, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(255, 152, 0, 0.08) 0%, transparent 45%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ===== 標題區 ===== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.title {
    font-size: 3.2rem;
    font-weight: 900;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 35px rgba(255, 215, 0, 0.4);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ===== 導航選單 ===== */
.nav {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-solid);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.active {
    background: var(--primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-btn .icon {
    font-size: 1.5rem;
}

/* ===== 頁面內容 ===== */
.content {
    min-height: 550px;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 抽獎頁面經典佈局 (上:獎項 中:舞臺 下:得獎) ===== */
.lottery-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.prize-selector,
.current-winners {
    background: rgba(22, 28, 45, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.prize-selector h3,
.current-winners h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #ffffff;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.prize-card {
    background: rgba(22, 28, 45, 0.9);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 215, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.prize-card:hover {
    background: rgba(30, 38, 62, 0.98);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.2);
}

.prize-card.selected {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(38, 28, 12, 0.95) 0%, rgba(48, 35, 15, 0.98) 100%);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.45), inset 0 0 15px rgba(255, 215, 0, 0.15);
    transform: translateY(-2px);
}

.prize-card.selected .prize-name {
    color: #ffffff;
    font-weight: 800;
}

.prize-card.selected .prize-amount {
    color: #ffd700;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.prize-card.selected .prize-quantity {
    color: #f1f5f9;
}

.prize-card.completed {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 20, 30, 0.6);
}

.prize-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: #ffffff;
}

.prize-amount {
    font-size: 1.15rem;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.prize-quantity {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.4;
}

/* ===== 抽獎區域 ===== */
.draw-area {
    text-align: center;
}

.lottery-display {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.lottery-placeholder {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.winner-display {
    text-align: center;
    animation: winnerAppear 0.8s ease;
}

@keyframes winnerAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
    }

    50% {
        transform: scale(1.1) rotateY(0deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.winner-label {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.winner-name {
    font-size: 5rem;
    font-weight: 900;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    text-shadow: var(--shadow-glow);
}

.winner-info {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.winner-department {
    font-size: 1.8rem;
    color: var(--text-muted);
}

/* 跑馬燈動畫 */
.rolling-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: zoomIn 0.1s ease;
    width: 100%;
}

.rolling-prize {
    font-size: 2rem;
    color: var(--warning);
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.rolling-name {
    font-size: 5.5rem;
    /* 超大直式居中名字 */
    font-weight: 900;
    color: var(--primary-solid);
    margin: 0.5rem 0;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    letter-spacing: 2px;
}

.rolling-info {
    font-size: 2rem;
    color: var(--text-secondary);
}

.rolling-id {
    font-size: 1.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.rolling-dept {
    font-size: 1.4rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0.8;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== 抽獎按鈕 ===== */
#draw-count-select {
    font-size: 1.5rem;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 10px;
}

.draw-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
}

.draw-btn:hover:not(:disabled) {
    box-shadow: 0 12px 30px rgba(255, 152, 0, 0.5);
}

.draw-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: var(--text-muted);
}

/* ===== 得獎名單 ===== */
.winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.winner-card {
    background: var(--bg-card);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* 移除 backdrop-filter 提升效能 */
    animation: cardAppear 0.3s ease-out;
    /* 縮短時間 */
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
        /* 簡化動畫，只做位移 */
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.winner-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.winner-card-id {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.winner-card-dept {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== 名單管理頁面 ===== */
.upload-section {
    margin-bottom: var(--spacing-xl);
}

.upload-area {
    background: var(--bg-card);
    border: 3px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-solid);
    background: var(--bg-card-hover);
}

.upload-area.dragover {
    border-color: var(--primary-solid);
    background: var(--bg-card-hover);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.btn-primary {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ===== 統計卡片 ===== */
.stats-section {
    margin-top: var(--spacing-xl);
}

.stats-section h4 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card.highlight {
    border: 2px solid rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.stat-value {
    font-size: 3rem;
    font-weight: 900;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ===== 載入動畫 ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-solid);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .winner-name {
        font-size: 3rem;
    }

    .winner-info {
        font-size: 1.5rem;
    }

    .draw-btn {
        font-size: 1.5rem;
        min-width: 200px;
    }

    /* 報到頁面手機版優化 */
    .checkin-input-group {
        flex-direction: column;
    }

    .checkin-input-group .btn-primary {
        width: 100%;
        padding: 1rem;
    }
}

/* 即時連線呼吸燈動畫 */
@keyframes pulse-live {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-indicator {
    animation: pulse-live 2s infinite ease-in-out;
}

.live-stat-bump {
    animation: statBump 0.4s ease-out;
}

@keyframes statBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); color: #10b981; }
    100% { transform: scale(1); }
}

/* ===== 報到管理頁面 ===== */
.checkin-container {
    max-width: 800px;
    margin: 0 auto;
}

.checkin-input-section {
    background: var(--bg-card);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.checkin-input-group {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.checkin-input {
    flex: 1;
    padding: var(--spacing-md);
    font-size: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.checkin-input:focus {
    outline: none;
    border-color: var(--primary-solid);
    background: rgba(255, 255, 255, 0.1);
}

.checkin-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.checkin-stats-container {
    margin-bottom: var(--spacing-xl);
}

.checkin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.stat-item {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 900;
    background: var(--accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.checkin-list-section h4 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.checkin-list {
    display: grid;
    gap: var(--spacing-md);
}

.checkin-card {
    background: var(--bg-card);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* 移除 backdrop-filter */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.checkin-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.checkin-info {
    flex: 1;
}

.checkin-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.checkin-id {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.checkin-dept {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.checkin-time {
    font-size: 0.85rem;
    color: var(--success);
}

.btn-cancel {
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* ===== 主題切換器 ===== */
.theme-switcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10050;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 15px;
    overflow: visible;
    pointer-events: auto;
}

.theme-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-solid);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 20px var(--primary-solid);
}

.theme-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 10px;
    min-width: 160px;
    display: none !important;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1;
    pointer-events: none;
}

.theme-menu.active {
    display: flex !important;
    pointer-events: auto;
    animation: slideUp 0.3s ease;
}

body.role-checkin #theme-toggle-btn,
body.role-checkin #theme-menu {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-option {
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-option.active {
    background: var(--primary);
    color: white;
}

.theme-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ===== 中央控制台 ===== */
.console-stage {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: consoleIn 0.45s ease-out;
}

@keyframes consoleIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.console-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.6rem 1.8rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    background:
        radial-gradient(ellipse at 12% 20%, rgba(255, 215, 0, 0.14) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 152, 0, 0.1) 0%, transparent 40%),
        linear-gradient(145deg, rgba(18, 24, 40, 0.95), rgba(10, 14, 24, 0.92));
    position: relative;
    overflow: hidden;
}

.console-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 215, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    opacity: 0.55;
}

.console-hero-left,
.console-hero-right {
    position: relative;
    z-index: 1;
}

.console-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.55rem;
}

.console-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: consolePulse 1.6s ease-in-out infinite;
}

@keyframes consolePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.console-title {
    margin: 0;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #fff7c2 0%, #ffd700 45%, #ff9800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.console-sub {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.console-hero-right {
    text-align: right;
    min-width: 160px;
}

.console-clock {
    font-size: 2.1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    color: #ffd700;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
    line-height: 1;
}

.console-clock-label {
    margin-top: 4px;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.console-event-chip {
    margin-top: 10px;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    font-size: 0.82rem;
    font-weight: 600;
}

.console-launch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.console-launch-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(22, 28, 45, 0.88);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font: inherit;
    text-align: left;
}

.console-launch-btn:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 215, 0, 0.12);
}

.console-launch-btn.primary {
    border-color: rgba(255, 152, 0, 0.45);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.22), rgba(255, 87, 34, 0.12));
}

.console-launch-icon {
    font-size: 1.7rem;
    line-height: 1;
}

.console-launch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.console-launch-text strong {
    font-size: 1.05rem;
    font-weight: 800;
}

.console-launch-text small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.console-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.console-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.15rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(22, 28, 45, 0.75);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.console-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(35, 45, 70, 0.92);
}

.console-tile.accent {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(160deg, rgba(255, 215, 0, 0.1), rgba(22, 28, 45, 0.8));
}

.console-tile-icon {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.console-tile-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.console-tile-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.console-ops {
    padding: 1.15rem 1.3rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(14, 18, 30, 0.75);
}

.console-ops-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.9rem;
}

.console-ops-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.console-ops-head span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.console-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
}

.console-steps li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.7rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    background: rgba(255, 215, 0, 0.04);
}

.console-steps b {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #ffd700;
}

.console-steps span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.console-status-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.console-status-card {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(22, 28, 45, 0.8);
    text-align: center;
}

.console-status-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.console-status-value {
    font-size: 1.55rem;
    font-weight: 900;
    color: #ffd700;
    font-variant-numeric: tabular-nums;
}

.console-status-value.accent { color: #10b981; }
.console-status-value.warn { color: #ff9800; }
.console-status-value.ok {
    color: #10b981;
    letter-spacing: 0.08em;
    font-size: 1.25rem;
}

@media (max-width: 980px) {
    .console-launch,
    .console-status-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .console-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .console-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .console-hero-right {
        text-align: left;
    }

    .console-launch,
    .console-grid,
    .console-status-row,
    .console-steps {
        grid-template-columns: 1fr;
    }
}


