/* =========================
 * 查询页专属样式
 * ========================= */

:root {
    --secondary-color: #6B5B95;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--main-color);
    font-size: 32px;
    margin: 0 0 10px;
    display: inline-block;
    position: relative;
}

.header h1::before,
.header h1::after {
    content: '📊';
    position: absolute;
    font-size: 28px;
}

.header h1::before {
    left: -45px;
    top: 50%;
    transform: translateY(-50%);
}

.header h1::after {
    right: -45px;
    top: 50%;
    transform: translateY(-50%);
}

.header p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group-full {
    display: flex;
    flex-direction: column;
}

.form-group-full label {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group-full input {
    padding: 10px 14px;
    border: 1px solid var(--soft-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group-full input:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.15);
}

/* 筛选选择器样式 */
.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.filter-group {
    background: #fafafa;
    border: 1px solid var(--soft-gray);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.filter-group:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.filter-header:hover {
    background: rgba(255, 105, 180, 0.05);
    margin: 0 -12px;
    padding: 8px 12px;
    border-radius: 6px;
}

.filter-icon {
    font-size: 16px;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.filter-count {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

.filter-toggle-icon {
    margin-left: 8px;
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    padding: 0;
    margin: 0;
}

.filter-options:not(.collapsed) {
    max-height: 500px;
    padding: 0 0 10px 0;
    margin: 10px 0 0 0;
}

.filter-option {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #495057;
    user-select: none;
}

.filter-option:hover {
    border-color: var(--main-color);
    background: #fff0f5;
    transform: translateY(-1px);
}

.filter-option.active {
    background: linear-gradient(135deg, var(--main-color), #ff4f93);
    border-color: var(--main-color);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.3);
}

.filter-option:active {
    transform: scale(0.98);
}

.filter-option input[type="checkbox"] {
    display: none;
}

.option-text {
    pointer-events: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--main-color), #ff4f93);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-export {
    background: #6c757d;
    color: #fff;
}

.btn-export:hover {
    background: #5a6268;
}

/* 导出菜单样式 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--soft-gray);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 150px;
}

.export-menu.show {
    display: block;
}

.export-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s;
}

.export-menu a:hover {
    background: #f8f9fa;
    color: var(--main-color);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #fff5fa, #fff0f5);
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--main-color);
}

.stats-info {
    font-size: 15px;
    color: #666;
}

.stats-info strong {
    color: var(--main-color);
    font-size: 18px;
}

.error-message {
    color: #dc3545;
    background: #fff5f5;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--soft-gray);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: none;
}

table.data-table thead {
    background: linear-gradient(135deg, #fff5fa, #fff0f5);
}

table.data-table th,
table.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--soft-gray);
    border-top: none;
}

table.data-table th {
    background: transparent;
    color: #d94a93;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* 特定列宽度调整 */
table.data-table th:nth-child(1),
table.data-table td:nth-child(1) {
    width: 60px;
}

table.data-table th:nth-child(2),
table.data-table td:nth-child(2) {
    width: 80px;
}

table.data-table th:nth-child(3),
table.data-table td:nth-child(3) {
    width: 100px;
}

table.data-table th:nth-child(4),
table.data-table td:nth-child(4) {
    width: 120px;
}

table.data-table th:nth-child(5),
table.data-table td:nth-child(5) {
    min-width: 250px;
    max-width: 400px;
    white-space: normal;
    word-break: break-word;
}

table.data-table th:nth-child(6),
table.data-table td:nth-child(6) {
    width: 120px;
}

table.data-table th:nth-child(7),
table.data-table td:nth-child(7) {
    width: 100px;
}

table.data-table th:nth-child(8),
table.data-table td:nth-child(8) {
    width: 60px;
}

table.data-table tr:hover {
    background: #fafafa;
}

/* 可排序表头 */
th.sortable {
    cursor: pointer;
}

th.sortable a {
    color: inherit;
    text-decoration: none;
}

th.sortable a:hover {
    text-decoration: underline;
}

th.sortable.asc::after {
    content: ' ↑';
}

th.sortable.desc::after {
    content: ' ↓';
}

/* 获奖等级徽章 */
.award-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.award-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b6900;
}

.award-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #555;
}

.award-3 {
    background: linear-gradient(135deg, #cd7f32, #e8a86a);
    color: #8b4500;
}

.award-default {
    background: #f0f0f0;
    color: #666;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--soft-gray);
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
}

.pagination .active {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    table.data-table th,
    table.data-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}
