/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background-color: #4285F4;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.ear-tag-info {
    display: flex;
    align-items: center;
}

.ear-tag-info span {
    font-size: 0.9rem;
}

.ear-tag-info .code {
    font-weight: bold;
    font-family: monospace;
    font-size: 1rem;
    margin-left: 5px;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 60px;
}

/* 日期选择器 */
.date-selector {
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.date-selector label {
    font-weight: bold;
    color: #555;
}

.date-input {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.today-btn {
    background-color: #4285F4;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.today-btn:hover {
    background-color: #3367d6;
}

/* 图表容器 */
.chart-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px;
    margin-bottom: 20px;
}

/* 图表选项卡 */
.chart-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #4285F4;
    border-bottom-color: #4285F4;
    font-weight: bold;
}

/* 图表容器 */
.chart-wrapper {
    position: relative;
    height: 300px;
    margin-bottom: 15px;
}

/* 图例 */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* 统计卡片 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #555;
}

.stat-card p {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4285F4;
}

/* 底部区域 */
.footer {
    padding: 0 20px 20px;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 0.9rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #eee;
    border-top-color: #4285F4;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 错误消息 */
.error-message {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .date-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input {
        width: 100%;
    }
    
    .today-btn {
        align-self: flex-start;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .ear-tag-info {
        font-size: 0.8rem;
    }
    
    .chart-wrapper {
        height: 200px;
    }
    
    .legend-item {
        font-size: 0.7rem;
    }
}