* {
    box-sizing: border-box;
}

a {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    color: #333;
}

h1 {
    font-weight: 700;
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.result-card {
    border: none;
    padding: 30px;
    margin-bottom: 30px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-container {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
}

.score-container p {
    font-size: 0.95em;
    line-height: 1.6em;
    margin: 0;
    margin-bottom: 0.8em;
}

.score-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.score-container .score {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 0;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-O {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}
.score-Q {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}
.score-X {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.score-zero {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    color: #6c757d !important;
    opacity: 0.6;
}

.details-container pre {
    background: #282c34;
    color: #aaa;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
}

.details-container code {
    font-size: 0.8em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
    line-height: 1.6;
    background-color: transparent;
    padding: 0;
}

.summary {
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 1.3em;
    font-weight: 600;
}

.summary.will-work {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
}

.summary.might-work {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid #ffc107;
}

.summary.wont-work {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.summary h2 {
    margin: 0;
    font-size: 1.2em;
}

.test-env-toggle {
    cursor: pointer;
    user-select: none;
    padding: 14px 18px;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid #0366d6;
    transition: all 0.3s ease;
    font-weight: 500;
}

.test-env-toggle:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.2);
}

.test-env-toggle::after {
    content: '▼';
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.test-env-toggle:hover:after {
    color: #0056b3;
}

.test-env-toggle.collapsed::after {
    transform: rotate(-90deg);
}

.test-env-content {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    margin-top: 10px;
    display: none;
    border: 1px solid #e9ecef;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.test-env-content.expanded {
    display: block;
}

.test-env-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95em;
}

.test-env-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.test-env-section h4 {
    margin: 0 0 12px 0;
    font-weight: 600;
}

.test-env-section ul {
    margin: 0;
    padding-left: 25px;
}

.test-env-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

footer {
    margin-top: 50px;
    padding: 30px 0;
    text-align: center;
}

footer a {
    display: inline-block;
    cursor: pointer;
}

footer p {
    margin: 10px 0;
}

footer img {
    opacity: 0.8;
    margin: 0 10px;
    transition: opacity 0.2s ease;
    vertical-align: middle;
    cursor: pointer;
}

footer img:hover {
    opacity: 1;
}

footer hr {
    /* margin: 30px 0; */
    border: 1px solid #DEDEDE;
    margin-bottom: 2em;
}

/* 搜索框樣式 */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 30px auto;
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1em;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.2);
}

.search-dropdown {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 8px;
}

.search-dropdown-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    word-break: break-all;
}

.search-dropdown-item:hover,
.search-dropdown-item.selected {
    background-color: #f0f7ff;
    color: #0366d6;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-no-results {
    margin-top: 8px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #6c757d;
}

.search-meta {
    margin-top: 8px;
    font-size: 0.85em;
    color: #6c757d;
}

.search-load-more {
    cursor: pointer;
    color: #0366d6;
    margin-left: 4px;
}

.search-load-more:hover {
    text-decoration: underline;
}

/* 檢查其他網站按鈕 */
.check-other-site-btn {
    background: linear-gradient(135deg, #0366d6 0%, #0056b3 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 10px 0;
}

.check-other-site-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(3, 102, 214, 0.3);
}

.check-other-site-btn:active {
    transform: translateY(0);
}

/* 響應式設計 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    h1 {
        font-size: 1.75em;
    }

    .result-card {
        padding: 20px;
    }

    .score-stats {
        grid-template-columns: 1fr;
    }

    .summary {
        font-size: 1.1em;
    }

}
