/* JPI HTML Report Generation Service - 优化后的统一样式 */
/* 版本: 2.0 - 删除重复，解决冲突，优化移动端 */

/* ========================================
   1. CSS变量定义（统一主题）
   ======================================== */
:root {
    /* 布局尺寸 */
    --header-height: 60px;
    --header-height-mobile: 80px;
    --content-max-width: 1200px;
    --nav-dots-width: 80px;

    /* 主题色彩 - 收敛商务蓝（方案B） */
    --primary-gradient: linear-gradient(135deg, #16548c 0%, #1e6fb8 100%);
    --primary-color: #1e6fb8;
    --primary-dark: #0f4470;
    --accent-color: #2378c4;

    /* 状态色彩 - 降饱和更显正式 */
    --success: #2e8b6f;
    --warning: #c98a1a;
    --danger: #c0392b;
    --info: #2980b9;

    /* 文字色彩 */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* 背景色彩 - 浅灰系 */
    --bg-white: #ffffff;
    --bg-gray: #f4f5f7;
    --bg-light: #eef0f3;
    --border-light: #e3e6ea;
    --bg-page: #f2f3f5;          /* 页面底色 */

    /* 圆角系统（统一） */
    --radius-card: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;

    /* 玻璃态效果 */
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(255, 255, 255, 0.4);

    /* 阴影系统 - 收敛 */
    --shadow-sm: 0 1px 2px rgba(16,42,67,0.06);
    --shadow-md: 0 2px 6px rgba(16,42,67,0.08);
    --shadow-lg: 0 8px 20px rgba(16,42,67,0.10);
    --shadow-xl: 0 14px 30px rgba(16,42,67,0.12);
}

/* ========================================
   2. 基础样式重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   3. 头部样式（Glassmorphic风格）
   ======================================== */
.report-header,
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.header-container {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 32px;
    width: auto;
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.brand-separator,
.info-separator {
    color: var(--border-light);
    margin: 0 4px;
}

.header-info {
    display: flex;
    align-items: center;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.report-id {
    font-weight: 600;
    color: var(--primary-color);
}

.vehicle-model {
    font-weight: 500;
    color: var(--text-primary);
}

.header-date {
    color: var(--text-secondary);
}

/* ========================================
   4. 移动端进度条
   ======================================== */
.mobile-progress-bar {
    display: none;
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    z-index: 999;
}

.progress-track {
    height: 100%;
    background: #dbeafe;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a93d4 0%, #1e6fb8 100%);
    width: 0;
    transition: width 0.3s ease;
}

.progress-current {
    position: absolute;
    top: 0;
    height: 100%;
    width: 10%;
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    animation: breathe 2s ease-in-out infinite;
    transition: left 0.3s ease;
}

/* ========================================
   5. 主内容布局
   ======================================== */
.report-content {
    margin-top: calc(var(--header-height) + 20px);
    position: relative;
}

.content-wrapper {
    max-width: calc(var(--content-max-width) + var(--nav-dots-width) + 20px);
    margin: 0 auto;
    position: relative;
    padding-right: calc(var(--nav-dots-width) + 20px);
}

.container {
    max-width: var(--content-max-width);
    padding: 0 20px;
}

.main-content {
    margin-top: var(--header-height);
    padding: 2rem 0;
    min-height: calc(100vh - var(--header-height));
}

/* ========================================
   6. 桌面端侧边导航点
   ======================================== */
.desktop-nav-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 100;
}

.nav-dot-wrapper {
    position: relative;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.nav-dot:hover {
    transform: scale(1.5);
    border-color: var(--primary-color);
}

.nav-dot.viewed {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-dot.current {
    width: 16px;
    height: 16px;
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    border: none;
    animation: breathe 2s ease-in-out infinite;
}

.dot-issue-count {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dot-tooltip {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.nav-dot-wrapper:hover .dot-tooltip {
    opacity: 1;
}

.tooltip-issues {
    color: #fbbf24;
    font-size: 11px;
}

/* ========================================
   7. 移动端底部导航点（修复显示问题）
   ======================================== */
.mobile-nav-dots {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    gap: 14px;
    border: 2px solid var(--glass-border);
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.mobile-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-dot:active {
    transform: scale(1.3);
}

.mobile-dot.viewed {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.mobile-dot.current {
    width: 14px;
    height: 14px;
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    border: none;
    animation: breathe 2s ease-in-out infinite;
}

/* ========================================
   8. Toast通知
   ======================================== */
.section-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
    min-width: 200px;
    text-align: center;
}

.section-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
}

.toast-subtitle {
    font-size: 12px;
    color: #fbbf24;
}

/* ========================================
   9. 内容区块和卡片（统一样式）
   ======================================== */
.content-section {
    margin-bottom: 40px;
    scroll-margin-top: calc(var(--header-height) + 20px);
}

/* 顶层 section 卡片 - 更强的边界与阴影，作为大区块 */
.section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 0;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.25s ease;
}

.section-card:hover {
    box-shadow: var(--shadow-lg);
}

/* 子卡片 - 更轻的边界与阴影，区块内层级 */
.info-card,
.card {
    background: var(--bg-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.25s ease;
}

.info-card:hover,
.card:hover {
    box-shadow: var(--shadow-md);
}

/* 顶层 section 头部 - 满蓝渐变（强分隔，便于定位大区块） */
.section-header {
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    color: #fff;
    padding: 16px 20px;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header i {
    color: #fff;
}

.section-header .status-badge {
    background: rgba(255,255,255,0.22);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
}

/* 子卡片头部 - 白底+左侧蓝条（轻分隔，区块内层级） */
.info-card-header,
.card-header {
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    padding: 14px 18px;
    min-height: 56px;
    border: none !important;
    border-left: 4px solid var(--primary-color) !important;
    border-bottom: 1px solid var(--border-light) !important;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}

/* 头部图标固定宽度，标题对齐起点一致 */
.info-card-header i,
.card-header i {
    color: var(--primary-color) !important;
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* 头部标题：撑满剩余宽度，最多两行后省略（保证头部高度可控、多卡片接近等高） */
.info-card-header > span,
.card-header > span,
.card-header > strong {
    flex: 1 1 auto;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 让卡片在 Bootstrap col / h-100 内纵向撑满，行内卡片整体等高 */
.info-card,
.card {
    display: flex;
    flex-direction: column;
}

.info-card-body,
.card-body {
    flex: 1 1 auto;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.section-title h2 {
    margin: 0;
    font-size: 17px;
    color: #fff;
}

.card-header h5 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin: 0;
    min-width: 0;
}

.section-body,
.info-card-body,
.card-body {
    padding: 24px;
    background: white;
}

/* ========================================
   10. 数据表格
   ======================================== */
.data-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 16px;
}

.data-row {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: background-color 0.2s ease;
}

.data-row:last-child {
    border-bottom: none;
}

.data-row:hover {
    background: var(--bg-gray);
}

.data-label {
    flex: 0 0 40%;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.data-value {
    flex: 1;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   11. 条件项布局
   ======================================== */
.condition-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.condition-item:last-child {
    border-bottom: none;
}

.condition-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.condition-value {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    text-align: right;
}

/* ========================================
   12. 特定组件样式
   ======================================== */

/* 刹车系统参考刻度 */
.brake-reference-scale,
.battery-reference-scale,
.voltage-reference-scale {
    display: flex;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid var(--border-light);
}

.scale-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.scale-segment:nth-child(1) {
    background: linear-gradient(135deg, #10b981, #059669);
}

.scale-segment:nth-child(2) {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.scale-segment:nth-child(3) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.scale-segment:nth-child(4) {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.scale-segment:hover {
    transform: scale(1.05);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.scale-value {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.scale-label {
    font-size: 0.7rem;
    opacity: 0.95;
    margin-top: 2px;
}

/* 电压显示 */
.voltage-display,
.battery-voltage-card {
    background: var(--bg-white);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.voltage-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: var(--primary-color);
}

.voltage-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* 灯光网格 */
.lights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.light-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.light-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.light-icon {
    font-size: 1.5rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.light-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.light-status {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ========================================
   13. 里程数显示（Odometer）
   ======================================== */
#odometer .text-center > .card[style*="linear-gradient"] {
    background: var(--bg-white) !important;
    border: 1px solid var(--border-light) !important;
    border-left: 4px solid var(--primary-color) !important;
    border-radius: var(--radius-card) !important;
}

#odometer .text-center > .card .card-body.text-white {
    color: var(--text-primary) !important;
    background: transparent !important;
}

#odometer .text-center h1 {
    color: var(--primary-color) !important;
    font-size: 3.5rem !important;
    font-weight: 700 !important;
}

#odometer .text-center .text-white,
#odometer .text-center .fa-road,
#odometer .text-center p {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
}

/* ========================================
   14. 照片展示
   ======================================== */
.photo-gallery,
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.photo-card,
.photo-item {
    position: relative;
    background: white;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease;
}

.photo-card:hover,
.photo-item:hover {
    box-shadow: var(--shadow-md);
}

.photo-wrapper {
    display: block;
    position: relative;
    height: 200px;
    overflow: hidden;
}

.photo-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-wrapper:hover img {
    transform: scale(1.05);
}

/* ========================================
   15. 3D查看器
   ======================================== */
.viewer-3d {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #f0f2f5, #e5e7eb);
    border-radius: var(--radius-card);
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.viewer-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 30px;
    display: inline-flex;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: auto;
    max-width: fit-content;
}

.viewer-control-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.viewer-control-btn:hover {
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* ========================================
   16. 徽章和状态
   ======================================== */
/* Bootstrap text-primary 对齐主题蓝，全站图标/文字统一 */
.text-primary {
    color: var(--primary-color) !important;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge.bg-success,
.bg-success {
    background: #e8f3ee !important;
    color: #1f6b52 !important;
    border-color: #c4e2d5 !important;
}

.badge.bg-warning,
.bg-warning {
    background: #fbf2dd !important;
    color: #8a5e10 !important;
    border-color: #f0dcab !important;
}

.badge.bg-danger,
.bg-danger {
    background: #fbe9e7 !important;
    color: #a02a1d !important;
    border-color: #f1c4bd !important;
}

.badge.bg-primary,
.badge.bg-info,
.badge.bg-secondary,
.badge.bg-dark,
.bg-primary,
.bg-info,
.bg-secondary,
.bg-dark {
    background: var(--bg-light) !important;
    color: var(--primary-dark) !important;
    border-color: var(--border-light) !important;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.status-completed,
.status-pending {
    background: var(--bg-light);
    color: var(--primary-dark);
    border: 1px solid var(--border-light);
}

/* 条件徽章 */
.condition-excellent {
    background: #e8f3ee;
    color: #1f6b52;
    border: 1px solid #c4e2d5;
}

.condition-good {
    background: #e6f1fb;
    color: #16548c;
    border: 1px solid #c2ddf5;
}

.condition-fair {
    background: #fbf2dd;
    color: #8a5e10;
    border: 1px solid #f0dcab;
}

.condition-poor {
    background: #fbe9e7;
    color: #a02a1d;
    border: 1px solid #f1c4bd;
}

/* ========================================
   17. 发现项和修复项
   ======================================== */
.findings-section {
    margin-top: 24px;
}

.findings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.repair-item {
    background: linear-gradient(135deg, #f0f6fc, white);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-card);
    padding: 16px;
    margin-bottom: 12px;
}

.repair-item.required {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, #fff5f5, white);
}

.repair-item.suggested {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, #fffdf5, white);
}

.repair-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.repair-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.cost-estimate {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   18. 总结和评分
   ======================================== */
.overall-score-card {
    background-color: var(--primary-dark); /* fallback */
    background: var(--primary-gradient);
    color: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
}

.score-label {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* 确保Summary section文字可见 */
#summary .card-body,
#summary .summary-content,
#summary p,
#summary h1,
#summary h2,
#summary h3,
#summary h4,
#summary h5,
#summary span,
#summary div {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

#summary .card {
    background: white !important;
    color: var(--text-primary) !important;
}

/* ========================================
   19. 页脚
   ======================================== */
.report-footer {
    margin-top: 60px;
    padding: 20px;
    background: var(--bg-gray);
    border-top: 1px solid var(--border-light);
}

.footer-content {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-content p {
    margin: 4px 0;
}

/* ========================================
   20. 工具类
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.d-none { display: none; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ========================================
   21. 动画效果
   ======================================== */
@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* ========================================
   22. 移动端响应式（重要：确保导航点显示）
   ======================================== */
@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

    .report-header,
    .main-header {
        height: var(--header-height-mobile);
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        gap: 10px;
    }

    .header-brand {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-logo {
        height: 56px;
        width: auto;
        flex-shrink: 0;
    }

    .brand-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        justify-content: center;
        min-height: 56px;
    }

    .brand-name {
        font-size: 11px;
        line-height: 1.3;
        font-weight: 500;
        max-width: 120px;
        word-wrap: break-word;
    }

    .brand-separator {
        display: none;
    }

    .header-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        min-height: 56px;
        gap: 4px;
    }

    .info-row {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        font-size: 11px;
    }

    .vehicle-model {
        font-weight: 600;
        color: var(--text-primary);
        text-align: right;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .report-id {
        font-weight: 500;
        color: var(--primary-color);
        font-size: 10px;
    }

    .header-date {
        color: var(--text-secondary);
        font-size: 10px;
    }

    .info-separator {
        display: none;
    }

    .mobile-progress-bar {
        display: block !important;
    }

    .desktop-nav-dots {
        display: none !important;
    }

    .mobile-nav-dots {
        display: flex !important;
    }

    .section-toast {
        bottom: 120px;
        min-width: 250px;
        max-width: 80%;
    }

    .content-wrapper {
        padding-right: 0;
    }

    .container {
        padding: 0 12px;
    }

    .report-content {
        margin-top: calc(var(--header-height-mobile) + 24px);
        padding-bottom: 80px;
    }

    .content-section {
        scroll-margin-top: calc(var(--header-height-mobile) + 10px);
        margin-bottom: 28px;
    }

    .section-card {
        border-radius: 10px;
        margin-bottom: 0;
    }

    .info-card,
    .card {
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .section-header,
    .info-card-header,
    .card-header {
        padding: 16px;
    }

    .section-body,
    .info-card-body,
    .card-body {
        padding: 16px;
    }

    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem;
    }

    .data-label,
    .data-value {
        width: 100%;
    }

    .data-label {
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }

    .condition-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .condition-label,
    .condition-value {
        width: 100%;
    }

    .condition-value {
        justify-content: flex-start;
        text-align: left;
    }

    .brake-reference-scale,
    .battery-reference-scale,
    .voltage-reference-scale {
        height: 50px;
    }

    .scale-segment {
        padding: 0.25rem;
    }

    .scale-segment::after {
        display: none;
    }

    .scale-value {
        font-size: 0.875rem;
    }

    .scale-label {
        font-size: 0.6rem;
    }

    .lights-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .voltage-value-large {
        font-size: 2rem;
    }

    #odometer .text-center h1 {
        font-size: 2.5rem !important;
    }

    .photo-gallery,
    .photo-grid {
        gap: 0.5rem !important;
        display: block !important;
    }

    .photo-item {
        margin-bottom: 1rem;
    }

    .photo-wrapper {
        height: 150px !important;
    }

    .viewer-3d {
        height: 350px;
    }

    .viewer-controls {
        bottom: 15px;
        padding: 8px 12px;
    }

    .viewer-control-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .viewer-control-btn i {
        font-size: 1rem;
    }

    .side-nav {
        display: none;
    }

    .main-content {
        margin-top: var(--header-height-mobile);
        padding: 1rem 0;
    }
}

/* 平板响应式 */
@media (min-width: 576px) and (max-width: 768px) {
    .photo-item {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ========================================
   23. 平板设备调整
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-nav-dots {
        right: 10px;
    }
}

/* ========================================
   24. 大屏幕优化
   ======================================== */
@media (min-width: 1400px) {
    .desktop-nav-dots {
        right: calc((100vw - 1400px) / 2 + 20px);
    }
}

/* ========================================
   25. 打印样式
   ======================================== */
@media print {
    .report-header,
    .main-header,
    .desktop-nav-dots,
    .mobile-nav-dots,
    .mobile-progress-bar,
    .section-toast,
    .side-nav,
    .section-nav,
    .viewer-controls,
    .viewer-3d,
    button,
    .btn,
    video,
    audio,
    iframe,
    .no-print {
        display: none !important;
    }

    .report-content,
    .main-content {
        margin-top: 0;
    }

    .content-wrapper {
        padding-right: 0;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .section-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
    }
}

/* ========================================
   26. 浏览器兼容性回退
   ======================================== */
@supports not (backdrop-filter: blur(10px)) {
    .report-header,
    .main-header {
        background: rgba(255, 255, 255, 0.95);
    }

    .mobile-nav-dots {
        background: rgba(255, 255, 255, 0.95);
    }

    .viewer-controls {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ========================================
   27. 深色模式兼容（可选）
   ======================================== */
@media (prefers-color-scheme: dark) {
    .battery-reference-scale,
    .voltage-reference-scale,
    .brake-reference-scale {
        border-color: #374151;
    }
}
