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

:root {
    --primary:     #4f6ef7;
    --primary-dark:#3a57e8;
    --text:        #1a1a1a;
    --text-sub:    #666;
    --text-muted:  #999;
    --border:      #ebebeb;
    --bg:          #f7f8fc;
    --card-bg:     #ffffff;
    --radius:      12px;
    --shadow:      0 2px 12px rgba(0,0,0,0.07);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== 顶部导航 ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    text-decoration: none;
}

.site-logo:hover {
    text-decoration: none;
    color: var(--primary);
}

/* ===== 搜索框 ===== */
.search-form {
    flex: 1;
    max-width: 420px;
    display: flex;
    gap: 0;
}

.search-form input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}

.search-form input:focus {
    border-color: var(--primary);
    background: #fff;
}

.search-form button {
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* ===== 页面容器 ===== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 32px 10%;
}

/* ===== 首页 Hero ===== */
.hero {
    text-align: center;
    padding: 48px 24px 32px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.hero p {
    font-size: 15px;
    color: var(--text-sub);
}

/* ===== 分类标题 ===== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 顶级分类卡片网格 ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.category-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: block;
    border: 1px solid transparent;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.12);
    border-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}

.category-card .icon {
    font-size: 36px;
    margin-bottom: 10px;
    line-height: 1;
}

.category-card .name {
    font-size: 14px;
    font-weight: 500;
}

.category-card .count {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== 条目卡片网格 ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.item-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,110,247,0.1);
    border-color: #dde4fd;
}

/* 卡片顶部分类色块 */
.item-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8ecfd 100%);
    font-size: 12px;
    color: #4f6ef7;
    font-weight: 700;
}

.item-card-header .cat-icon {
    font-size: 14px;
    line-height: 1;
}

.item-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* 原来的 item-card-cat 不再需要，分类已移到顶部 */
.item-card-cat {
    display: none;
}

.item-card-values {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.value-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.item-card-scene {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}

.item-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.item-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: #ccc;
}

/* ===== 详情页 ===== */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

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

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.detail-cat {
    font-size: 13px;
    color: var(--primary);
    background: #eef1fe;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.detail-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.detail-value-box {
    background: #f7f8fc;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.detail-value-box .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.detail-value-box .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.detail-value-box.highlight .value {
    color: var(--primary);
}

.detail-meta {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-meta-row {
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.detail-meta-row .meta-label {
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.detail-meta-row .meta-value {
    color: var(--text);
}

.detail-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 16px;
}

.btn-buy {
    display: block;
    width: 100%;
    padding: 12px;
    background: #ff6a00;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    margin-top: 16px;
}

.btn-buy:hover {
    background: #e05a00;
    text-decoration: none;
    color: #fff;
}

/* ===== 搜索结果 ===== */
.search-header {
    margin-bottom: 24px;
}

.search-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.search-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.no-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-result .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ===== 页脚 ===== */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 20px 16px;
    }
}
/* ===== 规格表格 ===== */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.spec-table th {
    padding: 9px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    background: #f7f8fc;
    border-bottom: 1px solid var(--border);
}

.spec-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table tr:hover td {
    background: #fafcff;
}

.value-cell {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.value-cell.highlight {
    color: var(--primary);
    font-weight: 700;
}