/* Hero / Tool Section */
.hero {
    text-align: center;
    background: var(--white);
    padding: 40px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

h1 { font-size: 2rem; margin-bottom: 10px; color: #000; }
.subtitle { color: #666; margin-bottom: 30px; }

/* Input Area */
.input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
    flex-wrap: wrap;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    min-width: 260px;
}
input[type="text"]:focus { border-color: var(--primary-color); }

/* Error message styling */
#input-error-message {
    color: #d32f2f;
    margin-top: 10px;
    padding: 10px;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

button#get-thumb-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
button#get-thumb-btn:hover { background-color: var(--primary-hover); }

/* --- Results Area Styling --- */

.results-container {
    margin-top: 40px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    text-align: center;
    margin-bottom: 20px;
}
.results-header h2 { margin-bottom: 5px; color: #2c3e50; }
.results-header p { font-size: 0.9rem; color: #7f8c8d; }

/* 通用卡片样式 */
.result-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.card-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.res-info {
    font-size: 0.85rem;
    color: #666;
    font-family: monospace;
}

.img-wrapper {
    position: relative;
    background: #000; /* 图片加载前的背景色 */
    display: flex; /* 消除img底部的空隙 */
}

.img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.card-actions {
    padding: 20px;
    text-align: center;
    background: #fff;
}

/* 徽章样式 (HD/SD) */
.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge-hd { background: #ffebee; color: #d32f2f; border: 1px solid #ffcdd2; }
.badge-sd { background: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }
.badge-common { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0; }

/* 按钮样式 */
.download-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
    text-align: center;
    cursor: pointer;
    border: none;
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 主按钮 (HD) - 大且醒目 */
.btn-primary {
    background-color: #2ecc71; /* 绿色代表下载，比红色友好 */
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.2);
}
.btn-primary:hover:not(:disabled) {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(46, 204, 113, 0.3);
    color: white;
    text-decoration: none;
}

/* 次要按钮 - 小一点 */
.btn-secondary {
    display: block; /* 占满宽度 */
    margin: 15px;
    padding: 10px 0;
    background-color: #f1f3f5;
    color: #333;
    border: 1px solid #ddd;
}
.btn-secondary:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #ccc;
    text-decoration: none;
}

/* 批量下载按钮 */
.btn-download-all {
    background-color: #FF0000;
    color: white;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    margin: 20px auto;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
    transition: all 0.2s;
}

.btn-download-all:hover:not(:disabled) {
    background-color: #FF0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(52, 152, 219, 0.3);
}

/* --- 布局控制 --- */

/* Hero Card (HD) - 单独一行，强调显示 */
.hero-card {
    border: 2px solid #2ecc71; /* 绿色边框强调这是最佳选择 */
}

/* Secondary Grid - 下面的一排小卡片 */
.secondary-grid {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.mini-card {
    flex: 1; /* 三个卡片平分宽度 */
}

/* --- Examples Section --- */
.examples-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.examples-title {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.thumbs-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; /* Wrap on small screens */
}

.thumb-item {
    width: 120px; /* Desktop: fit 5 in a row comfortably */
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

/* Hover effect to encourage interaction */
.thumb-item:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

.thumb-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: block;
}

/* Result Area (Hidden initially) */
#result-area {
    display: none;
    margin-top: 30px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}
.thumbnail-card { margin-bottom: 20px; }
.thumbnail-card img { width: 100%; border-radius: 8px; }

/* 移动端适配 - Tools specific */
@media (max-width: 768px) {
    .secondary-grid {
        flex-direction: column; /* 手机上垂直排列 */
    }
    .btn-primary {
        width: 100%; /* 手机上按钮全宽 */
    }
}

@media (max-width: 600px) {
    .thumbs-grid {
        gap: 10px;
    }
    .thumb-item {
        width: calc(33.33% - 10px); /* 3 per row on mobile */
    }
    /* Optional: make 2 per row on very small screens if needed */
    @media (max-width: 400px) {
        .thumb-item { width: calc(50% - 10px); }
    }
}

