/* ===========================
   screen-test - 螢幕檢測工具頁面
   =========================== */

/* 主要內容區塊，佔滿 wrapper 剩餘寬度 */
.st-container {
    flex: 1;
    min-width: 0;
}

/* 頁面頂部英雄區塊 */
.st-hero {
    text-align: center;
    padding: 10px 0 30px;
}

/* 英雄區塊主標題 */
.st-hero-title {
    font-size: 2.25em;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}

/* 英雄區塊副標題 (#64748b 對比度 4.51:1，符合 WCAG AA) */
.st-hero-subtitle {
    font-size: 1.063em;
    color: #64748b;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 16px;
}

/* 英雄區塊描述文字 (#64748b 對比度 4.51:1，符合 WCAG AA) */
.st-hero-desc {
    font-size: 1em;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* ===========================
   工具卡片
   =========================== */

/* 工具卡片外層 */
.st-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
}

/* 工具卡片內容區域 */
.st-card-body {
    padding: 24px;
}

/* ===========================
   區塊標籤
   =========================== */

/* 區塊標題文字 (#475569 對比度 7.04:1，符合 WCAG AAA) */
.st-section-label {
    font-size: 1em;
    font-weight: 600;
    color: #475569;
    margin: 0 0 6px;
}

/* 區塊提示文字 (#64748b 對比度 4.51:1，符合 WCAG AA) */
.st-section-hint {
    font-size: 0.875em;
    color: #64748b;
    margin: 0 0 16px;
}

/* ===========================
   顏色方塊格線
   =========================== */

/* 顏色方塊容器，桌面版固定五欄 */
.st-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* 單一顏色方塊按鈕，設定明確寬高 */
.st-color-swatch {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

/* 白色方塊需要較明顯的邊框以區分背景 */
.st-color-swatch[data-color="#FFFFFF"] {
    border-color: #cbd5e1;
}

/* 顏色方塊 hover 效果 */
.st-color-swatch:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 顏色方塊 focus 外框，確保鍵盤導覽可見 */
.st-color-swatch:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* 顏色方塊下方的顏色名稱標籤 */
.st-color-label {
    display: block;
    text-align: center;
    font-size: 0.75em;
    color: #475569;
    margin-top: 4px;
    font-weight: 500;
}

/* 顏色方塊包裝容器，包含方塊與標籤 */
.st-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===========================
   分隔線
   =========================== */

/* 區塊之間的分隔線 */
.st-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 24px 0;
}

/* ===========================
   完整測試區塊
   =========================== */

/* 測試所有顏色按鈕 (#2563eb 白字對比度 5.18:1，符合 WCAG AA) */
.st-btn-test-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

/* 測試所有顏色按鈕 hover */
.st-btn-test-all:hover {
    background: #1d4ed8;
}

/* 測試所有顏色按鈕 focus 外框 */
.st-btn-test-all:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* ===========================
   使用說明區塊
   =========================== */

/* 使用說明標題 */
.st-usage-title {
    font-size: 1em;
    font-weight: 600;
    color: #475569;
    margin: 0 0 12px;
}

/* 使用說明列表 */
.st-usage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 使用說明列表項目 (#475569 對比度 7.04:1，符合 WCAG AAA) */
.st-usage-list li {
    font-size: 0.938em;
    color: #475569;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

/* 列表項目前方的圖示替代符號 */
.st-usage-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* ===========================
   全螢幕覆蓋層
   =========================== */

/* 全螢幕覆蓋層，預設隱藏 */
.st-fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

/* 全螢幕覆蓋層啟用狀態 */
.st-fullscreen-overlay.is-active {
    display: block;
}

/* 全螢幕提示文字容器，置於畫面頂部 */
.st-fullscreen-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875em;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 100000;
    white-space: nowrap;
}

/* 深色背景上的提示文字（白色文字 + 半透明深色背景） */
.st-fullscreen-hint.on-dark {
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
}

/* 淺色背景上的提示文字（深色文字 + 半透明淺色背景） */
.st-fullscreen-hint.on-light {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.7);
}

/* 提示文字顯示狀態 */
.st-fullscreen-hint.is-visible {
    opacity: 1;
}

/* ===========================
   響應式設計
   =========================== */

@media (max-width: 600px) {

    /* 卡片內容縮小內距 */
    .st-card-body {
        padding: 16px;
    }

    /* 手機上顏色方塊改為五欄，縮小間距 */
    .st-color-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    /* 手機上縮小方塊高度 */
    .st-color-swatch {
        height: 60px;
    }

    /* 手機上全螢幕提示字體縮小 */
    .st-fullscreen-hint {
        font-size: 0.75em;
        padding: 8px 14px;
    }
}

/* ===========================
   無障礙：減少動態效果
   =========================== */

@media (prefers-reduced-motion: reduce) {

    /* 停用所有過渡動畫 */
    .st-color-swatch,
    .st-btn-test-all,
    .st-fullscreen-hint {
        transition: none;
    }
}

/* ===========================
   無障礙：Windows 高對比模式
   =========================== */

@media (forced-colors: active) {

    /* 卡片框線使用系統色彩 */
    .st-card {
        border-color: CanvasText;
    }

    /* 顏色方塊框線使用系統色彩 */
    .st-color-swatch {
        border-color: CanvasText;
    }

    /* 按鈕使用系統色彩 */
    .st-btn-test-all {
        border: 1px solid ButtonText;
    }
}
