        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary: #208080;
            --success: #22c55e;
            --warning: #f59e0b;
            --danger: #ef4444;
            --muted: #64748b;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --border-color: #e2e8f0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: var(--bg-light) url('../images/background.jpg') center/cover no-repeat fixed;
            color: var(--text-primary);
            line-height: 1.6;
            position: relative;
        }

        /* 淡化背景圖片的覆蓋層 - 調降不透明度讓背景更明顯 */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(248, 250, 252, 0.65);
            z-index: 0;
            pointer-events: none;
        }

        .header {
            background: url('../images/head.jpg') center/cover no-repeat;
            color: white;
            padding: 2rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
            z-index: 1;
        }

        .header h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
            color: #ffffff;
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
            padding: 0.75rem 1.5rem;
            display: block;
            max-width: fit-content;
            font-weight: 700;
        }

        .header p {
            font-size: 1.2rem;
            color: #ffffff;
            text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 0, 0, 0.3);
            padding: 0.5rem 1.25rem;
            display: block;
            max-width: fit-content;
            font-weight: 500;
        }

        .container {
            max-width: 1600px;
            margin: 0 auto;
            padding: 2rem 1rem;
            position: relative;
            z-index: 1;
        }

        /* 第一層：篩選區 */
        .filter-section {
            background: var(--bg-white);
            padding: 1.5rem;
            border-radius: 8px;
            margin-bottom: 2rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .filter-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
        }

        .filter-group label {
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text-secondary);
        }

        .filter-group input,
        .filter-group select {
            padding: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-size: 0.95rem;
        }

        .filter-group input:focus,
        .filter-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(32, 128, 128, 0.1);
        }

        .btn {
            display: inline-block;
            padding: 0.75rem 1.5rem;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            align-self: flex-end;
        }

        .btn:hover {
            background: #1a6666;
            box-shadow: 0 4px 12px rgba(32, 128, 128, 0.3);
        }

        /* 第二層：快覽卡片 */
        .companies-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .company-card {
            background: var(--bg-white);
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            cursor: pointer;
            transition: all 0.3s ease;
            border-left: 4px solid var(--border-color);
        }

        .company-card:hover {
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }

        .company-card.low {
            border-left-color: var(--success);
        }

        .company-card.medium {
            border-left-color: var(--warning);
        }

        .company-card.high {
            border-left-color: var(--danger);
        }

        .company-name {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 1rem;
        }

        .risk-score-big {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .risk-score-number {
            font-size: 3rem;
            font-weight: 700;
            min-width: 100px;
        }

        .company-card.low .risk-score-number {
            color: var(--success);
        }

        .company-card.medium .risk-score-number {
            color: var(--warning);
        }

        .company-card.high .risk-score-number {
            color: var(--danger);
        }

        .risk-badge {
            display: inline-block;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .risk-badge.low {
            background: rgba(34, 197, 94, 0.1);
            color: var(--success);
        }

        .risk-badge.medium {
            background: rgba(245, 158, 11, 0.1);
            color: var(--warning);
        }

        .risk-badge.high {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
        }

        .quick-stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-color);
        }

        .stat {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .stat-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .stat-value {
            font-size: 1.2rem;
            font-weight: 700;
        }

        /* 詳細視圖 */
        .detail-view {
            display: none;
            background: var(--bg-white);
            border-radius: 8px;
            padding: 2rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .detail-view.active {
            display: block;
        }

        .detail-view-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 2px solid var(--primary);
        }

        .detail-view-header h2 {
            font-size: 1.8rem;
        }

        .close-detail {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-secondary);
        }

        .close-detail:hover {
            color: var(--text-primary);
        }

        /* 第三層：ESG分數 */
        .esg-scores-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .esg-score-card {
            background: linear-gradient(135deg, rgba(32, 128, 128, 0.05) 0%, rgba(32, 128, 128, 0.1) 100%);
            padding: 2rem;
            border-radius: 8px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .esg-score-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
        }

        .esg-letter {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .esg-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
        }

        .esg-score {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        /* 分析板塊 */
        .analysis-section {
            background: var(--bg-white);
            border-radius: 8px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .section-title {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--primary);
            display: inline-block;
        }

        /* 第四、五層：文本對比表 */
        .comparison-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
            margin-top: 1rem;
        }

        .comparison-table th {
            background: var(--bg-light);
            padding: 0.75rem;
            text-align: left;
            font-weight: 600;
            border-bottom: 2px solid var(--border-color);
            position: sticky;
            top: 0;
        }

        .comparison-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border-color);
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .comparison-table tbody tr:hover {
            background: rgba(32, 128, 128, 0.02);
        }

        .risk-label {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .risk-label.low {
            background: rgba(212, 172, 13, 0.1);
            color: #d4ac0d;
            /* Dark yellow */
        }

        .risk-label.medium {
            background: rgba(255, 165, 0, 0.1);
            color: orange;
        }

        .risk-label.high {
            background: rgba(255, 0, 0, 0.1);
            color: red;
        }

        .risk-label.no {
            background: rgba(0, 128, 0, 0.1);
            color: green;
        }

        /* 第六層：特徵重要度 */
        .feature-list {
            list-style: none;
        }

        .feature-item {
            display: flex;
            align-items: center;
            margin-bottom: 1.5rem;
            gap: 1rem;
        }

        .feature-label {
            min-width: 200px;
            font-size: 0.95rem;
            font-weight: 500;
        }

        .feature-bar {
            flex: 1;
            background: var(--bg-light);
            height: 28px;
            border-radius: 4px;
            overflow: hidden;
        }

        .feature-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), #1a6666);
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 0.75rem;
            color: white;
            font-size: 0.85rem;
            font-weight: 600;
        }

        /* 第六層：SASB 權重圖 */
        .sasb-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 8px;
            margin-top: 1rem;
        }

        .sasb-item {
            padding: 8px 6px;
            border-radius: 6px;
            text-align: center;
            font-size: 0.8rem;
            line-height: 1.3;
            color: var(--text-secondary);
            background: var(--bg-light);
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 50px;
            word-break: break-word;
            hyphens: auto;
        }

        .sasb-item.weight-2 {
            background: var(--primary);
            color: white;
            font-weight: 700;
            border-color: var(--primary);
            box-shadow: 0 4px 6px rgba(32, 128, 128, 0.2);
            transform: scale(1.05);
            z-index: 1;
        }

        .sasb-item.weight-1 {
            opacity: 0.7;
        }

        /* 響應式調整 SASB 網格 */
        @media (max-width: 1200px) {
            .sasb-grid {
                grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
                gap: 6px;
            }

            .sasb-item {
                font-size: 0.75rem;
                padding: 6px 4px;
                min-height: 45px;
            }
        }

        @media (max-width: 768px) {
            .sasb-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 5px;
            }

            .sasb-item {
                font-size: 0.7rem;
                padding: 5px 3px;
                min-height: 40px;
            }
        }

        /* 第七層：詞雲 */
        .wordcloud-container {
            background: var(--bg-white);
            border-radius: 8px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            min-height: 400px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .wordcloud {
            text-align: center;
            line-height: 2;
        }

        .word {
            display: inline-block;
            margin: 0 0.5rem;
            padding: 0.25rem 0.75rem;
            border-radius: 4px;
            background: rgba(32, 128, 128, 0.1);
            color: var(--primary);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .word:hover {
            background: var(--primary);
            color: white;
            transform: scale(1.1);
        }

        .word.high {
            font-size: 1.8rem;
        }

        .word.medium {
            font-size: 1.4rem;
        }

        .word.low {
            font-size: 1rem;
        }

        /* 第八層：資料來源 */
        .source-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-top: 1rem;
            transition: all 0.5s ease;
            max-height: 2000px;
            opacity: 1;
            overflow: hidden;
        }

        .source-grid.collapsed {
            max-height: 0;
            opacity: 0;
            margin-top: 0;
            gap: 0;
        }

        .source-card {
            background: linear-gradient(135deg, rgba(32, 128, 128, 0.05) 0%, rgba(32, 128, 128, 0.1) 100%);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 1.5rem;
        }

        .source-title {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 1rem;
            color: var(--primary);
        }

        .source-list {
            list-style: none;
            font-size: 0.9rem;
        }

        .source-list li {
            padding: 0.5rem 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* .source-list li:before {
            content: "✓";
            color: var(--success);
            font-weight: bold;
        } */

        /* 響應式 */
        @media (max-width: 1024px) {
            .esg-scores-grid {
                grid-template-columns: 1fr;
            }

            .companies-grid {
                grid-template-columns: 1fr;
            }

            .comparison-table td {
                max-width: 120px;
            }
        }

        @media (max-width: 768px) {
            .filter-row {
                grid-template-columns: 1fr;
            }

            .comparison-table {
                font-size: 0.75rem;
            }

            .comparison-table td {
                padding: 0.5rem;
            }
        }

        .hidden {
            display: none !important;
        }

        /* 初始提示區域 */
        .initial-prompt {
            background: var(--bg-white);
            border-radius: 8px;
            padding: 3rem 2rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            text-align: center;
        }

        .prompt-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
        }

        .prompt-gif {
            max-width: 300px;
            height: auto;
            border-radius: 8px;
        }

        .prompt-text {
            font-size: 1.1rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        /* 分頁控制 */
        .pagination-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem;
            background: var(--bg-white);
            border-radius: 8px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            flex-wrap: wrap;
        }

        .table-responsive {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin-bottom: 1rem;
        }

        /* 響應式 */
        @media (max-width: 1024px) {
            .esg-scores-grid {
                grid-template-columns: 1fr;
            }

            .companies-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 1rem 0.5rem;
            }

            .filter-row {
                grid-template-columns: 1fr;
            }

            .filter-section {
                padding: 1rem;
            }

            .btn {
                width: 100%;
                text-align: center;
                margin-top: 0.5rem !important;
            }

            .filter-group input,
            .filter-group select {
                width: 100%;
            }

            .comparison-table {
                font-size: 0.8rem;
            }

            .comparison-table td {
                padding: 0.5rem;
                max-width: 150px;
                /* Adjust for scroll view */
            }

            /* Ensure main table scrolls nicely */
            .dashboard-table th,
            .dashboard-table td {
                white-space: nowrap;
            }
        }

        /* 驗證徽章與動態 Tooltip */
        .evidence-cell {
            position: relative;
        }

        .evidence-cell .verified-badge {
            transition: all 0.2s ease;
            cursor: pointer;
        }

        /* 動態 Tooltip 樣式 */
        #verified-tooltip {
            position: fixed;
            background: #6b7280;
            color: white;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 12px;
            white-space: nowrap;
            z-index: 10000;
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            display: none;
        }

        /* 進度條容器 */
        .progress-bar-wrapper {
            width: 100%;
            max-width: 600px;
            height: 35px;
            background-color: #e0e0e0;
            /* 灰色底色 */
            border-radius: 11px;
            /* 圓角:數字越大越圓 */
            margin: 0 auto;
            overflow: hidden;
            box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        /* 進度條填充部分 */
        .progress-bar-fill {
            height: 100%;
            width: 0%;
            /* 由 JS 控制寬度 */
            background-color: #1a6666;
            /* 與header同色 */
            display: flex;
            align-items: center;
            justify-content: center;
            transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            /* 平滑移動動畫 */
            position: relative;
        }

        /* 進度條光澤效果 */
        .progress-bar-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
            border-radius: 12px 12px 0 0;
        }

        /* 百分比文字 */
        #progressPercent {
            color: white;
            font-weight: bold;
            font-size: 16px;
            text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
            z-index: 10;
        }

        /* 1. 調整 Tom Select 的外層容器寬度，確保與原欄位一致 */
        .ts-wrapper {
            width: 100% !important;
            display: inline-block;
            vertical-align: middle;
        }

        /* 2. 核心：調整控制框的高度與內距 */
        .ts-control {
            min-height: 44px !important;
            /* 對齊計算後的總高度 */
            padding: 12px !important;
            /* 套用您圖中的 Padding 12 */
            border: 0.667px solid #d0d0d0 !important;
            /* 套用您圖中的 Border 寬度 */
            display: flex !important;
            align-items: center !important;
            box-sizing: border-box !important;
        }

        /* 3. 調整內部輸入文字的高度 */
        .ts-control input {
            height: 18.667px !important;
            /* 套用您圖中的內容高度 */
            line-height: 18.667px !important;
            font-size: 16px !important;
            /* 視需求微調字體大小 */
            margin: 0 !important;
        }

        /* 4. 針對單選模式下的顯示文字位置微調 */
        .ts-wrapper.single .ts-control .item {
            line-height: 18.667px !important;
        }

        /* 放大控制框內的字體 */
        .ts-control {
            min-height: 44px !important;
            padding: 12px !important;
            font-size: 16px !important;
            /* 加大字體，通常 16px-18px 在手機上較易閱讀 */
        }

        /* 確保選中的項目垂直置中且字體正確 */
        .ts-wrapper.single .ts-control .item {
            font-size: 16px !important;
            line-height: 20px !important;
            /* 配合字體大小稍微增加行高 */
        }

        /* 下拉選單內的選項字體也同步加大 */
        .ts-dropdown .option {
            font-size: 16px !important;
            padding: 12px !important;
        }