/* ===========================
   CSS 變數與基礎設定
   =========================== */
:root {
    /* 主色調 - Cyan/Teal */
    --primary: #06b6d4;
    /* Cyan-500 */
    --primary-light: #22d3ee;
    /* Cyan-400 */
    --primary-dark: #0891b2;
    /* Cyan-600 */

    /* 輔助色 */
    --accent: #f472b6;
    /* Pink-400 (for PC2 or Error) */

    /* 背景與表面 (與其他頁面一致) */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --surface: rgba(30, 41, 59, 0.8);
    --surface-light: rgba(51, 65, 85, 0.6);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* 文字 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 其他 */
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Utility Classes for Text Highlight */
.text-primary {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.text-success {
    color: #22c55e !important;
}

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

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===========================
   容器佈局
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   頁首
   =========================== */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--glass);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===========================
   主要內容區
   =========================== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

/* ===========================
   視覺化區域 (左側)
   =========================== */
.visualization-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canvas-container {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 500px;
}

canvas {
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: crosshair;
    /* Indicate clickable/interactive */
}

/* 數據統計面板 */
.stats-panel {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--glass);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    background: var(--surface-light);
}

#cardPC1 {
    border-color: rgba(34, 197, 94, 0.2);
}
#cardPC1:hover {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

#cardPC2 {
    border-color: rgba(6, 182, 212, 0.2);
}
#cardPC2:hover {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

#cardPC3 {
    border-color: rgba(244, 114, 182, 0.2);
}
#cardPC3:hover {
    border-color: rgba(244, 114, 182, 0.6);
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.2);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary-light);
}

/* ===========================
   控制面板 (右側)
   =========================== */
.control-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-panel {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    font-family: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.control-item {
    margin-bottom: 1.5rem;
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: var(--surface-light);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
}

/* ===========================
   Info Section
   =========================== */
.info-section {
    margin-top: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.info-card {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card p,
.info-card li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-list {
    list-style: none;
}

.info-list li {
    margin-bottom: 0.4rem;
    padding-left: 0.8rem;
    position: relative;
}

.info-list li::before {
    content: "•";
    color: var(--primary-light);
    position: absolute;
    left: 0;
}

/* ===========================
   Footer
   =========================== */
.footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--glass-border);
}

.back-home {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.back-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.5);
}

/* ===========================
   新版 3D UI 元件
   =========================== */
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--surface-light);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.form-select option {
    background: #1e293b;
    color: var(--text-primary);
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    background: var(--surface-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}

.btn-tab:hover {
    background: var(--glass-border);
    color: var(--text-primary);
}

.btn-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-family: monospace;
}

.canvas-tooltip {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    pointer-events: none;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 550px;
    outline: none;
}

/* ===========================
   影片區域
   =========================== */
.video-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.video-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.video-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 25px 50px -12px rgba(6, 182, 212, 0.2);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-sm);
}

.video-description {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
}

.video-description h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.video-description p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .video-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .video-description {
        padding: 0;
    }
}