/* 基礎樣式 */
body {
    background-color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Container 樣式 - Mobile First */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: auto;
    margin-right: auto;
}

/* Tablet styles */
@media (min-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Large desktop styles */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* 篩選器樣式優化 - Mobile First */
.filters {
    margin: 1rem 0;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.timeline-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    flex: 1;
    min-width: 100%;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.custom-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.25rem;
    color: #1f2937;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    appearance: none;
    transition: all 0.2s;
}

.custom-select:hover {
    border-color: #9ca3af;
}

.custom-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 篩選結果提示樣式 */
.filter-result-hint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.hint-icon {
    font-size: 1.25rem;
}

.hint-text {
    font-size: 0.875rem;
    color: #4b5563;
    flex: 1;
}

.clear-all-filters-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-filters-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.clear-all-filters-btn:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 卡片基本樣式 - Mobile First */
.country-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.country-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 卡片頭部 */
.card-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Tablet styles for cards */
@media (min-width: 768px) {
    .country-card {
        border-radius: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .card-header {
        padding: 1.5rem;
    }
    
    .card-title {
        flex-wrap: nowrap;
        gap: 1rem;
    }
}

/* Desktop styles for cards */
@media (min-width: 1024px) {
    .country-card {
        margin-bottom: 0;
    }
}

/* 表格中的國家名稱和國旗 - Mobile First */
.country-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* 可點擊的國家名稱樣式 */
.clickable-country {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding: 0.25rem;
    margin: -0.25rem;
}

.clickable-country:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

.clickable-country:hover .country-text {
    color: #1f2937;
}

/* 國家名稱容器 - 垂直排列以節省空間 */
.tariff-comparison-table .country-name {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    white-space: normal;
}

.tariff-comparison-table .country-name .country-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* 國家卡片高亮效果 */
.country-card.highlighted {
    animation: highlight-pulse 0.8s ease-in-out;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

@keyframes highlight-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    }
}

.card-description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* 卡片內容 */
.card-body {
    padding: 1rem;
}

/* 國旗樣式 */
.country-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.country-flag.fallback {
    font-size: 0.8rem;
    font-weight: normal;
    color: #666;
}

.flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

/* Tablet styles */
@media (min-width: 768px) {
    .country-name {
        font-size: 1rem;
        min-width: 120px;
    }
    
    .card-description {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .country-flag {
        width: 24px;
        height: 18px;
    }
    
    .flag-img {
        width: 24px;
        height: 18px;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .country-name {
        font-size: 1.1rem;
        min-width: 140px;
    }
    
    .card-description {
        font-size: 1rem;
    }
    
    .country-flag {
        width: 28px;
        height: 20px;
    }
    
    .flag-img {
        width: 28px;
        height: 20px;
    }
}

/* 狀態標籤 - Mobile First */
.status-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    margin-left: 0;
    margin-top: 0.25rem;
    font-weight: 500;
    white-space: nowrap;
    align-self: flex-start;
}

/* 表格中的狀態標籤特殊樣式 */
.tariff-comparison-table .status-badge {
    margin-left: 0;
    margin-top: 0.125rem;
    padding: 1px 3px;
    font-size: 0.6rem;
}

.status-completed {
    background-color: #e6f4ea;
    color: #1e8e3e;
}

.status-notified {
    background-color: #fef7e0;
    color: #b95000;
}

.status-pending {
    background-color: #f1f3f4;
    color: #5f6368;
}

/* 已達成協議 - 綠色 */
.status-badge.agreement {
    background-color: #dcfce7;
    color: #166534;
}

/* 被發函 - 橘色 */
.status-badge.notified {
    background-color: #ffedd5;
    color: #9a3412;
}

/* 未公布 - 藍色 */
.status-badge.unpublished {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 臨時協議 - 紫色 */
.status-badge.temp_agreement {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* Tablet styles */
@media (min-width: 768px) {
    .status-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
        margin-left: 0.5rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .status-badge {
        padding: 2px 8px;
        font-size: 12px;
        margin-left: 8px;
    }
}

/* 關稅流程圖 */
.tariff-flow {
    margin: 2rem 0;
    position: relative;
}

.tariff-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 120px;
}

.tariff-item {
    flex: 1;
    text-align: center;
}

.tariff-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.tariff-rate {
    font-size: 1.875rem;
    font-weight: bold;
}

.tariff-rate.current {
    color: #111827;
}

.tariff-rate.future {
    color: #2563eb;
}

.special-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* 箭頭容器 */
.tariff-arrow-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 2px;
    padding: 0 1rem;
}

.tariff-change {
    text-align: center;
    position: absolute;
    top: -1.5rem;
    width: 100%;
    font-size: 0.875rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.change-value {
    font-size: 0.875rem;
    font-weight: bold;
}

.tariff-change.increase {
    color: #dc2626;
}

.tariff-change.decrease {
    color: #16a34a;
}

.tariff-change.unchanged {
    color: #6b7280;
}

.tariff-arrow {
    width: 100%;
    height: 2px;
    background-color: #e5e7eb;
    position: relative;
}

.tariff-arrow::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-top: 2px solid #e5e7eb;
    border-right: 2px solid #e5e7eb;
    transform: rotate(45deg);
}

.grace-period {
    text-align: center;
    color: #6b7280;
    font-size: 0.75rem;
    position: absolute;
    width: 100%;
    top: 1.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

/* 產業標籤 */
.industry-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.75rem;
}

.industry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.industry-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #eff6ff;
    color: #1d4ed8;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

.industry-tag:hover {
    background-color: #dbeafe;
}

/* 資訊區塊 */
.info-section {
    background-color: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.info-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-block {
    margin-bottom: 1rem;
}

.info-title {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.75rem;
}

.info-title .icon {
    color: #9ca3af;
    margin-right: 0.5rem;
}

.info-summary {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.bullet {
    width: 0.375rem;
    height: 0.375rem;
    background-color: #9ca3af;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* 頁籤樣式 */
.card-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    margin-top: 1rem;
}

.card-tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.card-tab:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.card-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background-color: white;
}

.card-content {
    display: none;
}

.card-content.active {
    display: block;
}

/* 響應式網格 - Mobile First */
#countryGrid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    grid-template-columns: 1fr;
}

/* Tablet styles */
@media (min-width: 768px) {
    #countryGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    #countryGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        padding: 2rem;
    }
}

/* Large desktop styles */
@media (min-width: 1280px) {
    #countryGrid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 載入動畫 */
#loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 課稅歷程表格 */
.tariff-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.tariff-table th,
.tariff-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tariff-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.tariff-table tr:last-child td {
    border-bottom: none;
}

.tariff-rate-cell {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.rate-progress {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.rate-progress-bar {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.rate-progress-bar.increase {
    background-color: #ef4444;
}

.rate-progress-bar.decrease {
    background-color: #22c55e;
}

/* 課稅歷程分頁內容 */
.timeline-content {
    padding: 1.5rem;
    background-color: #f8fafc;
}

.timeline-header {
    margin-bottom: 1.5rem;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #6b7280;
    font-size: 0.875rem;
} 

/* Hero Section - Mobile First */
.tariff-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem 0;
    position: relative;
}

.hero-main {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.hero-left {
    text-align: center;
    max-width: 100%;
    padding: 0 1rem;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    text-align: center;
}

.hero-title i {
    color: #3498db;
    margin-right: 0.5rem;
    font-size: 1.3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 0.95rem;
    color: #505764;
    margin-bottom: 0.5rem;
    text-align: center;
    display: block;
}

.hero-subtitle i {
    color: #2ecc71;
    margin-right: 0.5rem;
}

.hero-reminder {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 500;
    margin: 0.8rem auto 0;
    padding: 0.5rem 0.8rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    display: inline-block;
    text-align: left;
    max-width: 90%;
}

/* Tablet styles */
@media (min-width: 768px) {
    .tariff-hero {
        padding: 2rem 0;
    }
    
    .hero-main {
        padding: 1.5rem 0;
        margin-bottom: 1.2rem;
    }
    
    .hero-left {
        max-width: 700px;
        margin: 0 auto;
        padding: 0 2rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-title i {
        display: inline;
        margin-bottom: 0;
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-reminder {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .tariff-hero {
        padding: 2.5rem 0;
    }
    
    .hero-left {
        max-width: 800px;
        padding: 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-title i {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Table Container - Mobile First */
.tariff-table-container {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tariff-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    min-width: 390px; /* 調整最小寬度確保變動欄可見 */
    table-layout: fixed; /* 固定表格佈局以控制欄寬 */
}

.tariff-comparison-table th,
.tariff-comparison-table td {
    padding: 0.75rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 欄寬設定 - 以馬來西亞+已發函為最大寬度基準，進一步縮小國家欄 */
.tariff-comparison-table th:nth-child(1),
.tariff-comparison-table td:nth-child(1) {
    width: 38%; /* 國家欄 - 以馬來西亞+已發函為最大寬度 */
    min-width: 110px;
    text-align: left;
}

.tariff-comparison-table th:nth-child(2),
.tariff-comparison-table td:nth-child(2) {
    width: 18%; /* 4/2 欄 */
    min-width: 55px;
}

.tariff-comparison-table th:nth-child(3),
.tariff-comparison-table td:nth-child(3) {
    width: 18%; /* 8/1 欄 */
    min-width: 55px;
}

.tariff-comparison-table th:nth-child(4),
.tariff-comparison-table td:nth-child(4) {
    width: 26%; /* 變動欄 */
    min-width: 70px;
}

.tariff-comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #202124;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.8rem;
}

.tariff-comparison-table th:first-child,
.tariff-comparison-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 11;
    padding-left: 0.8rem; /* 減少左邊距以節省空間 */
}

.tariff-comparison-table tr:last-child td {
    border-bottom: none;
}

.tariff-comparison-table tr:hover {
    background-color: #f8f9fa;
}

/* 國家名稱和狀態標籤的排列優化 */
.tariff-comparison-table .country-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    line-height: 1.3;
}

.tariff-comparison-table .country-name .country-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.tariff-comparison-table .status-badge {
    font-size: 0.58rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0;
    white-space: nowrap;
}

/* 變動欄的樣式 - 加上顏色標示 */
.tariff-comparison-table .change-positive {
    color: #dc2626;
    font-weight: 600;
}

.tariff-comparison-table .change-negative {
    color: #16a34a;
    font-weight: 600;
}

.tariff-comparison-table .change-neutral {
    color: #6b7280;
    font-weight: 500;
}

.tariff-comparison-table .change-value {
    font-size: 0.8rem;
    font-weight: 600;
}

.tariff-comparison-table .change-value::before {
    content: attr(data-prefix);
}

/* 高關稅標示 - 移除紅色底色 */
.tariff-comparison-table .high-tariff {
    color: #dc2626;
    font-weight: 600;
}

/* 表格底部說明 */
.table-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.data-source {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.data-source i {
    color: #9ca3af;
}

/* Tablet styles */
@media (min-width: 768px) {
    .tariff-table-container {
        padding: 1.5rem;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        margin-top: 2rem;
    }
    
    .tariff-comparison-table {
        min-width: auto;
        border-radius: 12px;
    }
    
    .tariff-comparison-table th,
    .tariff-comparison-table td {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .tariff-comparison-table th:first-child,
    .tariff-comparison-table td:first-child {
        position: static;
        padding-left: 1rem;
    }
    
    /* Tablet 時國家名稱可以水平排列 */
    .tariff-comparison-table .country-name {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .tariff-comparison-table .country-name .country-text {
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .country-name {
        font-size: 1rem;
        min-width: 120px;
    }
    
    .status-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
        margin-left: 0.5rem;
        margin-top: 0;
    }
    
    .tariff-comparison-table .status-badge {
        margin-left: 0.5rem;
        padding: 2px 6px;
        font-size: 0.7rem;
    }
    
    .tariff-comparison-table .change-value {
        font-size: 0.85rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .tariff-comparison-table th,
    .tariff-comparison-table td {
        padding: 16px;
        font-size: 15px;
    }
    
    .tariff-comparison-table .country-name .country-text {
        font-size: 1rem;
    }
    
    .tariff-comparison-table .status-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .tariff-comparison-table .change-value {
        font-size: 1rem;
    }
}

/* 排序相關樣式 */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 24px;
}

.sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 12px;
    transition: all 0.2s ease;
    pointer-events: none; /* 確保圖標不會阻擋點擊事件 */
}

.sortable:hover .sort-icon {
    opacity: 0.8;
}

.sortable.asc .sort-icon {
    opacity: 1;
    transform: translateY(-50%) rotate(180deg);
}

.sortable.desc .sort-icon {
    opacity: 1;
}

/* 響應式設計 - 確保在手機上也能看到完整表格 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.4rem;
        line-height: 1.4;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .data-source {
        text-align: center;
        font-size: 0.7rem;
    }
    
    .tariff-table-container {
        padding: 0.8rem;
        margin-top: 1rem;
    }
}

/* Tablet styles for filters */
@media (min-width: 768px) {
    .filters {
        margin: 1.5rem 0;
        padding: 1.25rem;
        border-radius: 0.75rem;
    }
    
    .timeline-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filter-group {
        flex: 1;
        min-width: 180px;
    }
    
    .filter-group label {
        font-size: 0.875rem;
    }
    
    .custom-select {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Desktop styles for filters */
@media (min-width: 1024px) {
    .filters {
        margin: 2rem 0;
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .filter-group {
        min-width: 200px;
    }
}

/* 時間軸樣式 */
.timeline-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.timeline-tab:hover {
    color: #374151;
    background-color: #f9fafb;
}

.timeline-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background-color: #eff6ff;
}

.timeline-container {
    position: relative;
}

.timeline-section {
    display: none;
}

.timeline-section.active {
    display: block;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border-left: 3px solid #e7f1ff;
    transition: all 0.2s;
}

.timeline-item:hover {
    background-color: #f1f5f9;
    border-left-color: #3b82f6;
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.timeline-rate {
    font-size: 1rem;
    font-weight: 700;
    color: #dc2626;
    min-width: 60px;
    text-align: center;
}

.timeline-description {
    font-size: 0.875rem;
    color: #6b7280;
    flex: 1;
    margin-left: 1rem;
}

/* Mobile 樣式調整 */
@media (max-width: 768px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .timeline-date,
    .timeline-rate {
        min-width: auto;
    }
    
    .timeline-description {
        margin-left: 0;
    }
    
    .timeline-tab {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* 響應式調整 - 確保在所有設備上都能看到完整內容 */
@media (max-width: 480px) {
    .tariff-comparison-table {
        min-width: 370px; /* 進一步縮小最小寬度 */
        font-size: 0.78rem;
    }
    
    .tariff-comparison-table th,
    .tariff-comparison-table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.78rem;
    }
    
    .tariff-comparison-table th:nth-child(1),
    .tariff-comparison-table td:nth-child(1) {
        width: 40%; /* 小屏幕上稍微增加國家欄寬度 */
        min-width: 105px;
    }
    
    .tariff-comparison-table th:nth-child(2),
    .tariff-comparison-table td:nth-child(2),
    .tariff-comparison-table th:nth-child(3),
    .tariff-comparison-table td:nth-child(3) {
        width: 17%; /* 進一步縮小稅率欄 */
        min-width: 50px;
    }
    
    .tariff-comparison-table th:nth-child(4),
    .tariff-comparison-table td:nth-child(4) {
        width: 26%; /* 保持變動欄寬度 */
        min-width: 65px;
    }
    
    .tariff-comparison-table .country-name .country-text {
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .tariff-comparison-table .status-badge {
        font-size: 0.55rem;
        padding: 1px 3px;
    }
    
    .tariff-comparison-table .change-value {
        font-size: 0.75rem;
    }
}

/* 響應式設計 - 確保在手機上的點擊體驗更好 */
@media (max-width: 768px) {
    .clickable-country {
        padding: 0.5rem 0.25rem;
        margin: -0.5rem -0.25rem;
        min-height: 44px; /* 確保觸控目標足夠大 */
        display: flex;
        align-items: center;
    }
    
    .clickable-country:hover {
        background-color: #f3f4f6;
        transform: none; /* 在手機上移除 transform 效果 */
    }
    
    .clickable-country:active {
        background-color: #e5e7eb;
        transform: scale(0.98);
    }
}

/* 點擊提示樣式 */
.click-hint {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.clickable-country:hover .click-hint {
    color: #3b82f6;
    opacity: 1;
    transform: translateX(2px);
}

.click-hint i {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.clickable-country:hover .click-hint i {
    transform: translateX(2px);
}

/* 響應式設計 - 手機版本的點擊提示 */
@media (max-width: 768px) {
    .click-hint {
        font-size: 0.7rem;
        margin-left: 0.25rem;
    }
    
    .tariff-comparison-table .country-name .country-text {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .click-hint {
        width: 100%;
        text-align: left;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* 表格提示樣式 */
.table-hint {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #1e40af;
    animation: gentle-pulse 2s ease-in-out infinite;
    flex-wrap: wrap;
}

.table-hint i {
    color: #3b82f6;
    font-size: 1rem;
    flex-shrink: 0;
}

.table-hint > span:first-of-type {
    white-space: nowrap;
}

@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.01);
        opacity: 0.95;
    }
}

/* 響應式設計 - 手機版本的表格提示 */
@media (max-width: 768px) {
    .table-hint {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .table-hint i {
        font-size: 0.9rem;
    }
}

/* 新增：中國關稅時間軸進度條樣式 */
.china-timeline-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

.china-timeline-header {
    text-align: center;
    margin-bottom: 2rem;
}

.china-timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.china-timeline-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.china-timeline-tabs {
    display: flex;
    background: white;
    border-radius: 0.75rem;
    padding: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.china-timeline-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.china-timeline-tab:hover {
    color: #334155;
    background-color: #f1f5f9;
}

.china-timeline-tab.active {
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.china-timeline-section {
    display: none;
}

.china-timeline-section.active {
    display: block;
}

.china-timeline-progress-container {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.china-timeline-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.china-timeline-progress-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.china-timeline-range-info {
    font-size: 0.875rem;
    color: #64748b;
    text-align: right;
}

.china-timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.china-timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}

.china-timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e1;
}

.china-timeline-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    min-width: 80px;
    text-align: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.china-timeline-progress-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.china-timeline-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.china-timeline-rate {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.china-timeline-progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.china-timeline-progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: all 0.8s ease;
    position: relative;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.china-timeline-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.china-timeline-description {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.china-timeline-description strong {
    color: #374151;
    font-weight: 600;
}

/* 進度條顏色根據稅率高低變化 */
.china-timeline-progress-fill.low {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.china-timeline-progress-fill.medium {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.china-timeline-progress-fill.high {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.china-timeline-progress-fill.very-high {
    background: linear-gradient(90deg, #dc2626 0%, #991b1b 100%);
}

/* 移動端響應式調整 */
@media (max-width: 768px) {
    .china-timeline-container {
        padding: 1rem;
    }
    
    .china-timeline-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .china-timeline-date {
        min-width: auto;
        text-align: left;
        align-self: flex-start;
    }
    
    .china-timeline-progress-wrapper {
        width: 100%;
    }
    
    .china-timeline-tab {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .china-timeline-progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .china-timeline-rate {
        font-size: 1rem;
    }
}

/* 最新時間軸項目的特殊樣式 */
.china-timeline-item.latest {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    position: relative;
}

.china-timeline-item.latest::before {
    content: '最新';
    position: absolute;
    top: -8px;
    right: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.china-timeline-item.latest:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.china-timeline-item.latest .china-timeline-date {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.china-timeline-item.latest .china-timeline-rate {
    color: #1d4ed8;
    font-weight: 800;
    font-size: 1.2rem;
}

/* 中國特殊日期小註記樣式 - inline版本 */
.china-note-inline {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.5rem;
    font-weight: 400;
}

/* 確保table-footer不影響表格佈局 */
.table-footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
}

.table-footer .data-source {
    margin-bottom: 0;
}

/* 移動端調整 */
@media (max-width: 768px) {
    .china-note-inline {
        font-size: 0.8rem;
        margin-left: 0.5rem;
    }
    
    .table-hint {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
    }
    
    .table-hint i {
        font-size: 0.9rem;
    }
}