/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 全局变量 */
:root {
    --primary-color: #007AFF;
    --secondary-color: #0056b3;
    --background-color: #F2F2F7;
    --text-color: #333;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* 基础布局 */
body {
    background-color: #f5f7fa;
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 头部样式 */
header {
    background: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

header h1 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

/* 导航样式 */
nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
}

nav a.active {
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
}

/* 主要内容区域 */
main {
    padding: 0 1rem;
}

/* 上传区域样式 */
.upload-section {
    margin: 1rem auto 2rem;
    max-width: 1200px;
    transform: none;
}

.upload-area {
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    margin: 0 auto;
    max-width: 800px;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-content img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.upload-content h2 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.upload-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.upload-tip {
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* 价格概览区域样式 */
.price-overview {
    margin: 2rem 0;
}

/* 筛选栏样式 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-select, .search-input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.category-select {
    min-width: 150px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

/* 演示数据按钮 */
.demo-data-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

.demo-data-btn:hover {
    background-color: #45a049;
}

.demo-data-btn i {
    font-size: 1rem;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.price-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.price-card:hover {
    transform: translateY(-2px);
}

.price-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-label {
    color: var(--text-color);
    font-size: 0.9rem;
    min-width: 60px;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.max-price {
    color: #ff4d4f;
}

.min-price {
    color: #52c41a;
}

.avg-price {
    color: #333;
}

.price-detail {
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    padding-left: calc(60px + 0.5rem);
}

.price-detail small {
    color: var(--text-color);
    opacity: 0.7;
    display: block;
    line-height: 1.4;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #666;
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.nav-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #1890ff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: #40a9ff;
}

/* 图表区域样式 */
.chart-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
}

.chart-container {
    position: relative;
    height: 400px;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.notification p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header {
        padding: 1rem 0.5rem;
    }

    nav {
        gap: 1rem;
    }

    main {
        padding: 0 0.5rem;
    }

    .price-grid {
        grid-template-columns: 1fr;
    }

    .chart-header {
        flex-direction: column;
        gap: 1rem;
    }

    .upload-section {
        margin: 1rem 0;
        padding: 0;
    }

    .upload-area {
        padding: 1.5rem;
    }

    .price-card {
        padding: 1.2rem;
    }

    .price-value {
        font-size: 1.2rem;
    }

    .price-label {
        min-width: 50px;
        font-size: 0.85rem;
    }

    .price-detail {
        padding-left: calc(50px + 0.5rem);
    }

    .three-years-summary h3 {
        font-size: 1.2rem;
    }
}

/* 文件格式说明样式 */
.template-download {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 122, 255, 0.05);
    border-radius: var(--border-radius);
}

.template-download p {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

.format-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.format-table th,
.format-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.format-table th {
    background: #F8F9FA;
    font-weight: 500;
    color: var(--text-color);
}

.format-table td {
    color: #666;
}

.template-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.template-btn:hover {
    background: var(--primary-color);
    color: white;
}

.template-btn:hover img {
    filter: brightness(0) invert(1);
}

.template-btn img {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

/* 近三年统计卡片特殊样式 */
.three-years-summary {
    grid-column: 1 / -1;
    background: #fafafa;
    border: 1px solid var(--border-color);
}

.three-years-summary h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* 价格趋势图表区域样式 */
.price-trend {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.period-select {
    padding: 0.5rem 1rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 确保价格卡片样式正确 */
.price-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.three-years-summary {
    grid-column: 1 / -1;
    background-color: #f6f9fe;
    border-left: 4px solid #1890ff;
}

.price-info {
    margin-top: 1rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.price-label {
    color: var(--text-color);
    font-weight: 500;
}

.max-price {
    color: #ff4d4f;
    font-weight: 700;
}

.min-price {
    color: #52c41a;
    font-weight: 700;
}

.avg-price {
    color: #1890ff;
    font-weight: 700;
}

.price-detail {
    margin-bottom: 1rem;
    color: #666;
    text-align: right;
    font-size: 0.9rem;
}

.no-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #999;
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 1;
}

.no-data-message p {
    margin: 0;
    font-size: 1rem;
}