* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

main {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* 查询区域样式 */
.query-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

.query-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    font-weight: 600;
}

.query-btn:hover {
    background-color: #2980b9;
}

.query-btn:active {
    transform: translateY(1px);
}

/* 结果区域样式 */
.result-section {
    margin-top: 30px;
}

.status-box {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    color: #666;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 表格样式 */
.list-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.result-table th,
.result-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.result-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.result-table th:hover {
    background-color: #e9ecef;
}

.result-table th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.result-table th.asc::after {
    border-bottom: 5px solid #333;
}

.result-table th.desc::after {
    border-top: 5px solid #333;
}

.result-table tr:hover {
    background-color: #f8f9fa;
}

.result-table td {
    white-space: nowrap;
}

/* 图表样式 */
.chart-container {
    margin-bottom: 30px;
    text-align: center;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

#durationChart {
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
}

/* 汇总统计样式 */
.summary-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-top: 30px;
}

.summary-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section h4 {
    margin-bottom: 10px;
    color: #555;
    font-size: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.summary-section ul {
    list-style: none;
    padding-left: 0;
}

.summary-section li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .radio-group {
        gap: 10px;
    }
    
    .radio-group label {
        font-size: 0.85rem;
    }
    
    .result-table th,
    .result-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .chart-legend {
        gap: 15px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
    
    #durationChart {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }
    
    .summary-container {
        padding: 15px;
    }
    
    .summary-section li {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .radio-group label {
        width: 100%;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    #durationChart {
        max-width: 250px;
        height: 200px;
    }
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 按钮加载状态 */
.query-btn.loading {
    position: relative;
}

.query-btn.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* 错误状态 */
.error {
    color: #e74c3c;
    background-color: #fee;
    border: 1px solid #fcc;
}

/* 成功状态 */
.success {
    color: #27ae60;
    background-color: #efe;
    border: 1px solid #cfc;
}