/* 基礎樣式 */
:root {
    --bg-color: #1a1a1a;
    --surface-color: #2c3e50;
    --surface-alt-color: #34495e;
    --primary-color: #3498db;
    --secondary-color: #e67e22;
    --accent-color: #2ecc71;
    --text-color: #ecf0f1;
    --text-muted-color: #bdc3c7;
    --danger-color: #e74c3c;
    --border-color: #4a657e;
    --card-border-color: var(--border-color);
    --card-hover-border-color: var(--primary-color);
    --card-selected-border-color: var(--secondary-color);
    --card-selected-shadow-color: rgba(230, 126, 34, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --font-family: 'Microsoft JhengHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 頁首樣式 */
header.hero {
    position: relative;
    overflow: hidden;
    padding: 50px 20px 60px;
    border-bottom: none;
    background: radial-gradient(circle at 20% -10%, rgba(43, 148, 255, 0.4), transparent 55%),
        linear-gradient(135deg, #071b2c 0%, #143354 50%, #0c1a2e 100%);
    box-shadow: none;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-grid {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    width: 100%;
}

.hero-tagline {
    font-size: 18px;
    color: rgba(236, 240, 241, 0.9);
    margin: 0;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-btn {
    border: none;
    border-radius: 999px;
    padding: 12px 28px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn.primary {
    background: linear-gradient(120deg, #4facfe, #00f2fe);
    color: #021026;
    box-shadow: 0 10px 35px rgba(79, 172, 254, 0.4);
}

.hero-btn.ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-btn:hover {
    transform: translateY(-1px);
}

.hero-highlights {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 20px;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
    gap: 6px;
}

.highlight-number {
    font-size: 20px;
    color: #ffffff;
    font-weight: 600;
}

.highlight-label {
    font-size: 12px;
    color: rgba(236, 240, 241, 0.7);
}

.hero-accent {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(35px);
    opacity: 0.35;
}

.hero-accent-one {
    top: -80px;
    left: -70px;
    background: #2bb6f2;
}

.hero-accent-two {
    bottom: -100px;
    right: -60px;
    background: #4facfe;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo img {
    height: 52px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo h1 {
    margin: 0;
    font-size: 26px;
    color: var(--text-color);
    font-weight: 700;
}

.logo-subtitle {
    font-size: 14px;
    color: rgba(236, 240, 241, 0.65);
}

/* Main navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(46, 204, 113, 0.15);
}

/* 廣告樣式 */
.ad-container {
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
    display: none !important; /* 臨時隱藏廣告，顯示完整首頁 */
}

.top-ad {
    margin-top: 30px;
}

.bottom-ad {
    margin-top: 40px;
    margin-bottom: 20px;
}

.ad-placeholder {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    display: inline-block;
    min-width: 728px;
    max-width: 100%;
    box-sizing: border-box;
}

.ad-placeholder p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* 移動端廣告優化 */
@media (max-width: 768px) {
    .ad-placeholder {
        min-width: 300px;
        padding: 15px;
    }
    
    .ad-placeholder p {
        font-size: 12px;
    }
}

/* 搜尋區域樣式 */
.search-section {
    margin: 0;
    background-color: var(--surface-color);
    padding: 30px 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    width: 100%;
}

.search-container {
    width: 100%;
    margin: 0;
}

/* 錯誤訊息樣式 */
.error-message {
    background-color: var(--danger-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    animation: slideDown 0.3s ease-out;
}

.error-message.hidden {
    display: none;
}

.error-message i {
    font-size: 18px;
    flex-shrink: 0;
}

.error-message #errorText {
    flex: 1;
    font-weight: 500;
}

.close-error {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 16px;
    flex-shrink: 0;
}

.close-error:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-header {
    text-align: center;
    margin-bottom: 25px;
}

.search-header h2 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.help-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.help-button:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.search-description {
    margin: 0;
    color: var(--text-muted-color);
    font-size: 16px;
    line-height: 1.5;
}

.search-tips {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--surface-alt-color);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-weight: 600;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 20px;
}

.tip {
    color: var(--text-muted-color);
    font-size: 14px;
    line-height: 1.4;
}

/* 平板設備響應式設計 */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 20px 15px;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 16px;
    }

    .tab-button {
        padding: 12px 18px;
        font-size: 13px;
    }

    .search-container {
        padding: 25px 20px;
    }
}

/* 小螢幕平板優化 */
@media (max-width: 900px) and (min-width: 769px) {
    .results-tabs {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tab-button {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px 5px;
    }

    .search-section {
        padding: 20px 15px;
        margin: 15px 0;
    }

    .results-section {
        padding: 20px 15px;
    }

    .tips-list {
        margin-left: 0;
    }

    .search-header h2 {
        font-size: 20px;
        flex-direction: column;
        gap: 5px;
    }

    .search-description {
        font-size: 14px;
    }

    .search-input {
        flex-direction: column;
        gap: 15px;
    }

    .search-controls {
        flex-direction: column;
        gap: 10px;
    }

    .search-input button {
        width: 100%;
        padding: 14px 20px;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .logo {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .no-results {
        padding: 40px 20px;
    }

    .no-results h3 {
        font-size: 20px;
    }

    /* 手機版隱藏提示文字 */
    .result-item::before {
        display: none;
    }

    /* 手機版標籤優化 */
    .company-basic .company-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .company-basic .company-name h4 {
        min-width: auto;
        width: 100%;
        font-size: 15px;
    }

    .badge-container {
        justify-content: flex-start;
        width: 100%;
    }

    .org-type-badge {
        margin-left: 0;
        font-size: 10px;
        padding: 2px 8px;
    }

    .data-source-badge {
        margin-left: 0;
        font-size: 9px;
        padding: 1px 6px;
    }

    /* 手機版重要狀態描述優化 */
    .company-info span.status-description.important-status {
        font-size: 11px;
        padding: 3px 6px;
    }

    /* 手機版分頁籤優化 */
    .results-tabs {
        gap: 4px;
        padding: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .results-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 44px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tab-count {
        font-size: 10px;
        padding: 3px 6px;
        min-width: 20px;
    }

    header.hero {
        padding: 30px 0 36px;
    }

    .hero-grid {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding: 0 15px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-highlights {
        justify-content: center;
        gap: 16px;
    }

    .highlight-card {
        min-width: 140px;
        padding: 20px 16px;
    }
    }

    .hero-tagline {
        font-size: 16px;
    }

    /* 手機版卡片優化 */
    .result-item::after {
        display: none; /* 隱藏手機版提示文字 */
    }

    .company-basic {
        padding: 14px;
    }

    .logo {
        justify-content: center;
    }

    .logo-subtitle {
        font-size: 12px;
    }
}

/* 組織類型標籤樣式 */
.org-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    gap: 4px;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.org-type-badge.company {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.25);
}

.org-type-badge.company:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.35);
}

.org-type-badge.nonprofit {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.25);
}

.org-type-badge.nonprofit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.35);
}

.org-type-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

/* 資料來源標籤 */
.data-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    margin-left: 6px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.data-source-badge:hover {
    opacity: 1;
}

.data-source-badge.local {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    box-shadow: 0 1px 3px rgba(39, 174, 96, 0.3);
}

.data-source-badge.external {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 1px 3px rgba(243, 156, 18, 0.3);
}

/* 搜尋結果中的組織類型顯示 */
.company-basic .company-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.company-basic .company-name h4 {
    margin: 0;
    flex: 1;
    min-width: 180px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

/* 標籤容器 */
.badge-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Removed .search-tabs and .tab-btn styles */

.search-input {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 15px;
}

.search-input input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--surface-alt-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}





.search-input input::placeholder {
    color: var(--text-muted-color);
    font-style: italic;
}

.search-controls {
    display: flex;
    gap: 8px;
}

.search-input button {
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    justify-content: center;
}

#searchButton {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: white;
    border: 2px solid transparent;
}

#searchButton:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

#searchButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#clearButton {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
    border: 2px solid transparent;
}

#clearButton:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

#clearButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Datalist Suggestions Styling */
/* Note: Styling datalist options is limited and browser-dependent */
/* Attempting basic visibility and color */
#companySuggestions option {
    background-color: var(--surface-alt-color); /* Match input background */
    color: var(--text-color); /* Ensure text is visible */
    padding: 5px 10px; /* Add some padding */
    font-size: 14px; /* Adjust font size if needed */
}

/* 搜尋時間戳樣式 */
.search-timestamp {
    font-size: 14px;
    color: var(--text-muted-color);
    margin-bottom: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* 結果區域樣式 */
.results-section {
    margin-top: 0;
    background-color: var(--surface-color);
    padding: 30px 20px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    min-height: 200px;
    width: 100%;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.results-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
}

.results-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header h2::before {
    content: '📊';
    font-size: 20px;
}

.result-count {
    color: var(--text-muted-color);
    font-size: 14px;
    background-color: var(--surface-alt-color);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* 分頁籤樣式 - 優化版 */
.results-tabs {
    display: flex;
    margin: 20px 0;
    gap: 6px;
    background: linear-gradient(135deg, var(--surface-alt-color) 0%, #3a4f63 100%);
    border-radius: 12px 12px 0 0;
    padding: 8px 8px 0 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.results-tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    border-radius: 12px 12px 0 0;
}

.results-tabs::-webkit-scrollbar {
    height: 4px;
}

.results-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.results-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.tab-button {
    padding: 14px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted-color);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4fa8d8 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 0 0 2px 2px;
}

.tab-count {
    color: var(--text-muted-color);
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 16px;
    min-width: 28px;
    text-align: center;
    line-height: 1;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button:hover .tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    transform: scale(1.05);
}

.tab-button.active .tab-count {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 分頁內容 */
.tab-content {
    position: relative;
    background-color: var(--surface-color);
    border-radius: 0 0 8px 8px;
    min-height: 200px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 所有搜尋結果列表樣式 */
.all-results {
    margin-bottom: 30px; /* Space between list and details */
}

.all-results h3 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

/* 添加歷史結果的樣式 */
.all-results:not(:first-child) {
    opacity: 0.8;
    position: relative;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.all-results:not(:first-child) .results-grid {
    background-color: var(--surface-color);
}

.all-results:not(:first-child) .search-timestamp {
    color: var(--text-muted-color);
    font-style: italic;
}

/* 卡片網格布局優化 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); /* Slightly larger min width */
    gap: 15px; /* Increased gap */
    padding: 10px 0;
}

.results-grid.current-search {
    position: relative;
    padding: 15px;
    background-color: var(--surface-alt-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Responsive grid columns (optional, adjust as needed) */
@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}
@media (min-width: 1600px) { /* Changed breakpoint to 1600px */
    .results-grid {
        grid-template-columns: repeat(5, 1fr); /* Fixed 5 columns */
    }
}

/* 優化的結果卡片設計 */
.result-item {
    background: linear-gradient(135deg, var(--surface-color) 0%, #2a3f54 100%);
    border: 1px solid var(--card-border-color);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item::after {
    /* 移除點擊填入搜尋框提示 */
    content: none !important;
    display: none !important;
}

.result-item:hover {
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--card-hover-border-color);
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

.result-item:hover::before {
    opacity: 1;
}

.result-item:hover::after {
    opacity: 0 !important;
    display: none !important;
}

/* 選中狀態的卡片樣式 */
.result-item.selected {
    border-color: var(--card-selected-border-color);
    box-shadow: 0 0 0 3px var(--card-selected-shadow-color), 0 8px 24px rgba(230, 126, 34, 0.4);
    background: linear-gradient(135deg, var(--surface-alt-color) 0%, #3a4f63 100%);
    transform: translateY(-2px) scale(1.01);
}

.result-item.selected::before {
    opacity: 1;
    background: linear-gradient(90deg, var(--secondary-color), var(--danger-color));
}

.result-item:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 優化的卡片內容樣式 */
.company-basic {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.company-basic > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.company-basic h4 {
    color: var(--text-color);
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-right: 12px;
    flex-grow: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: color 0.3s ease;
}

.result-item:hover .company-basic h4 {
    color: var(--primary-color);
}

.company-info {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Increased gap for better readability */
    font-size: 13px; /* Slightly larger info text */
    margin-bottom: 10px; /* More space before address */
}

.company-info span {
    color: var(--text-muted-color);
    line-height: 1.4;
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 基本資訊項目（統編、代表人、資本額）- 單行顯示 */
.company-info span.basic-info {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 狀態描述 - 只顯示重要狀態 */
.company-info span.status-description {
    white-space: normal;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.02);
    padding: 4px 8px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin-top: 2px;
    font-size: 12px;
}

/* 重要狀態的特殊樣式 */
.company-info span.status-description.important-status {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: #e74c3c;
    color: #c0392b;
    font-weight: 600;
}

/* 非營利組織的重要狀態樣式 */
.result-item[data-org-type="nonprofit"] .status-description.important-status {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.company-address {
    color: var(--text-muted-color);
    font-size: 12px; /* Slightly larger address */
    padding-top: 8px; /* Increased padding */
    border-top: 1px solid var(--border-color); /* Use variable */
    margin-top: auto; /* Push address to bottom */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status { /* General status styling */
    font-weight: 500;
    padding: 2px 8px; /* Adjusted padding */
    border-radius: 4px; /* More rounded */
    font-size: 11px;
    white-space: nowrap; /* Prevent status wrapping */
    flex-shrink: 0; /* Prevent status shrinking */
    border: 1px solid transparent; /* Base border */
}

.status.active {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--accent-color);
    border-color: rgba(46, 204, 113, 0.3);
}

.status.inactive {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--danger-color);
    border-color: rgba(231, 76, 60, 0.3);
}

/* Detailed Information Section Wrapper */
#companyDetailsSection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Common styles for info sections within details */
.info-section {
    margin-bottom: 30px;
    padding: 25px;
    background-color: var(--surface-alt-color); /* Use alt surface color */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

.info-section::before { /* Common title pseudo-element */
    content: attr(data-section-title); /* Use data attribute for title */
    position: absolute;
    top: -14px; /* Adjust position */
    left: 20px;
    background-color: var(--surface-alt-color); /* Match background */
    padding: 2px 10px;
    color: var(--primary-color); /* Default title color */
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.info-section h4 { /* Common section header */
    margin: 0 0 20px 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* Specific Info Section Styling */

/* 基本資料 */
#companyData .company-meta-info {
    /* Removed ::before styling specific to #companyData */
    /* Removed h3 styling specific to #companyData */
}
#companyData .company-meta-info::before {
     content: '基本資料';
     color: var(--primary-color);
     border-color: var(--primary-color);
}

#companyData h3 { /* Main company name */
     margin: 0 0 20px 0;
     color: var(--primary-color);
     font-size: 24px;
     border-bottom: 1px solid var(--primary-color);
     padding-bottom: 15px;
}

#companyData .company-meta-info p {
    margin: 8px 0; /* Reduced margin */
    color: var(--text-muted-color);
    display: flex;
    gap: 8px;
    font-size: 14px; /* Slightly smaller */
    align-items: flex-start;
}

#companyData .company-meta-info p::before {
    content: '•';
    color: var(--primary-color);
    margin-right: 4px;
    line-height: 1.6; /* Match text line-height */
}

#companyData .company-meta-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Adjust minmax */
    gap: 10px 20px; /* Row and column gap */
    margin-top: 15px;
}

/* 董監事資料
#directorsData::before {
    content: '董監事資料';
    color: var(--accent-color);
    border-color: var(--accent-color);
}*/

#directorsData .directors-list {
    list-style: none;
    padding: 0;
}
#directorsData .position-group {
    margin-bottom: 20px;
}
#directorsData .position-group h5 {
    color: var(--text-muted-color);
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
}
#directorsData .position-group ul {
     list-style: none;
     padding: 0;
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
     gap: 15px;
}
#directorsData .director-item,
#directorsData .supervisor-item {
    padding: 10px;
    background-color: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    transition: background-color 0.2s;
}
#directorsData .director-item:hover,
#directorsData .supervisor-item:hover {
    background-color: #40556a;
}

#directorsData .person-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
#directorsData .person-header .position {
    font-weight: 600;
    color: var(--text-muted-color);
}
#directorsData .person-header .name {
    font-weight: 600;
    color: var(--text-color);
}
#directorsData .juristic-person {
    font-size: 12px;
    color: var(--text-muted-color);
    margin-bottom: 8px;
    font-style: italic;
}
#directorsData .person-shares {
    margin-top: 8px;
}
#directorsData .shares-bar {
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 3px;
    margin-bottom: 4px;
    min-width: 1px; /* Ensure bar is visible even for 0% */
}
#directorsData .shares-count {
    font-size: 12px;
    color: var(--text-muted-color);
}

/* 分公司資料
#branchesData::before {
    content: '分公司資料';
    color: var(--secondary-color);
    border-color: var(--secondary-color);
} */
#branchesData .branches-list {
    list-style: none;
    padding: 0;
}
#branchesData .region-group {
    margin-bottom: 20px;
}
#branchesData .region-group h5 {
    color: var(--text-muted-color);
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
}
#branchesData .region-group ul {
     list-style: none;
     padding: 0;
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
     gap: 10px;
}
#branchesData .branch-item {
    padding: 10px;
    background-color: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}
#branchesData .branch-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}
#branchesData .branch-details {
    display: flex;
    flex-direction: column; /* Stack status and address */
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted-color);
    margin-bottom: 5px;
}
#branchesData .branch-address {
    /* Style if needed */
}
#branchesData .branch-manager {
    font-size: 12px;
    color: var(--text-muted-color);
    margin-top: 5px;
    font-style: italic;
}

/* 負責人相關公司樣式 */
.responsible-companies::before {
    content: '負責人相關企業';
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.responsible-companies h4 { /* Already styled by .info-section h4 */
    /* color: var(--secondary-color); */ /* Use default text color */
}
.responsible-companies ul.company-cards-list { /* Target specific ul */
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}
.responsible-companies .company-card-item { /* Target specific li */
    padding: 12px;
    background-color: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.responsible-companies .company-card-item:hover {
    border-color: var(--secondary-color);
    background-color: #40556a;
}
.responsible-companies .card-header strong {
    color: var(--text-color);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}
.responsible-companies .card-info {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.responsible-companies .view-more {
    margin-top: auto; /* Push to bottom */
    padding-top: 6px;
    font-size: 12px;
    color: var(--secondary-color);
    text-align: right;
    font-weight: 500;
}

/* 相關公司樣式 */
.related-companies::before {
    content: '相同產業公司';
    color: var(--accent-color);
    border-color: var(--accent-color);
}
.related-companies h4 { /* Already styled by .info-section h4 */
   /* color: var(--accent-color); */ /* Use default text color */
}
.related-companies .industry-info {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-muted-color);
}
.related-companies ul.companies-grid-list { /* Target specific ul */
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px; /* Space before button */
}
.related-companies .company-grid-item { /* Target specific li */
    padding: 12px;
    background-color: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.related-companies .company-grid-item:hover {
     border-color: var(--accent-color);
     background-color: #40556a;
}
.related-companies .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.related-companies .item-header strong {
    color: var(--text-color);
    font-weight: 600;
    font-size: 15px;
    margin-right: 8px;
}
.related-companies .item-header .capital {
    font-size: 12px;
    color: var(--text-muted-color);
    white-space: nowrap;
    flex-shrink: 0;
}
.related-companies .item-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.related-companies .id-number {
    color: var(--text-muted-color);
}
.related-companies .view-more {
    color: var(--accent-color);
    font-weight: 500;
}
.related-companies .view-all-btn {
    padding: 8px 15px;
    border: 1px solid var(--accent-color);
    background-color: transparent;
    color: var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}
.related-companies .view-all-btn:hover {
    background-color: rgba(46, 204, 113, 0.1);
    color: #fff;
}

/* 公司變更歷史 */
.company-changes-history::before {
    content: '公司變更歷史';
    color: #9b59b6; /* Purple */
    border-color: #9b59b6;
}
.company-changes-history .table-responsive {
    overflow-x: auto; /* Allow horizontal scrolling on small screens */
}
.company-changes-history .changes-table,
.preview-table {
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}
.company-changes-history th,
.company-changes-history td {
    padding: 10px 5px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted-color);
    white-space: nowrap; /* Prevent wrapping initially */
}
.company-changes-history th {
    background-color: var(--surface-color);
    color: var(--text-color);
    font-weight: 600;
}
.company-changes-history tbody tr:last-child td {
    border-bottom: none;
}
.company-changes-history tbody tr:hover td {
    background-color: #40556a;
}
/* Allow wrapping for specific columns if needed */
.company-changes-history td:nth-child(3),
.company-changes-history td:nth-child(4) {
    white-space: normal;
}

/* 公司設立/登記資料 */
.company-establishment-data::before {
    content: '設立/登記資料';
    color: #1abc9c; /* Teal */
    border-color: #1abc9c;
}
.company-establishment-data ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}
.company-establishment-data li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 14px;
    color: var(--text-muted-color);
    display: flex;
    gap: 10px;
}
.company-establishment-data li:last-child {
    border-bottom: none;
}
.company-establishment-data .date {
    font-weight: 600;
    color: var(--text-color);
    flex-shrink: 0;
}
.company-establishment-data .description {
    flex-grow: 1;
}
.company-establishment-data .agency {
    font-style: italic;
    font-size: 13px;
}

/* 載入指示器樣式 - Updated */
/* 優化的載入指示器樣式 */
.loading-indicator {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(44, 62, 80, 0.9) 100%);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--text-color);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
    border-right: 6px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid transparent;
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    margin-top: 30px;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 無結果訊息樣式 */
.no-results {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted-color);
    background-color: var(--surface-alt-color);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.no-results-icon i {
    font-size: 32px;
    color: white;
}

.no-results h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: var(--text-color);
    font-weight: 600;
}

.no-results p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.no-results .suggestions {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.no-results .suggestions li {
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
    font-size: 14px;
    line-height: 1.4;
}

.no-results .suggestions li::before {
    content: '💡';
    position: absolute;
    left: 0;
    top: 8px;
}

/* Modal 樣式 (for full related companies list) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}

.modal-overlay.active {
    display: flex; /* Show when active */
}

.modal-content {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 800px; /* Default width */
}

.modal-content.large {
    width: 1000px; /* Wider modal */
    max-width: 95%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted-color);
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}
.close-modal:hover {
    color: var(--text-color);
}

.modal-body {
    /* Styles for modal content area */
}

.modal-body .company-grid-list.full {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); /* Adjust columns for modal */
}

/* 隱藏元素 - General purpose hidden class */
.hidden {
    display: none;
}

/* 頁尾樣式 */
footer {
    text-align: center;
    padding: 40px 25px;
    color: var(--text-muted-color);
    background: linear-gradient(135deg, var(--surface-color), var(--surface-alt-color));
    margin-top: 0;
    border-top: none;
    font-size: 14px;
    position: relative;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}

.footer-section h4 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.footer-section p {
    margin: 8px 0;
    line-height: 1.6;
    color: var(--text-muted-color);
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 0 0 3px 3px;
}

/* 移動端footer優化 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .footer-section h4 {
        margin-bottom: 10px;
    }
}

/* Excel 匯出按鈕樣式已移除 */

/* Excel 上傳按鈕樣式已移除 */

.action-hint {
    margin-top: 10px;
    color: var(--text-muted-color);
    font-size: 14px;
}

/* 複製功能樣式 */
.company-name-text {
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}

.company-name-text:hover {
    color: var(--primary-color);
}

.company-name-text:hover::after {
    content: '📋';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
}

.tax-id-text {
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}

.tax-id-text:hover {
    color: var(--primary-color);
}

.tax-id-text:hover::after {
    content: '📋';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
}

/* 複製通知樣式 */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.copy-notification.show {
    transform: translateX(0);
}

.copy-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 模態框樣式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-alt-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    font-size: 18px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-color);
}

.modal-body {
    padding: 24px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h3 {
    color: var(--primary-color);
    margin: 0 0 12px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section ul {
    margin: 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.help-section p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

/* 移動端模態框優化 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .help-section h3 {
        font-size: 15px;
    }
}

.copy-notification-content i {
    font-size: 16px;
    color: white;
}

.copy-notification-content span {
    font-size: 14px;
    font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .copy-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .copy-notification.show {
        transform: translateY(0);
    }
    
    .company-name-text:hover::after,
    .tax-id-text:hover::after {
        display: none;
    }
}

.company-name-text.copied,
.tax-id-text.copied {
    background: linear-gradient(90deg, var(--accent-color), #27ae60);
    color: #fff !important;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    position: relative;
    box-shadow: 0 0 8px 2px rgba(46,204,113,0.15);
}

.company-name-text.copied::after,
.tax-id-text.copied::after {
    content: '✔️ 已複製';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--accent-color);
    background: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: bold;
    opacity: 1;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(46,204,113,0.08);
    pointer-events: none;
    animation: copiedPop 0.8s;
}

@keyframes copiedPop {
    0% { opacity: 0; transform: translateY(-50%) scale(0.7); }
    30% { opacity: 1; transform: translateY(-50%) scale(1.1); }
    60% { opacity: 1; transform: translateY(-50%) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) scale(0.7); }
}

@media (max-width: 768px) {
    .company-name-text.copied::after,
    .tax-id-text.copied::after {
        right: 0;
        left: 0;
        top: 110%;
        transform: none;
        text-align: center;
        font-size: 13px;
        width: 100%;
    }
}
