/* ========================================
   创慕建材购 - 公共样式表
   CONEMOON BUILDING MATERIALS
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-color: #1a3a5c;
    --primary-dark: #142d47;
    --primary-light: #2a5a8c;
    
    /* 强调色 */
    --accent-color: #e8792b;
    --accent-dark: #d06a1f;
    --accent-light: #f8943f;
    
    /* 状态色 */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    /* 中性色 */
    --bg-color: #f5f6fa;
    --card-bg: #ffffff;
    --border-color: #e8e9ed;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    
    /* 尺寸 */
    --max-width: 1200px;
    --sidebar-width: 240px;
    --header-height: 100px;
    --nav-height: 50px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 过渡 */
    --transition: all 0.3s ease;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--accent-color);
}

ul, ol {
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* 容器 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   头部样式
   ======================================== */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.857rem;
    padding: 8px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top a {
    color: #fff;
    margin-left: 15px;
}

.header-top a:hover {
    color: var(--accent-color);
}

/* V437：三语平台切换器。首页使用静态 HTML，确保业务脚本异常时仍然可见。 */
.v437-language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 15px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    vertical-align: middle;
}

.v437-language-label {
    margin: 0 3px 0 5px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.v437-language-button {
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.v437-language-button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.v437-language-button.active {
    background: #fff;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .v437-language-switcher {
        position: static;
        margin: 0;
        border-color: rgba(26, 58, 92, 0.22);
        background: #fff;
        box-shadow: none;
    }

    .v437-language-label {
        display: none;
    }

    .v437-language-button {
        padding: 7px 8px;
        color: #344054;
        font-size: 11px;
    }

    .v437-language-button:hover {
        background: #eef4fa;
    }

    .v437-language-button.active {
        background: var(--primary-color);
        color: #fff;
    }
}

.v440-mobile-brand-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

.v440-mobile-brand-stack > .v437-language-switcher {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;
    margin: 3px 0 0;
    border-color: rgba(26, 58, 92, 0.22);
    background: #fff;
    box-shadow: none;
}

.v440-mobile-brand-stack > .v437-language-switcher .v437-language-label {
    color: #667085;
}

.v440-mobile-brand-stack > .v437-language-switcher .v437-language-button {
    color: #344054;
}

.v440-mobile-brand-stack > .v437-language-switcher .v437-language-button.active {
    background: var(--primary-color);
    color: #fff;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: grid;
    grid-template-columns: max-content minmax(280px, 480px) max-content minmax(90px, 1fr);
    align-items: stretch;
    column-gap: 24px;
}

.logo {
    --logo-main-line-height: 1.15;
    --logo-sub-line-height: 1.1;
    --platform-logo-height: calc((1.714rem * var(--logo-main-line-height)) + 2px + (0.643rem * var(--logo-sub-line-height)));
    --platform-logo-max-width: clamp(90px, 10vw, 170px);
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    justify-items: start;
    flex-shrink: 1;
    min-width: 0;
    position: relative;
}

.logo.has-platform-logo {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(0, auto);
}

.platform-logo-slot {
    position: static;
    width: max-content;
    max-width: var(--platform-logo-max-width);
    height: var(--platform-logo-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    grid-column: 1;
    grid-row: 1 / 3;
    visibility: hidden;
}

.platform-logo-slot.has-logo {
    visibility: visible;
}

.platform-logo-slot img {
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}

.logo-main {
    font-size: 1.714rem;
    line-height: var(--logo-main-line-height);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
    grid-column: 2;
    grid-row: 1;
}

.logo-sub {
    font-size: 0.643rem;
    line-height: var(--logo-sub-line-height);
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 2px;
    grid-column: 2;
    grid-row: 2;
}

/* V77：首页左上角 Logo 上方彩带已移除 */
.logo::before {
    content: none !important;
    display: none !important;
}

.search-box {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 100%;
    max-width: 480px;
    display: flex;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--primary-color);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 1rem;
}

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

.search-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-weight: 500;
    transition: var(--transition);
}

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

.header-actions {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-self: end;
    align-self: end;
    gap: 6px;
    padding-bottom: 1px;
}

.header-action {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    position: relative;
    line-height: 1.4;
}

.header-action:hover {
    color: var(--accent-color);
}

.platform-counts {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    row-gap: 4px;
    min-width: 0;
    justify-self: start;
    align-self: end;
    padding-left: 0;
    color: var(--text-primary);
    font-size: 0.929rem;
    line-height: 1.35;
    white-space: nowrap;
}

.header-main .container > .platform-counts:last-child {
    margin-left: 0;
}

.platform-counts div {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
}

.platform-counts strong {
    text-align: right;
    color: var(--accent-color);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.714rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 导航栏 */
.nav {
    background: var(--primary-color);
}

.nav .container {
    display: flex;
    align-items: center;
}

.nav-category {
    background: var(--primary-dark);
    color: #fff;
    padding: 15px 25px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.nav-category:hover {
    background: var(--accent-color);
}

.nav-category::before {
    content: "☰";
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    margin-left: 20px;
}

.nav-links a {
    color: #fff;
    padding: 15px 20px;
    display: block;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.1);
    color: var(--accent-color);
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

/* ========================================
   侧边栏分类菜单
   ======================================== */
.category-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: none;
}

.nav-category:hover .category-menu,
.nav-category.is-open .category-menu {
    display: block;
}

.category-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    color: #333;
    font-size: 14px;
}

.category-item:hover {
    background: var(--bg-color);
}

.category-menu-row {
    position: relative;
    justify-content: space-between;
}

.category-menu-row .category-main-link {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.category-menu-row .category-submenu-panel {
    top: -1px;
}

.category-item::before {
    display: none;
}

.category-item:hover::before {
    background: var(--accent-color);
}

/* ========================================
   内容区域
   ======================================== */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 280px);
}

/* 面包屑 */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.857rem;
    color: var(--text-secondary);
}

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

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

.breadcrumb span {
    margin: 0 8px;
    color: var(--text-light);
}

/* 页面标题 */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* ========================================
   卡片样式
   ======================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 20px;
    transition: var(--transition);
}

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

/* ========================================
   按钮样式
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-text {
    background: transparent;
    color: var(--accent-color);
    padding: 5px 10px;
}

.btn-text:hover {
    background: rgba(232,121,43,0.1);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.857rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   表单样式
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(232,121,43,0.1);
}

.form-control.error {
    border-color: var(--danger-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.857rem;
    margin-top: 5px;
}

.form-hint {
    color: var(--text-light);
    font-size: 0.857rem;
    margin-top: 5px;
}

/* 复选框和单选框 */
.checkbox, .radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox input, .radio input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========================================
   表格样式
   ======================================== */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-color);
}

.table-actions {
    display: flex;
    gap: 10px;
}

/* ========================================
   标签/徽章
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary { background: rgba(26,58,92,0.1); color: var(--primary-color); }
.badge-accent { background: rgba(232,121,43,0.1); color: var(--accent-color); }
.badge-success { background: rgba(39,174,96,0.1); color: var(--success-color); }
.badge-warning { background: rgba(243,156,18,0.1); color: var(--warning-color); }
.badge-danger { background: rgba(231,76,60,0.1); color: var(--danger-color); }
.badge-info { background: rgba(52,152,219,0.1); color: var(--info-color); }

/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.857rem;
}

.status-pending { background: #fff3e0; color: #e65100; }
.status-processing { background: #e3f2fd; color: #1565c0; }
.status-shipped { background: #e8f5e9; color: #2e7d32; }
.status-completed { background: #f5f5f5; color: #616161; }
.status-cancelled { background: #ffebee; color: #c62828; }

/* ========================================
   轮播图
   ======================================== */
.banner-slider {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.banner-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.banner-slide {
    min-width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    text-align: center;
}

.banner-slide:nth-child(2) {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f39c12 100%);
}

.banner-slide:nth-child(3) {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.banner-dot.active {
    background: #fff;
    transform: scale(1.2);
}

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.banner-arrow:hover {
    background: rgba(0,0,0,0.5);
}

.banner-arrow.prev { left: 20px; }
.banner-arrow.next { right: 20px; }

/* ========================================
   商品卡片
   ======================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e8e9ed 0%, #d0d3d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-badge {
    padding: 3px 8px;
    font-size: 0.714rem;
    border-radius: 2px;
    color: #fff;
}

.product-badge.hot { background: var(--danger-color); }
.product-badge.new { background: var(--success-color); }
.product-badge.sale { background: var(--accent-color); }

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 0.929rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.product-name:hover {
    color: var(--accent-color);
}

.product-price {
    color: var(--accent-color);
    font-size: 1.286rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.product-unit {
    font-size: 0.786rem;
    font-weight: 400;
    color: var(--text-light);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.786rem;
    color: var(--text-light);
    margin-top: 10px;
}

/* ========================================
   金刚区
   ======================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.category-icon {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.category-icon:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.category-icon::before {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.category-icon span {
    display: block;
    font-size: 0.857rem;
    color: var(--text-primary);
}

.category-icon:hover span {
    color: var(--accent-color);
}

/* ========================================
   品牌区
   ======================================== */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.brand-item {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.brand-item:hover {
    box-shadow: var(--shadow-md);
}

.brand-logo {
    width: 80px;
    height: 40px;
    background: var(--bg-color);
    margin: 0 auto 15px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
}

.brand-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* ========================================
   底部
   ======================================== */
.footer {
    background: var(--primary-color);
    color: #fff;
    margin-top: 50px;
}

.footer-top {
    padding: 40px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-about h3 {
    font-size: 1.286rem;
    margin-bottom: 15px;
}

.footer-about p {
    color: rgba(255,255,255,0.7);
    line-height: 1.8;
}

.friend-links-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.8;
}

.friend-links-row[hidden] { display: none !important; }
.friend-links-row a { color: rgba(255,255,255,0.78); text-decoration: underline; text-underline-offset: 2px; }
.friend-links-row a:hover { color: var(--accent-color); }
.friend-links-row .friend-link-separator { color: rgba(255,255,255,0.4); }

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.7);
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.857rem;
}

/* ========================================
   分页
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.pagination .active {
    background: var(--primary-color);
    color: #fff;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   弹窗
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.143rem;
    font-weight: 600;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 商品微信分享：保持二维码与字号，收紧无效留白。 */
#modal > .modal.wechat-share-modal {
    width: 420px;
    max-width: calc(100% - 24px);
}

/* 分享弹窗需要盖住手机端固定购买栏，并允许短屏幕滚动到底部操作按钮。 */
#modal.wechat-share-overlay {
    z-index: 12000;
}

#modal > .modal.wechat-share-modal .modal-header {
    padding: 14px 18px;
}

#modal > .modal.wechat-share-modal .modal-body {
    padding: 14px 18px 18px;
}

#modal > .modal.wechat-share-modal .modal-footer {
    display: none;
}

.wechat-share-content {
    width: 100%;
    text-align: center;
}

.wechat-share-product-title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.45;
}

.wechat-share-qr {
    display: block;
    box-sizing: content-box;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.wechat-share-fallback {
    display: none;
    margin: 8px 0;
    color: #e67e22;
}

.wechat-share-tip {
    margin: 9px 0 7px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.wechat-share-link {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
}

.wechat-share-guide {
    margin: 8px 0 0;
    color: #8a969f;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
}

.wechat-share-guide.is-highlighted {
    color: #c45d12;
    background: #fff7ed;
    border-radius: 5px;
    padding: 7px 9px;
}

.wechat-share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 600px) {
    #modal.wechat-share-overlay {
        align-items: flex-start;
        justify-content: center;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    #modal > .modal.wechat-share-modal {
        width: calc(100% - 24px);
        max-width: 420px;
        max-height: none;
        margin: auto 0;
        overflow: visible;
    }

    #modal > .modal.wechat-share-modal .modal-header {
        padding: 12px 14px;
    }

    #modal > .modal.wechat-share-modal .modal-body {
        padding: 12px 14px 15px;
    }

    .wechat-share-actions {
        margin-top: 10px;
        gap: 8px;
    }

    .wechat-share-actions .btn {
        padding-left: 11px;
        padding-right: 11px;
    }

    .wechat-share-actions .btn:first-child {
        flex: 0 0 100%;
    }
}

/* ========================================
   Tab标签
   ======================================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-item {
    padding: 12px 24px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

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

.tab-item.active {
    color: var(--accent-color);
}

.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   左侧边栏布局
   ======================================== */
.layout-with-sidebar {
    display: flex;
    gap: 30px;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-menu {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: visible;
    position: relative;
}

.sidebar-menu-title {
    padding: 15px 20px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.sidebar-menu-item {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

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

.sidebar-menu-item:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.sidebar-menu-item.active {
    background: rgba(232,121,43,0.1);
    color: var(--accent-color);
}

.sidebar-menu-item.parent-active {
    background: rgba(232,121,43,0.06);
    color: var(--accent-color);
}

.sidebar-menu-item::before {
    display: none;
}

.category-sidebar-row {
    position: relative;
}

.category-sidebar-row .category-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.category-sidebar-row .category-arrow {
    margin-left: auto;
    color: var(--text-primary);
}

.category-sidebar-row:hover .category-arrow,
.category-sidebar-row.parent-active .category-arrow,
.category-sidebar-row.active .category-arrow {
    color: var(--accent-color);
}

.category-submenu-panel {
    position: absolute;
    left: calc(100% + 1px);
    top: -1px;
    min-width: 180px;
    max-width: 260px;
    padding: 6px 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: var(--transition);
    z-index: 1200;
}

.category-sidebar-row:hover .category-submenu-panel,
.category-menu-row:hover .category-submenu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.category-submenu-panel a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    white-space: nowrap;
    text-decoration: none;
}

.category-submenu-panel a:hover,
.category-submenu-panel a.active {
    background: rgba(232,121,43,0.1);
    color: var(--accent-color);
}

.main-area {
    flex: 1;
    min-width: 0;
}

/* ========================================
   统计卡片
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-icon.blue { background: rgba(52,152,219,0.1); color: var(--info-color); }
.stat-icon.orange { background: rgba(232,121,43,0.1); color: var(--accent-color); }
.stat-icon.green { background: rgba(39,174,96,0.1); color: var(--success-color); }
.stat-icon.red { background: rgba(231,76,60,0.1); color: var(--danger-color); }

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.857rem;
}

/* ========================================
   筛选区域
   ======================================== */
.filter-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.mobile-subcategory-row,
.mobile-brand-filter-section {
    display: none;
}

.filter-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.filter-label {
    width: 100px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-option {
    padding: 6px 15px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.filter-option:hover,
.filter-option.active {
    background: var(--primary-color);
    color: #fff;
}

.filter-option.disabled {
    cursor: default;
    opacity: 0.55;
}

.filter-option.disabled:hover {
    background: var(--bg-color);
    color: inherit;
}

/* ========================================
   排序栏
   ======================================== */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.sort-info {
    color: var(--text-secondary);
}

.sort-options {
    display: flex;
    gap: 20px;
}

.sort-option {
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.sort-option:hover,
.sort-option.active {
    color: var(--accent-color);
}

/* ========================================
   商品列表布局
   ======================================== */
.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ========================================
   商品详情
   ======================================== */
.product-detail {
    display: flex;
    gap: 40px;
}

.product-gallery {
    width: 450px;
    flex-shrink: 0;
}

.product-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e8e9ed 0%, #d0d3d8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--text-light);
    margin-bottom: 15px;
    overflow: hidden;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-thumb {
    width: 80px;
    height: 80px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    overflow: hidden;
    padding: 0;
}

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

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.55);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

.product-detail-info {
    flex: 1;
}

.product-detail-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.product-detail-price {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 20px;
}

.product-detail-meta {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.product-detail-meta dt {
    color: var(--text-secondary);
}

.spec-options {
    margin-bottom: 20px;
}

.spec-option {
    margin-bottom: 15px;
}

.spec-option-label {
    font-weight: 500;
    margin-bottom: 10px;
}

.spec-option-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spec-value {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.spec-value:hover,
.spec-value.active {
    border-color: var(--accent-color);
    background: rgba(232,121,43,0.1);
    color: var(--accent-color);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.quantity-input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.action-buttons {
    display: flex;
    gap: 15px;
}

/* ========================================
   购物车
   ======================================== */
.cart-items {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.cart-store {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-store-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.cart-store-name {
    font-weight: 600;
    color: var(--primary-color);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-item-checkbox {
    margin-right: 15px;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 20px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-spec {
    font-size: 0.857rem;
    color: var(--text-secondary);
}

.cart-item-price {
    width: 120px;
    text-align: center;
    color: var(--accent-color);
    font-weight: 600;
}

.cart-item-quantity {
    width: 120px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.cart-item-quantity input {
    width: 50px;
    text-align: center;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.cart-item-subtotal {
    width: 120px;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-item-actions {
    width: 80px;
    text-align: center;
}

.cart-summary {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    font-size: 1.2rem;
}

.cart-total strong {
    color: var(--accent-color);
    font-size: 1.5rem;
}

/* ========================================
   步骤条
   ======================================== */
.steps {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.step {
    display: flex;
    align-items: center;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step.active .step-number {
    background: var(--accent-color);
    color: #fff;
}

.step.completed .step-number {
    background: var(--success-color);
    color: #fff;
}

.step-label {
    margin-left: 10px;
    color: var(--text-secondary);
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.step-line {
    width: 100px;
    height: 2px;
    background: var(--border-color);
    margin: 0 20px;
}

.step.completed + .step .step-line,
.step.completed .step-line {
    background: var(--success-color);
}

/* ========================================
   地址卡片
   ======================================== */
.address-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.address-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

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

.address-card.selected {
    border-color: var(--accent-color);
    background: rgba(232,121,43,0.05);
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.address-card-name {
    font-weight: 600;
}

.address-card-default {
    background: var(--accent-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.714rem;
}

.address-card-phone {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.address-card-detail {
    color: var(--text-primary);
}

.address-card-actions {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

/* ========================================
   登录注册页
   ======================================== */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
}

.auth-container {
    width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    background: var(--primary-color);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.auth-header p {
    opacity: 0.8;
    font-size: 0.857rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.auth-body {
    padding: 30px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-divider {
    text-align: center;
    margin: 25px 0;
    color: var(--text-light);
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 100px;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

/* ========================================
   用户中心
   ======================================== */
.user-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    padding: 30px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.user-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.user-info p {
    opacity: 0.8;
}

.user-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.user-stat {
    text-align: center;
    cursor: pointer;
}

.user-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.user-stat-label {
    font-size: 0.857rem;
    opacity: 0.8;
}

.account-user-header,
.account-order-shortcuts {
    display: none;
}

/* ========================================
   供应商/管理员专用头部
   ======================================== */
.admin-header {
    background: var(--primary-color);
    color: #fff;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.admin-logo {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-logo::before {
    content: "";
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    border-radius: var(--radius-sm);
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-header-right a {
    color: #fff;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   供应商/管理员布局
   ======================================== */
.admin-layout {
    min-height: 100vh;
    background: var(--bg-color);
}

.admin-container {
    display: flex;
}

.admin-sidebar {
    width: 220px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.admin-menu {
    padding: 20px 0;
}

.admin-menu-title {
    padding: 10px 20px;
    font-size: 0.857rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

.admin-menu-item:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.admin-menu-item.active {
    background: rgba(232,121,43,0.1);
    color: var(--accent-color);
    border-left: 3px solid var(--accent-color);
}

.admin-menu-item::before {
    font-size: 1.1rem;
}

.admin-main {
    flex: 1;
    padding: 25px;
    min-width: 0;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.admin-page-title {
    font-size: 1.3rem;
    font-weight: 600;
}

/* ========================================
   简单图表
   ======================================== */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.chart-title {
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px 0;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 40px;
    background: linear-gradient(180deg, var(--accent-color), var(--primary-color));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition);
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    font-size: 0.786rem;
    color: var(--text-secondary);
}

.bar-value {
    font-size: 0.786rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 饼图 */
.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0deg 126deg,
        var(--accent-color) 126deg 198deg,
        var(--success-color) 198deg 270deg,
        var(--warning-color) 270deg 324deg,
        var(--info-color) 324deg 360deg
    );
    position: relative;
}

.pie-chart::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--card-bg);
    border-radius: 50%;
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.857rem;
}

.pie-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .header-main .container {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .search-box {
        grid-column: auto;
        grid-row: auto;
        max-width: none;
    }

    .header-actions,
    .platform-counts {
        grid-column: auto;
        grid-row: auto;
        align-self: auto;
        justify-self: start;
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-detail {
        flex-direction: column;
    }
    
    .product-gallery {
        width: 100%;
    }
    
    .admin-sidebar {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .header-main .container {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 15px;
    }
    
    .nav-links {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .address-list {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .layout-with-sidebar {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .banner-slider {
        height: 250px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .cart-summary {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ========================================
   辅助工具类
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.bg-primary { background: var(--primary-color); color: #fff; }
.bg-accent { background: var(--accent-color); color: #fff; }
.bg-success { background: var(--success-color); color: #fff; }
.bg-danger { background: var(--danger-color); color: #fff; }
.bg-warning { background: var(--warning-color); color: #fff; }
.bg-light { background: var(--bg-color); }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.pt-20 { padding-top: 20px; }
.pt-30 { padding-top: 30px; }
.pb-20 { padding-bottom: 20px; }
.pb-30 { padding-bottom: 30px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.hidden { display: none; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.857rem; }
.text-xs { font-size: 0.786rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.2rem; }
.text-2xl { font-size: 1.5rem; }

.border { border: 1px solid var(--border-color); }
.border-radius { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.shadow { box-shadow: var(--shadow-md); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 商品评价区样式（拼多多风格） ========== */
.product-reviews { padding: 15px 0; }
.reviews-overview { display: flex; gap: 30px; padding: 20px; background: #fff5f5; border-radius: 8px; margin-bottom: 20px; }
.overview-left { text-align: center; min-width: 100px; }
.overview-score { font-size: 2.5rem; color: #ff5000; font-weight: bold; }
.overview-score span { font-size: 1.2rem; }
.overview-label { color: #999; font-size: 0.85rem; margin-top: 5px; }
.overview-right { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.bar-label { width: 30px; color: #666; }
.bar-track { flex: 1; height: 12px; background: #f0f0f0; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #ff5000, #ff8a00); border-radius: 6px; }
.bar-count { width: 30px; color: #999; text-align: right; }
.reviews-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.filter-btn { padding: 6px 15px; border: 1px solid #ddd; border-radius: 20px; background: #fff; color: #666; font-size: 0.85rem; cursor: pointer; }
.filter-btn:hover { border-color: #ff5000; color: #ff5000; }
.filter-btn.active { background: #ff5000; border-color: #ff5000; color: #fff; }
.reviews-list { display: flex; flex-direction: column; gap: 20px; }
.review-item { padding: 15px; background: #fff; border-radius: 8px; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.user-name { font-weight: 500; }
.review-stars { color: #ff5000; font-size: 0.9rem; letter-spacing: 2px; }
.review-content { color: #333; line-height: 1.6; margin-bottom: 10px; }
.review-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.review-tag { padding: 3px 10px; background: #fff0eb; color: #ff5000; border-radius: 4px; font-size: 0.8rem; }
.review-images { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.review-img-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.review-img-thumb:hover { transform: scale(1.05); }
.review-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #999; }
.review-like-btn { padding: 4px 12px; border: 1px solid #ddd; border-radius: 15px; background: #fff; color: #666; cursor: pointer; font-size: 0.8rem; }
.review-like-btn:hover { background: #f5f5f5; }
.merchant-reply { margin-top: 10px; padding: 10px; background: #f8f8f8; border-radius: 6px; font-size: 0.85rem; color: #666; }
.empty-reviews { text-align: center; padding: 40px; color: #999; }
.review-images-upload { display: flex; gap: 10px; flex-wrap: wrap; }
.review-img-item { position: relative; width: 80px; height: 80px; }
.review-img-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.review-img-item .remove-btn { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; background: #ff5000; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.upload-btn { width: 80px; height: 80px; border: 2px dashed #ddd; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: #999; }
.upload-btn:hover { border-color: #ff5000; color: #ff5000; }
.star-rating { display: flex; gap: 5px; }
.star-rating .star { color: #ddd; }
.star-rating .star.selected, .star-rating .star:hover { color: #ff5000; }
.reviews-more { text-align: center; padding: 20px 0; }
.write-review-entry { text-align: center; padding: 20px 0; }

