/* ============================================
   淘宝找图 - 主样式
   ============================================ */

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --accent-hover: #d63850;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border: #e8e8e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-sm: 4px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* 容器 */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ========== 顶部导航 ========== */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-logo a {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.site-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link.active { background: var(--accent); color: #fff; }

/* 主体 */
.main-content {
    padding-top: 20px;
    padding-bottom: 40px;
    min-height: calc(100vh - 56px - 50px);
}

/* ========== 顶部分类导航 ========== */
.classification-nav {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    padding: 12px 16px;
}

.gender-nav,
.category-nav,
.subcategory-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.gender-nav:last-child,
.category-nav:last-child,
.subcategory-nav:last-child {
    margin-bottom: 0;
}

.nav-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 48px;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.gender-tab {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gender-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.gender-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.nav-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-tag,
.sub-tag {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-tag:hover,
.sub-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cat-tag.active {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #1a73e8;
    font-weight: 600;
}

.sub-tag.active {
    background: #fce8e6;
    color: #c62828;
    border-color: #c62828;
    font-weight: 600;
}

.nav-status {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.nav-status strong {
    color: var(--text);
}

/* ========== 浏览布局 ========== */
.browse-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* 筛选面板 */
.filter-panel {
    width: 240px;
    flex-shrink: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    position: sticky;
    top: 80px;
}

.filter-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.filter-section {
    margin-bottom: 16px;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.filter-search:focus { border-color: var(--accent); }

/* 品牌组合框 */
.brand-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.brand-combo {
    padding-right: 28px !important;
}

.brand-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #ccc;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.brand-clear:hover {
    background: var(--accent);
}

.filter-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.filter-select:focus { border-color: var(--accent); }

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.filter-submit {
    width: 100%;
    padding: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.filter-submit:hover { background: var(--accent-hover); }

/* ========== 商品区域 ========== */
.product-section {
    flex: 1;
    min-width: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.count-badge {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 8px;
}

/* ========== 商品卡片网格 ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-image {
    position: relative;
    padding-top: 100%; /* 1:1 正方形 */
    background: #f8f8f8;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

.no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
    background: #f0f0f0;
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.removed-badge { background: rgba(0,0,0,0.6); }

.card-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-brand {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    flex: 1;
}

.card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.card-tags {
    display: flex;
    gap: 4px;
}

.card-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.cat-tag {
    background: #e3f2fd;
    color: #1565c0;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
}

.page-link {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-bg);
    transition: all 0.2s;
}

.page-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-info {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 8px;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* ========== 商品详情页 ========== */
.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 8px 0;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); }

.product-detail-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

/* 图片画廊 */
.detail-gallery {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
}

.main-image-container {
    width: 100%;
    margin-bottom: 8px;
    background: #fafafa;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.main-image-container img {
    width: 100%;
    display: block;
}

.no-image-lg {
    padding: 40px 0;
    text-align: center;
    color: var(--text-light);
}

.thumbnail-strip {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.thumb-item {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s;
}

.thumb-item.active { border-color: var(--accent); }
.thumb-item:hover { border-color: var(--accent); }

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品信息 */
.detail-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
}

.detail-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.detail-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.brand-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
}

.brand-en {
    color: var(--text-secondary);
    font-size: 12px;
}

.tmall-link {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    word-break: break-all;
    max-width: 50%;
    text-align: right;
}

.tmall-link:hover { text-decoration: underline; }

.detail-price {
    margin-bottom: 8px;
}

.price-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.price-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.price-sep {
    color: var(--text-light);
    font-size: 14px;
}

.price-na {
    color: var(--text-light);
    font-size: 13px;
}

.detail-status {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
}

.status-badge.active { background: #e8f5e9; color: #2e7d32; }
.status-badge.removed { background: #fbe9e7; color: #c62828; }

.detail-cat-tag {
    padding: 2px 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 10px;
    color: var(--text-secondary);
}

/* 详情区域标题 */
.detail-section {
    margin-bottom: 10px;
}

.detail-section h3 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}

/* SKU 颜色色块 */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.color-swatch {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    font-size: 11px;
}

.color-swatch:hover {
    border-color: var(--accent);
}

.color-swatch.active {
    border-color: var(--accent);
    background: #fff0f0;
}

.color-swatch img {
    width: auto;
    height: 28px;
    max-width: 28px;
    border-radius: 2px;
    object-fit: contain;
    display: block;
    cursor: pointer;
}

.color-name {
    font-size: 11px;
    font-weight: 500;
}

/* 参数表 */
.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.param-table tr:nth-child(even) { background: #fafafa; }

.param-name {
    width: 120px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.param-value {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
}

/* 时间信息 */
.detail-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-light);
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.removed-date { color: var(--accent); }

/* 详情描述 */
.detail-desc-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
    margin-bottom: 16px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 16px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.detail-desc-content {
    max-width: 100%;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.6;
}

.detail-desc-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

.detail-desc-content div[style*="width"] {
    max-width: 100% !important;
}

/* 图片放大灯箱 */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 36px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}

/* ========== 管理面板 ========== */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.admin-card.full-width { grid-column: 1 / -1; }

.admin-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

/* 统计 */
.stats-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 类型分布图表 */
.chart-bars { margin-top: 8px; }

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.chart-label {
    width: 50px;
    text-align: right;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chart-bar-bg {
    flex: 1;
    height: 16px;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b81);
    border-radius: 8px;
    transition: width 0.5s;
}

.chart-count {
    width: 40px;
    font-weight: 600;
}

/* 表单 */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-group label {
    font-weight: 400;
    font-size: 13px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 日志表格 */
.log-table-wrap {
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.log-table th {
    background: var(--bg);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.log-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.log-table tr:hover { background: #fafafa; }

.empty-cell {
    text-align: center;
    color: var(--text-light);
    padding: 24px;
}

.status-success { color: #2e7d32; font-weight: 600; }
.status-failed { color: #c62828; font-weight: 600; }
.status-running { color: #f57f17; font-weight: 600; }

.badge-full { font-size: 11px; padding: 2px 6px; background: #e3f2fd; color: #1565c0; border-radius: 3px; }
.badge-incremental { font-size: 11px; padding: 2px 6px; background: #f3e5f5; color: #7b1fa2; border-radius: 3px; }

/* 帮助 */
.help-content {
    font-size: 13px;
    line-height: 1.8;
}

.help-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.help-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* ========== 详情页头部（标题+下载按钮） ========== */
.detail-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-header-row .detail-title {
    flex: 1;
    margin-bottom: 0;
}

.btn-download {
    flex-shrink: 0;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* ========== 下载弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-container {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.download-loading, .download-error, .download-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 15px;
}

.download-group {
    margin-bottom: 20px;
}

.download-group-header {
    margin-bottom: 10px;
}

.group-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.group-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.group-count {
    color: var(--text-secondary);
    font-weight: 400;
}

.download-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.image-check-label {
    display: block;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s;
    position: relative;
}

.image-check-label:hover { border-color: var(--accent); }

.image-check-label input[type="checkbox"] {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.image-check-label input[type="checkbox"]:checked + .image-check-preview {
    border-color: var(--accent);
}

.image-check-label:has(input:checked) {
    border-color: var(--accent);
    background: #fff5f5;
}

.image-check-preview {
    position: relative;
}

.image-check-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-check-name {
    display: block;
    padding: 4px 6px;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-broken {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: #f8f8f8;
    font-size: 24px;
}

.download-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.download-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 8px;
}

#batchDownloadBtn {
    padding: 10px 24px;
}

#batchDownloadBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== 页脚 ========== */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 14px 0;
    font-size: 13px;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .browse-layout { flex-direction: column; }
    .filter-panel {
        width: 100%;
        position: static;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .header-inner { padding: 0 12px; }
    .site-logo a { font-size: 16px; }
    .container { padding: 0 12px; }
}

/* ========== 账号管理 ========== */
.badge-new {
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

.account-form-row {
    margin-bottom: 16px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.account-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.account-input:focus {
    border-color: var(--accent);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(67, 233, 123, 0.3);
}

/* 账号表格 */
.account-table-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
}

.account-table .account-row {
    transition: background 0.2s;
}

.account-row.status-active { border-left: 3px solid #2e7d32; }
.account-row.status-inactive { border-left: 3px solid #9e9e9e; }
.account-row.status-error { border-left: 3px solid #c62828; }
.account-row.status-locked { border-left: 3px solid #f57f17; }

.account-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.account-status-dot.active { background: #2e7d32; box-shadow: 0 0 6px rgba(46,125,50,0.4); }
.account-status-dot.inactive { background: #9e9e9e; }
.account-status-dot.error { background: #c62828; }
.account-status-dot.locked { background: #f57f17; }

.account-status-text {
    font-size: 13px;
    vertical-align: middle;
}

.cookie-yes { color: #2e7d32; font-weight: 500; font-size: 13px; }
.cookie-no { color: #9e9e9e; font-size: 13px; }

.account-actions {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-account {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.btn-login {
    background: #fff3e0;
    border-color: #ffcc80;
    color: #e65100;
}
.btn-login:hover {
    background: #ffe0b2;
}

.btn-disable {
    color: #666;
}
.btn-disable:hover {
    background: #f5f5f5;
}

.btn-enable {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #2e7d32;
}
.btn-enable:hover {
    background: #c8e6c9;
}

.btn-delete {
    color: #c62828;
}
.btn-delete:hover {
    background: #ffebee;
}

.error-tip {
    cursor: help;
    font-size: 14px;
}

/* 账号使用说明 */
.account-tips {
    background: #f8f9ff;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.8;
    border: 1px solid #e0e0ff;
}

.account-tips ol {
    padding-left: 20px;
    margin-top: 4px;
}

.account-tips strong {
    color: var(--primary);
}
