/* --- 核心变量与基础定义 --- */
:root {
    --brand-orange: #ff9800;
    --brand-green: #4caf50;
    --brand-blue: #2196f3;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --bg-body: #f4f7fa;
    --card-bg: #ffffff;
    --border-soft: #edf2f7;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
}
a { text-decoration: none; transition: var(--transition); color: var(--brand-green); }

/* --- 报告说明与权益声明样式 --- */
.disclaimer-section {
    border-radius: 12px;
}

.disclaimer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
}

.disclaimer-content {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

.disclaimer-content:last-child {
    margin-bottom: 0;
}

/* 固定页头 */
.head-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 15px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid #eee;
}

/* 主容器 */
.container {
    max-width: 1200px; /* PC端宽屏显示 */
    margin: 0 auto;
    padding: 20px 50px 20px 20px;
    padding-top: 80px; /* 为固定头部留出空间 */
}

/* --- 顶部 Header --- */
.page-header { margin-bottom: 30px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 15px; }
.page-header h1 { font-size: 30px; font-weight: 800; color: var(--text-dark); }
.page-header p { color: var(--text-muted); font-size: 14px; }

/* --- 通用卡片与版块标题 --- */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.02);
}
.section-header { margin-bottom: 20px; }
.section-title { font-size: 18px; font-weight: 800; border-left: 4px solid var(--brand-orange); padding-left: 12px; line-height: 1; margin-bottom: 6px; }
.section-desc { font-size: 13px; color: var(--text-muted); padding-left: 16px; font-weight: 400; }

/* --- 数据表格样式 (悬停变绿) --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 12px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border-soft); }
.data-table td { padding: 14px 12px; border-bottom: 1px solid var(--border-soft); }
.data-table tr:hover { background: #fafffb; cursor: pointer; }
.data-table tr:hover td { color: var(--brand-green); }
.val-bold { font-weight: 800; color: var(--brand-green); font-size: 15px; }

/* 表格响应式处理 */
.report-table {
    display: table;
    width: 100%;
}

/* 隐藏列的类 */
.hide-on-mobile {
    display: table-cell;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    /* 主容器 */
    .container {
        padding: 160px 10px 10px 10px; /* 为固定头部留出空间 */
    }
    .data-table {
        font-size: 13px;
    }

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

    /* 隐藏发动机型号和众测里程列 */
    .hide-on-mobile {
        display: none;
    }

    /* 调整表格布局 */
    .report-table {
        table-layout: fixed;
    }

    .report-table th:nth-child(4),
    .report-table td:nth-child(4),
    .report-table th:nth-child(7),
    .report-table td:nth-child(7) {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    /* 主容器 */
    .container {
        padding: 160px 10px 10px 10px; /* 为固定头部留出空间 */
    }
    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    /* 进一步隐藏更多列以节省空间 */
    .report-table th:nth-child(3),
    .report-table td:nth-child(3) {
        display: none;
    }
}

/* --- 三大图表指标 --- */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    margin-bottom: 25px; 
    justify-content: center; /* 居中对齐，避免右侧多余间距 */
    max-width: 100%; /* 限制最大宽度 */
}
.stat-card { 
    background: white; 
    border-radius: 16px; 
    padding: 20px; 
    text-align: center; 
    border: 1px solid var(--border-soft); 
    transition: var(--transition);
    height: 392px; /* 固定高度避免布局变化 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.chart-visual { height: 130px; display: flex; align-items: center; justify-content: center; margin: 10px 0; }
.big-num { font-size: 36px; font-weight: 900; color: var(--brand-green); letter-spacing: -1px; }
.big-num span { font-size: 14px; font-weight: normal; margin-left: 4px; }

/* 响应式图表容器 */
.container_chexi_medium_chart {
    width: 100%;
    min-width: 280px;
    height: 350px;
    margin: 0 auto;
}

/* 车主省份分布图 - 特殊优化 */
#container_user_province_proportions {
    height: 400px; /* 默认高度稍微大一些 */
    min-height: 350px;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        height: auto; /* 自适应高度，避免固定高度导致空白太多 */
        padding: 15px;
    }

    .container_chexi_medium_chart {
        min-width: auto;
        height: 380px; /* 增加图表高度 */
        margin: 0 auto;
        min-height: 350px;
    }

    /* 车主省份分布图 - 移动端优化 */
    #container_user_province_proportions {
        height: 450px; /* 省份分布图需要更大高度 */
        min-height: 400px;
    }

    .chart-visual {
        height: 120px;
    }

    .big-num {
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .stat-card {
        height: auto; /* 自适应高度 */
        padding: 12px;
    }

    .container_chexi_medium_chart {
        height: 350px; /* 增加图表高度 */
        margin: 0 auto;
        min-height: 320px;
    }

    /* 车主省份分布图 - 小屏移动端优化 */
    #container_user_province_proportions {
        height: 420px; /* 省份分布图需要更大高度 */
        min-height: 380px;
    }

    .big-num {
        font-size: 24px;
    }
}


/* --- 2. 核心 50/50 均分网格 --- */
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-bottom: 25px; }

/* 相关车型标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud a {
    font-size: 13px; color: var(--brand-blue); background: #f0f7ff;
    padding: 8px 18px; border-radius: 25px; border: 1px solid transparent;
}
.tag-cloud a:hover { background: var(--brand-green); color: white; border-color: var(--brand-green); transform: scale(1.05); }

/* --- 3. 瀑布流车主评价 --- */
.comments-masonry {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}
.comment-card {
    break-inside: avoid;
    background: #f8fafc;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
    transition: var(--transition);
}
.comment-card:hover {
    border-color: var(--brand-green);
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.cmt-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.cmt-user { font-weight: bold; color: var(--text-dark); }
.cmt-content { font-size: 14px; font-weight: 500; color: #334155; line-height: 1.6; }
.cmt-car-tag {
    font-size: 11px; color: var(--text-muted); margin-top: 15px; padding-top: 10px;
    border-top: 1px solid #eef2f7; font-weight: 600;
}
.container_chexi_medium_chart {
    min-height: 300px;
    max-height: 400px;
    margin: 20px auto;
}

/* --- 底部响应式 --- */
@media (max-width: 1024px) {
    .comments-masonry { column-count: 2; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .split-grid, .stats-grid { grid-template-columns: 1fr; }
    .comments-masonry { column-count: 1; }
    .page-header h1 { font-size: 24px; }
    
    /* 报告说明与权益声明 - 移动端 */
    .disclaimer-section {
        padding: 16px;
    }
    .disclaimer-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    .disclaimer-content {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 14px;
    }
}

@media (max-width: 480px) {
    .disclaimer-section {
        padding: 14px;
    }
    .disclaimer-title {
        font-size: 14px;
    }
    .disclaimer-content {
        font-size: 12px;
        line-height: 1.6;
    }
}

footer { text-align: center; padding: 40px 20px; color: #cbd5e1; font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }

/* --- 黑夜模式适配 --- */
@media (prefers-color-scheme: dark) {
  :root {
    /* 背景色：使用深黑色或深灰色 */
    --bg-body: #12141a;       /* 极深蓝黑背景 */
    --card-bg: #1c1f26;       /* 卡片背景，比底色稍浅，增加浮现感 */
    --bg-gray: #252932;       /* 搜索框、输入框、表头等次级背景 */

    /* 文字颜色 */
    --text-dark: #e2e8f0;     /* 主文字：浅灰白 */
    --text-muted: #94a3b8;    /* 辅助文字：中灰蓝 */

    /* 边框与装饰 */
    --border-soft: #2d333f;   /* 线条：深灰色 */

    /* 品牌色微调，在深色背景下，提升颜色的亮度和饱和度，防止“发闷” */
    --brand-green: #66BB6A;
    --brand-blue: #64B5F6;
    --brand-orange: #fbbf24;

    /* 深色背景下的表面色，需要增加不透明度 */
    --brand-green-surface: rgba(102, 187, 106, 0.15);
    --brand-blue-surface: rgba(100, 181, 246, 0.15);
  }

  /* 夜间模式下的基础样式 */
  body {
    background-color: var(--bg-body);
    color: var(--text-dark);
  }

  /* 头部导航 */
  .head-mobile {
    background-color: var(--card-bg);
    border-bottom-color: var(--border-soft);
  }

  .logo-slogan {
    color: var(--text-muted);
  }

  .search .search-input {
    background-color: var(--bg-gray);
    border-color: var(--border-soft);
  }

  .search .search-input input {
    color: var(--text-dark);
  }

  .search .search-input input::placeholder {
    color: var(--text-muted);
  }

  .search .login {
    color: var(--text-dark);
  }

  /* 卡片样式 */
  .card {
    background-color: var(--card-bg);
    border-color: var(--border-soft);
  }

  /* 表格样式 */
  .data-table th {
    color: var(--text-muted);
    border-bottom-color: var(--border-soft);
  }

  .data-table td {
    border-bottom-color: var(--border-soft);
  }

  .data-table tr:hover {
    background-color: var(--bg-gray);
  }

  .data-table tr:hover td {
    color: var(--brand-green);
  }

  /* 统计卡片 */
  .stat-card {
    background-color: var(--card-bg);
    border-color: var(--border-soft);
  }

  .stat-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  }

  /* 相关车型标签云 */
  .tag-cloud a {
    color: var(--brand-blue);
    background-color: var(--brand-blue-surface);
    border-color: transparent;
  }

  .tag-cloud a:hover {
    background-color: var(--brand-green);
    color: white;
    border-color: var(--brand-green);
  }

  /* 评论卡片 */
  .comment-card {
    background-color: var(--bg-gray);
    border-color: var(--border-soft);
  }

  .comment-card:hover {
    background-color: var(--card-bg);
    border-color: var(--brand-green);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }

  .cmt-header {
    color: var(--text-muted);
  }

  .cmt-user {
    color: var(--text-dark);
  }

  .cmt-content {
    color: var(--text-dark);
  }

  .cmt-car-tag {
    color: var(--text-muted);
    border-top-color: var(--border-soft);
  }

  /* 图片亮度调节：防止车标/Logo 在暗色下太刺眼 */
  img {
    filter: brightness(0.8) contrast(1.2);
  }

  /* 报告说明与权益声明 */
  .disclaimer-title {
    color: var(--text-dark);
  }

  .disclaimer-content {
    color: var(--text-muted);
  }
}