/* ===== Design Tokens ===== */
:root {
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-bg-hover: rgba(255, 255, 255, 0.14);
    --card-border: rgba(255, 255, 255, 0.15);
    --card-border-active: rgba(99, 102, 241, 0.6);
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-muted: #a0a0a0;
    --accent: #6366f1;
    --accent-bright: #8184f2;
    --price-color: #ff6b6b;
    --radius: 12px;
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Base ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== 左右分栏布局 ===== */
.page-layout {
    display: flex;
    height: 100vh;
}

/* ===== 左侧面板 ===== */
.left-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 导航 */
.nav-container {
    display: flex;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.nav-container::-webkit-scrollbar { display: none; }

.nav-item {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 14px;
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
}

.nav-item.active {
    color: var(--text-primary);
    font-weight: bold;
    border-bottom-color: var(--accent);
}

.nav-item:hover {
    color: var(--text-primary);
}

/* 工具栏 */
.filter-bar {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sort-item {
    cursor: pointer;
    color: var(--accent-bright);
    font-size: 13px;
}

/* 左侧内容区（可滚动） */
.left-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

/* 推荐分类小标题 */
.recommend-section { margin-bottom: 24px; }

.recommend-cat-title {
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 8px;
    color: var(--text-secondary);
    padding: 0 2px;
}

/* ===== 产品卡片（玻璃态） ===== */
.product-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s, background 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.product-card:hover {
    transform: translateY(-6px);
    background: var(--card-bg-hover);
}

.product-card.selected {
    border-color: var(--card-border-active);
    background: rgba(99, 102, 241, 0.1);
}

/* 角标 */
.category-badge {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--text-primary);
    padding: 2px 6px;
    font-size: 9px;
    border-bottom-left-radius: var(--radius);
    z-index: 1;
    opacity: 0.9;
}

.badge-desktop { background: rgba(227, 115, 24, 0.85); }
.badge-laptop { background: rgba(114, 46, 209, 0.85); }
.badge-aio { background: rgba(43, 164, 113, 0.85); }
.badge-printer { background: rgba(99, 102, 241, 0.85); }
.badge-monitor { background: rgba(0, 203, 217, 0.85); }

/* 卡片图片 */
.card-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

/* 卡片信息 */
.card-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.spec-list {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.spec-item {
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-box { color: var(--price-color); font-weight: bold; }
.price-num { font-size: 14px; }
.price-unit { font-size: 10px; color: var(--text-secondary); }

/* ===== 右侧面板 ===== */
.right-panel {
    width: 360px;
    min-width: 360px;
    overflow-y: auto;
    padding: 16px;
}

/* 广告区 */
#adContent {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ad-hero {
    text-align: center;
    padding: 28px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(67, 56, 202, 0.4));
    border-radius: var(--radius);
    color: var(--text-primary);
    margin-bottom: 20px;
}

.ad-hero h2 {
    font-size: 22px;
    margin: 0 0 10px;
}

.ad-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.ad-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ad-feature {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.ad-feature-icon { margin-bottom: 8px; }

.ad-feature-icon svg {
    stroke: var(--accent);
}

.ad-feature h3 {
    font-size: 14px;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.ad-feature p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.ad-cta {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== 产品详情区 ===== */
.detail-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.detail-img {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 16px;
}

.detail-img-placeholder {
    width: 100%;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.detail-title {
    font-size: 18px;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.detail-price {
    font-size: 20px;
    color: var(--price-color);
    font-weight: bold;
    margin-bottom: 12px;
}

.detail-desc {
    color: var(--text-secondary);
    margin: 0 0 10px;
    line-height: 1.6;
    font-size: 14px;
}

.detail-desc.tech {
    color: var(--text-secondary);
    font-size: 13px;
}

.detail-specs {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.detail-specs td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-specs .spec-label {
    color: var(--text-muted);
    width: 80px;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-back {
    display: inline-block;
    margin-top: 20px;
    padding: 8px 20px;
    color: var(--accent-bright);
    border: 1px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    background: none;
    transition: background 0.2s, color 0.2s;
}

.detail-back:hover {
    background: var(--accent);
    color: var(--text-primary);
}

.detail-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

/* 回到广告按钮 */
.back-to-ad {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent-bright);
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
    padding: 0;
}

.back-to-ad:hover { text-decoration: underline; }
