/* ===== CSS变量定义 ===== */
:root {
    /* 浅色主题 - 优化配色方案 */
    --bg-primary: #f8f9fa;
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-card: rgba(255, 255, 255, 0.98);
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #95a5a6;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.16);
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --info-color: #3498db;
    --highlight-bg: rgba(52, 152, 219, 0.08);
    --highlight-border: rgba(52, 152, 219, 0.2);
}

/* 深色主题 */
.theme-dark {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: rgba(26, 32, 46, 0.95);
    --bg-card: rgba(33, 41, 60, 0.98);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-muted: #95a5a6;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.5);
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
    --info-color: #3498db;
    --highlight-bg: rgba(52, 152, 219, 0.2);
    --highlight-border: rgba(52, 152, 219, 0.4);
}

/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--bg-primary);
    height: 100vh; /* 使用固定高度而不是min-height */
    overflow: hidden; /* 禁止整体滚动 */
    transition: color 0.3s ease, background 0.3s ease;
}

/* ===== 页面头部 ===== */
.header {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo i {
    color: var(--accent-color);
    font-size: 1.3rem;
}

.header-actions {
    display: flex;
    gap: 0.25rem;
}

/* ===== 主要布局 ===== */
.app-layout {
    display: flex;
    height: calc(100vh - 50px);
    max-width: 100%;
    position: relative;
    min-height: 0; /* 确保flex容器可以收缩 */
    overflow: hidden;
}

/* ===== 左侧边栏 ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar.collapsed {
    display: none;
}

/* 左侧预设栏固定展开按钮 */
.sidebar-expand-fixed-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
    box-shadow: var(--shadow-light);
    flex-shrink: 0;
}

.sidebar-expand-fixed-btn:hover {
    background: var(--highlight-bg);
    border-color: var(--info-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.sidebar-expand-fixed-btn:active {
    transform: translateY(0);
}

/* 深色主题下的按钮样式调整 */
.theme-dark .sidebar-expand-fixed-btn {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-dark .sidebar-expand-fixed-btn:hover {
    background: var(--highlight-bg);
    border-color: var(--info-color);
}

.sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.preset-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.preset-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    margin-bottom: 0.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.preset-item:hover {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
}

.preset-item.active {
    background: var(--highlight-bg);
    border-color: var(--info-color);
}

.preset-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    border-radius: 5px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.preset-content {
    flex: 1;
    min-width: 0;
}

.preset-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-description {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

/* ===== 侧边栏展开按钮 ===== */
.sidebar-expand-btn {
    position: fixed;
    top: 80px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.sidebar-expand-btn:hover {
    background: var(--highlight-bg);
    border-color: var(--info-color);
    transform: scale(1.1);
}

.sidebar-expand-btn.dragging {
    opacity: 0.8;
    transform: scale(1.05);
    cursor: move;
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 确保flex容器可以收缩 */
    overflow: hidden;
    background: var(--bg-primary);
    transition: all 0.3s ease;
}

.main-content.expanded {
    width: 100%;
    max-width: 100%;
}

/* ===== 超紧凑面板样式 ===== */
.filter-panel,
.sort-panel {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: max-height 0.3s ease;
    position: relative; /* 为滚动指示器定位 */
}

.filter-panel.ultra-compact,
.sort-panel.ultra-compact {
    min-height: 36px;
}

.filter-panel.collapsed .filter-panel-content,
.sort-panel.collapsed .sort-panel-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 0.75rem;
}

.filter-panel-header,
.sort-panel-header {
    padding: 0.4rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    min-height: 36px;
}

.filter-panel-title,
.sort-panel-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.filter-count,
.sort-count {
    background: var(--accent-color);
    color: white;
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.filter-panel-actions,
.sort-panel-actions {
    display: flex;
    gap: 0.2rem;
}

.filter-panel-content,
.sort-panel-content {
    padding: 0.5rem 0.75rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    /* 添加滚动功能以处理内容过多的情况 */
    max-height: min(40vh, 400px); /* 响应式最大高度：较小者为准 */
    overflow-y: auto; /* 启用垂直滚动 */
    overflow-x: hidden; /* 禁用水平滚动 */
    position: relative; /* 为滚动指示器定位 */
    scroll-behavior: smooth; /* 平滑滚动效果 */
}

/* ===== 滚动指示器样式 ===== */
/* 当内容可滚动时显示顶部阴影（不在顶部时） */
.filter-panel.has-scroll.scroll-middle:before,
.filter-panel.has-scroll.scroll-bottom:before,
.sort-panel.has-scroll.scroll-middle:before,
.sort-panel.has-scroll.scroll-bottom:before {
    content: '';
    position: absolute;
    top: 44px; /* 紧贴header下方 */
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

/* 当内容可滚动时显示底部阴影（不在底部时） */
.filter-panel.has-scroll.scroll-top:after,
.filter-panel.has-scroll.scroll-middle:after,
.sort-panel.has-scroll.scroll-top:after,
.sort-panel.has-scroll.scroll-middle:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.1) 0%, transparent 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

/* 深色主题下的滚动指示器 */
.theme-dark .filter-panel.has-scroll.scroll-middle:before,
.theme-dark .filter-panel.has-scroll.scroll-bottom:before,
.theme-dark .sort-panel.has-scroll.scroll-middle:before,
.theme-dark .sort-panel.has-scroll.scroll-bottom:before {
    background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, transparent 100%);
}

.theme-dark .filter-panel.has-scroll.scroll-top:after,
.theme-dark .filter-panel.has-scroll.scroll-middle:after,
.theme-dark .sort-panel.has-scroll.scroll-top:after,
.theme-dark .sort-panel.has-scroll.scroll-middle:after {
    background: linear-gradient(to top, rgba(255,255,255,0.15) 0%, transparent 100%);
}

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.btn:active {
    transform: translateY(0);
}

.btn-compact {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.btn-micro {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    min-width: 24px;
    height: 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    border-color: var(--info-color);
}

.btn-primary:hover {
    background: #2980b9;
    border-color: #2980b9;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
    border-color: var(--danger-color);
}

.btn.active {
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    border-color: var(--info-color);
}

/* ===== 筛选和排序项样式 ===== */
.filter-container,
.sort-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-item,
.sort-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    animation: slideInDown 0.3s ease;
}

.filter-item.compact,
.sort-item.compact {
    padding: 0.3rem;
    gap: 0.3rem;
}

.filter-item select,
.filter-item input,
.sort-item select {
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.75rem;
    min-height: 28px;
}

.filter-item select.compact,
.filter-item input.compact,
.sort-item select.compact {
    padding: 0.2rem;
    font-size: 0.7rem;
    min-height: 24px;
}

.filter-value-container {
    display: flex;
    gap: 0.3rem;
}

.filter-value-container.compact {
    gap: 0.2rem;
}

/* ===== 结果栏样式 ===== */
.result-bar {
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.result-bar.compact {
    padding: 0.4rem 0.75rem;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.result-count {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.active-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    overflow: hidden;
}

.active-tags.compact {
    gap: 0.2rem;
}

.tag {
    background: var(--highlight-bg);
    color: var(--text-primary);
    border: 1px solid var(--highlight-border);
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    white-space: nowrap;
}

.tag.sort-tag {
    background: #6f42c1;
    color: white;
    border: 1px solid rgba(111, 66, 193, 0.3);
    font-weight: 600;
}

.view-controls {
    display: flex;
    gap: 0.3rem;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.view-toggle .btn {
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--border-color);
}

.view-toggle .btn:last-child {
    border-right: none;
}

/* ===== 相机展示区域 ===== */
.camera-display {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0; /* 确保flex子项可以收缩 */
}

/* ===== 卡片视图样式 ===== */
.camera-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    overflow-y: auto;
    height: 100%;
    max-height: calc(100vh - 180px); /* 确保不超出视口高度 */
}

.camera-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
    box-shadow: var(--shadow-light);
    height: 400px; /* 固定高度，防止被压缩 */
    min-height: 400px; /* 最小高度保证 */
    display: flex;
    flex-direction: column;
    position: relative;
}

.camera-rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-medium);
    border: 2px solid white;
}

.camera-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--highlight-border);
}

.camera-image {
    position: relative;
    height: 120px;
    overflow: hidden;
    cursor: pointer;
    background: #f8f9fa;
}

.camera-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    background: var(--bg-secondary);
}

.camera-image:hover img {
    transform: scale(1.05);
}

.camera-image .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.camera-image:hover .image-overlay {
    opacity: 1;
}

.camera-content {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许内容收缩 */
}

.camera-header {
    display: grid; /* 使用grid布局 */
    grid-template-columns: 1fr auto; /* 左侧自适应，右侧固定 */
    grid-template-rows: auto auto; /* 两行 */
    gap: 0.3rem;
    align-items: center;
    margin-bottom: 0.4rem;
}

.camera-title {
    grid-column: 1; /* 占据第一列 */
    grid-row: 1 / 3; /* 跨两行 */
    flex: 1;
    min-width: 0;
}

.camera-score {
    background: linear-gradient(135deg, var(--accent-color), #e67e22);
    color: white;
    border-radius: 12px; /* 使用与ranking-score一致的圆角矩形样式 */
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.camera-price {
    grid-column: 2; /* 第二列 */
    grid-row: 2; /* 第二行 */
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: 0;
    text-align: center;
}

.camera-brand {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.camera-model {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.1rem;
    line-height: 1.2;
}

.camera-specs {
    display: grid;
    grid-template-columns: 1fr 1fr; /* PC端恢复两列 */
    gap: 0.25rem;
    font-size: 0.7rem;
    flex: 1;
    overflow-y: auto;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    overflow-x: hidden;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
    word-wrap: break-word;
}

.spec-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    min-width: 0;
    word-wrap: break-word;
}

.spec-value {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    min-width: 0;
    word-wrap: break-word;
}

.spec-item.highlighted {
    background: var(--highlight-bg);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    margin: 0.1rem 0;
    border-color: var(--highlight-border);
}

.spec-item.highlighted .spec-value {
    color: var(--info-color);
    font-weight: 700;
}

/* ===== 排名视图样式 ===== */
.chart-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0; /* 确保flex子项可以收缩 */
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-primary);
    height: 100%;
    max-height: calc(100vh - 180px); /* 确保不超出视口高度 */
    min-height: 0; /* 确保可以收缩 */
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    margin-bottom: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.3s ease;
}

.ranking-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--highlight-border);
}

.ranking-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--info-color), #2980b9);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: var(--shadow-medium);
}

.ranking-image {
    width: 60px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.ranking-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-content {
    flex: 1;
    min-width: 0;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.3rem;
}

.ranking-title {
    flex: 1;
    min-width: 0;
}

.ranking-brand {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ranking-model {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.1rem;
    line-height: 1.2;
}

.ranking-score {
    background: linear-gradient(135deg, var(--accent-color), #e67e22);
    color: white;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ranking-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: 0.3rem;
}

.ranking-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.4rem;
    font-size: 0.75rem;
    margin-top: 0.3rem;
    max-width: 100%;
}

.ranking-specs .spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    min-width: 0;
}

/* ===== 图片模态框样式 ===== */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#modalImage {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
}

.image-modal-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-align: center;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.image-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-prev {
    left: 20px;
}

.image-nav-next {
    right: 20px;
}

/* ===== 分享模态框样式 ===== */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.share-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    min-width: 400px;
    max-width: 90%;
}

.share-modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.share-modal-body {
    padding: 1rem;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-url {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.share-info {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
}

/* ===== 详情模态框 ===== */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.detail-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.detail-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.detail-modal-close:hover {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.detail-modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.detail-camera-info {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-camera-image {
    text-align: center;
}

.detail-camera-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

.detail-camera-basic {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-camera-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.detail-camera-brand {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-camera-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-score-value {
    background: linear-gradient(135deg, var(--accent-color), #e67e22);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.detail-camera-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--info-color);
}

.detail-params-section {
    margin-bottom: 1.5rem;
}

.detail-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.detail-param-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.detail-param-item:hover {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
}

.detail-param-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.detail-param-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

/* ===== 动画效果 ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 加载和空状态样式 ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* ===== 自定义滚动条 ===== */
.camera-cards::-webkit-scrollbar,
.preset-menu::-webkit-scrollbar,
.ranking-list::-webkit-scrollbar,
.filter-panel-content::-webkit-scrollbar,
.sort-panel-content::-webkit-scrollbar {
    width: 6px;
}

.camera-cards::-webkit-scrollbar-track,
.preset-menu::-webkit-scrollbar-track,
.ranking-list::-webkit-scrollbar-track,
.filter-panel-content::-webkit-scrollbar-track,
.sort-panel-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.camera-cards::-webkit-scrollbar-thumb,
.preset-menu::-webkit-scrollbar-thumb,
.ranking-list::-webkit-scrollbar-thumb,
.filter-panel-content::-webkit-scrollbar-thumb,
.sort-panel-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.camera-cards::-webkit-scrollbar-thumb:hover,
.preset-menu::-webkit-scrollbar-thumb:hover,
.ranking-list::-webkit-scrollbar-thumb:hover,
.filter-panel-content::-webkit-scrollbar-thumb:hover,
.sort-panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .camera-cards {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.6rem;
        padding: 0.6rem;
    }
    
    .sidebar {
        width: 240px;
    }
}

@media (max-width: 968px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        order: 2;
        transform: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    
    .sidebar.collapsed {
        display: none;
    }
    
    .main-content {
        order: 1;
        height: calc(100vh - 50px);
    }
    
    .camera-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .result-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .result-info {
        justify-content: space-between;
    }
    
    .ranking-item {
        gap: 0.5rem;
        padding: 0.4rem;
    }
    
    .ranking-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .ranking-image {
        width: 50px;
        height: 38px;
    }
    
    .sidebar-expand-btn {
        top: 60px;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .camera-cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.4rem;
        padding: 0.4rem;
    }
    
    .filter-item,
    .sort-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
    
    .filter-value-container {
        flex-direction: column;
    }
    
    .result-bar {
        padding: 0.3rem 0.5rem;
    }
    
    .active-tags {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.2rem;
    }
    
    /* 移动端筛选和排序面板滚动优化 */
    .filter-panel-content,
    .sort-panel-content {
        max-height: min(30vh, 250px); /* 移动端使用更小的高度 */
    }
    
    .ranking-specs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        align-items: center;
    }
    
    .ranking-specs .spec-item {
        flex: 0 0 auto;
        min-width: 80px;
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 3px;
        text-align: center;
        margin: 0;
    }
    
    .share-modal-content {
        min-width: 90%;
        margin: 1rem;
    }
    
    .detail-modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .detail-camera-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detail-camera-image {
        order: -1;
    }
    
    .detail-params-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .detail-modal-body {
        padding: 1rem;
    }
    
    .sidebar.mobile-active {
        position: fixed !important;
        top: 30vh; /* 向上移动到10%位置，增加显示高度 */
        left: 0;
        width: 100%;
        min-height: 70vh; /* 增加到80%高度 */
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: 16px 16px 0 0;
        box-shadow: var(--shadow-heavy);
        overflow: hidden; /* 外层禁止滚动 */
        display: flex !important; /* 使用flex布局 */
        flex-direction: column; /* 垂直布局 */
    }
    
    body.mobile-sidebar-open .sidebar.mobile-active {
        transform: translateY(0); /* 上滑到位置 */
    }
    
    /* 移动端侧边栏标题固定，不滚动 */
    body.mobile-sidebar-open .sidebar.mobile-active .sidebar-header {
        flex-shrink: 0; /* 不收缩 */
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 移动端预设菜单可滚动 - 修复高度问题 */
    body.mobile-sidebar-open .sidebar.mobile-active .preset-menu {
        flex: 1; /* 占据剩余空间 */
        overflow-y: auto; /* 允许滚动 */
        height: auto; /* 自动高度 */
        min-height: 60vh; /* 去除最大高度限制 */
    }
}

@media (max-width: 480px) {
    .camera-cards {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        padding: 0.3rem;
    }
    
    /* 小屏幕设备筛选和排序面板滚动优化 */
    .filter-panel-content,
    .sort-panel-content {
        max-height: min(25vh, 200px); /* 小屏幕设备使用更小的高度 */
        padding: 0.3rem 0.5rem; /* 减小内边距以节省空间 */
    }
    
    .camera-header {
        display: grid; /* 使用grid布局 */
        grid-template-columns: 1fr auto; /* 左侧自适应，右侧固定 */
        grid-template-rows: auto auto; /* 两行 */
        gap: 0.2rem; /* 减小间距，让内容更紧凑 */
        align-items: center;
        margin-bottom: 0.3rem; /* 减小底部间距 */
    }
    
    .camera-title {
        grid-column: 1; /* 占据第一列 */
        grid-row: 1 / 3; /* 跨两行 */
    }
    
    .camera-score {
        grid-column: 2; /* 第二列 */
        grid-row: 1; /* 第一行 */
        /* 使用与ranking-score完全一致的样式 */
        background: linear-gradient(135deg, var(--accent-color), #e67e22);
        color: white;
        border-radius: 12px;
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 700;
        flex-shrink: 0;
    }
    
    .camera-price {
        grid-column: 2; /* 第二列 */
        grid-row: 2; /* 第二行 */
        margin-bottom: 0;
        font-size: 0.75rem; /* 稍微增大字体 */
        text-align: center;
    }
    
    .camera-specs {
        grid-template-columns: 1fr;
        gap: 0.15rem; /* 减小间距 */
        font-size: 0.65rem; /* 进一步减小字体 */
        margin-top: 0.3rem; /* 减小顶部间距 */
        flex: 1; /* 填充剩余空间，使camera-content内部元素高度一致 */
    }
    
    .camera-specs .spec-item {
        display: flex;
        justify-content: space-between;
        align-items: center; /* 确保垂直居中 */
        padding: 0.1rem 1rem; /* 减小垂直padding */
        border-bottom: 1px solid var(--border-color);
    }
    
    .camera-specs .spec-label {
        text-align: right; /* 左侧右对齐 */
        flex: 0 0 45%; /* 固定宽度 */
        color: var(--text-secondary);
        font-size: 0.65rem;
    }
    
    .camera-specs .spec-value {
        text-align: left; /* 右侧左对齐 */
        flex: 0 0 45%; /* 固定宽度 */
        color: var(--text-primary);
        font-weight: 600;
        font-size: 0.65rem;
    }
    
    .filter-panel-header,
    .sort-panel-header {
        padding: 0.3rem 0.5rem;
    }
    
    .result-bar {
        padding: 0.25rem 0.3rem;
    }
    
    .ranking-item {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.4rem;
        position: relative;
    }
    
    .ranking-number {
        position: absolute;
        top: 0.2rem;
        right: 0.2rem;
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        z-index: 2;
    }
    
    .ranking-header {
        width: 100%;
        padding-right: 30px; /* 为右上角序号留空间 */
    }
    
    .ranking-specs {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
        justify-content: flex-start;
    }
    
    .ranking-specs .spec-item {
        flex: 0 0 auto;
        min-width: 75px;
        padding: 0.1rem 0.25rem;
        font-size: 0.6rem;
        margin: 0;
    }
}

/* 移动端遮罩层 */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
} 