/* ============================================
   校服商城(XFSC) - 全局样式
   @version 2.1.0
   ============================================ */

:root {
    --primary: #0056b3;
    --primary-light: #007bff;
    --primary-dark: #003d82;
    --accent: #ff9800;
    --accent-light: #ffb74d;
    --success: #4CAF50;
    --danger: #f44336;
    --bg: #f0f2f5;
    --white: #ffffff;
    --dark: #333333;
    --gray: #666666;
    --light-gray: #e0e0e0;
    --border: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.25s ease;
}

/* 性能优化：使用GPU加速 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-width: 320px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 屏幕阅读器专用样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 模态框尺寸变体 */
.modal-small {
    max-width: 400px;
}

.modal-medium {
    max-width: 500px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 顶部通知栏 ---------- */
.top-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    color: var(--white);
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.top-bar a {
    color: #ffe082;
    text-decoration: underline;
    margin-left: 8px;
    font-weight: 500;
}
.top-bar a:hover { color: var(--white); }

/* ---------- 头部导航 ---------- */
header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: auto;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,86,179,0.15);
    transition: var(--transition);
    background: white;
    padding: 4px;
}

.logo:hover .logo-img {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,86,179,0.25);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.logo-main {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    background: linear-gradient(135deg, #003d82, #0056b3, #007bff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 11px;
    font-weight: 600;
    color: #0056b3;
    letter-spacing: 3px;
    margin-top: 2px;
    text-transform: uppercase;
}

/* 搜索框 */
.search-box {
    display: flex;
    flex: 1;
    max-width: 460px;
    border: 2px solid var(--primary);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}
.search-box input {
    flex: 1;
    border: none;
    padding: 10px 18px;
    outline: none;
    font-size: 14px;
    background: transparent;
}
.search-box button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 28px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.search-box button:hover { background: var(--primary-dark); }

/* 导航操作 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}
.nav-actions .nav-link {
    color: var(--gray);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}
.nav-actions .nav-link:hover {
    background: var(--bg);
    color: var(--primary);
}
.nav-actions .cart-link {
    position: relative;
    font-size: 20px;
    padding: 6px 10px;
}
.nav-actions .cart-count {
    position: absolute;
    top: 0; right: 2px;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.btn-login {
    background: var(--primary) !important;
    color: var(--white) !important;
    border-radius: 20px !important;
    padding: 8px 22px !important;
    font-weight: 500 !important;
}
.btn-login:hover {
    background: var(--primary-dark) !important;
    color: var(--white) !important;
}
.btn-register {
    background: var(--accent) !important;
    color: var(--white) !important;
    border-radius: 20px !important;
    padding: 8px 22px !important;
    font-weight: 500 !important;
}
.btn-register:hover {
    background: #e68900 !important;
    color: var(--white) !important;
}

/* ---------- 分类导航条 ---------- */
.category-nav {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 0;
}
.category-list {
    display: flex;
    gap: 4px;
    padding: 0;
    overflow-x: auto;
}
.category-list li { flex-shrink: 0; }
.category-list a {
    display: block;
    padding: 12px 20px;
    color: var(--gray);
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.category-list a:hover {
    color: var(--primary);
    background: rgba(0,86,179,0.04);
}
.category-list a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ---------- Hero Banner ---------- */
.hero {
    background: linear-gradient(135deg, #003d82 0%, #0056b3 40%, #007bff 100%);
    color: var(--white);
    padding: 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -5%;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}
.hero .container {
    position: relative;
    z-index: 1;
}
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 360px;
    gap: 40px;
}
.hero-text { flex: 1; }
.hero-text h1 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}
.hero-text p {
    font-size: 17px;
    opacity: 0.85;
    margin-bottom: 28px;
    line-height: 1.7;
}
.hero-text .hero-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
}
.hero-text .hero-stats .stat-item {
    text-align: center;
}
.hero-text .hero-stats .stat-num {
    font-size: 28px;
    font-weight: 700;
    display: block;
}
.hero-text .hero-stats .stat-label {
    font-size: 12px;
    opacity: 0.75;
}
.btn-hero {
    display: inline-block;
    background: var(--white);
    color: var(--primary);
    padding: 12px 36px;
    border-radius: 28px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-image-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-image-card .hero-img-icon {
    font-size: 72px;
    display: block;
    margin-bottom: 8px;
}
.hero-image-card span {
    font-size: 14px;
    opacity: 0.8;
}

/* ---------- 搜索筛选区 ---------- */
.search-filter-section {
    background: var(--white);
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin: -30px auto 30px;
    position: relative;
    z-index: 10;
}
.search-filter-section h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 18px;
}
.filter-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-select {
    flex: 1;
    min-width: 180px;
}
.filter-select label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 6px;
    font-weight: 500;
}
.filter-select select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-size: 14px;
    color: var(--dark);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: var(--transition);
}
.filter-select select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,86,179,0.08);
}
.btn-search-filter {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 11px 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-search-filter:hover { background: #e68900; }

/* ---------- 快速分类卡片 ---------- */
.quick-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 30px 0;
}
.category-card {
    background: var(--white);
    padding: 22px 16px;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.category-card .cat-icon {
    width: 48px; height: 48px;
    background: rgba(0,86,179,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.category-card .cat-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

/* ---------- 主内容区：侧边栏 + 商品 ---------- */
.main-content {
    display: flex;
    gap: 24px;
    margin: 40px 0;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 140px;
}
.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 20px 12px;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.sidebar ul { padding: 0; }
.sidebar li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: var(--gray);
    font-size: 14px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.sidebar li a:hover {
    background: rgba(0,86,179,0.04);
    color: var(--primary);
}
.sidebar li a.active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(0,86,179,0.06);
    border-left-color: var(--primary);
}
.sidebar .hot-tag {
    display: inline-block;
    background: #ffe0e0;
    color: var(--danger);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

/* 商品区域 */
.products-main {
    flex: 1;
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header h2 {
    font-size: 20px;
    color: var(--dark);
    position: relative;
    padding-left: 14px;
}
.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.filter-tabs {
    display: flex;
    gap: 6px;
}
.filter-tabs button {
    padding: 7px 18px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray);
    transition: var(--transition);
}
.filter-tabs button:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-tabs button.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

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

/* 商品卡片 */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.product-img {
    height: 190px;
    background: linear-gradient(135deg, #e8edf2 0%, #f5f7fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.product-img .img-placeholder {
    font-size: 48px;
    color: #c0c8d0;
}
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.product-tag-new {
    background: var(--success);
}
.product-info {
    padding: 16px;
}
.product-title {
    font-size: 14px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    color: var(--dark);
}
.product-price {
    color: var(--danger);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.product-price .price-symbol {
    font-size: 14px;
    font-weight: 500;
}
.product-price .old-price {
    color: #bbb;
    text-decoration: line-through;
    font-size: 12px;
    font-weight: 400;
}
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}
.product-rating {
    color: var(--accent);
}
.product-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: absolute;
    bottom: 16px;
    right: 16px;
}
.product-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* ---------- 步骤引导 + 优势区域 ---------- */
.info-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}
.info-section h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 28px;
    font-size: 20px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.info-card {
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius);
    background: var(--bg);
    transition: var(--transition);
}
.info-card:hover {
    background: linear-gradient(135deg, rgba(0,86,179,0.04), rgba(0,123,255,0.06));
    transform: translateY(-2px);
}
.info-card .info-icon {
    font-size: 36px;
    margin-bottom: 12px;
}
.info-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark);
}
.info-card p {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.6;
}

/* ---------- 用户评价 ---------- */
.testimonials {
    background: var(--white);
    padding: 50px 0;
    margin: 30px 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.testimonials .container h2 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--primary);
    font-size: 20px;
}
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 0 20px;
}
.testimonial-card {
    background: var(--bg);
    padding: 28px;
    border-radius: var(--radius);
    transition: var(--transition);
    border: 1px solid transparent;
}
.testimonial-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border);
}
.testimonial-card .quote-icon {
    font-size: 32px;
    color: var(--primary-light);
    opacity: 0.3;
    margin-bottom: 8px;
}
.testimonial-card p {
    font-size: 14px;
    color: var(--dark);
    line-height: 1.8;
    margin-bottom: 16px;
}
.testimonial-card .author {
    font-weight: 600;
    color: var(--dark);
}
.testimonial-card .role {
    font-size: 12px;
    color: var(--gray);
}

/* ---------- 底部 ---------- */
footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 50px 0 0;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-brand h3 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 12px;
}
.footer-brand p {
    font-size: 13px;
    line-height: 1.8;
    color: #999;
}
.footer-col h3 {
    color: var(--white);
    font-size: 15px;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}
.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: var(--primary-light);
    border-radius: 1px;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: #999;
    font-size: 13px;
    transition: var(--transition);
}
.footer-col a:hover { color: var(--white); }
.footer-col .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
}
.newsletter-form {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}
.newsletter-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #222;
    color: var(--white);
    font-size: 13px;
    outline: none;
}
.newsletter-form input:focus { border-color: var(--primary-light); }
.newsletter-form button {
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    transition: var(--transition);
}
.newsletter-form button:hover { background: var(--primary-dark); }
.copyright {
    text-align: center;
    padding: 18px 0;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #777;
}
.copyright a { color: #999; }
.copyright a:hover { color: var(--white); }

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ---------- 商家入驻/商品管理按钮 ---------- */
.btn-merchant {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: var(--white) !important;
    border-radius: 20px !important;
    padding: 8px 18px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    transition: var(--transition);
}
.btn-merchant:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249,115,22,0.35);
}
.btn-manage {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: var(--white) !important;
    border-radius: 20px !important;
    padding: 8px 18px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    transition: var(--transition);
}
.btn-manage:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}

/* ---------- 模态弹窗 ---------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-container {
    transform: translateY(0);
}
.modal-wide {
    width: 720px;
}
.modal-xlarge {
    width: 920px;
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 18px;
    color: var(--dark);
}
.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.modal-close:hover {
    background: var(--danger);
    color: var(--white);
}

/* 弹窗内容 */
.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

/* ---------- 入驻步骤条 ---------- */
.form-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 20px;
}
.form-steps .step {
    font-size: 13px;
    color: #bbb;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}
.form-steps .step.active {
    color: var(--primary);
    font-weight: 600;
}
.form-steps .step-line {
    width: 60px;
    height: 2px;
    background: var(--light-gray);
    margin: 0 12px;
}

/* ---------- 表单通用 ---------- */
.merchant-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.merchant-form .form-group {
    flex: 1;
}
.merchant-form .form-group.full-width {
    flex: 1 1 100%;
}

.form-section-title {
    flex: 1 1 100%;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    padding: 12px 0;
    margin-top: 8px;
    border-bottom: 2px solid var(--border);
}
.merchant-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}
.merchant-form .required {
    color: var(--danger);
}
.merchant-form input[type="text"],
.merchant-form input[type="tel"],
.merchant-form input[type="email"],
.merchant-form input[type="number"],
.merchant-form select,
.merchant-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--dark);
    transition: var(--transition);
    font-family: inherit;
    background: var(--white);
}
.merchant-form input:focus,
.merchant-form select:focus,
.merchant-form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,86,179,0.07);
}
.merchant-form textarea {
    resize: vertical;
    min-height: 60px;
}
.merchant-form select:disabled {
    background: #f5f5f5;
    color: #bbb;
    cursor: not-allowed;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--light-gray);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(0,86,179,0.03);
}
.upload-area .upload-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}
.upload-area p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 6px;
}
.upload-area .upload-hint {
    font-size: 12px;
    color: #bbb;
}

/* 协议勾选 */
.agree-row {
    padding: 12px 0;
}
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    color: var(--gray) !important;
    cursor: pointer;
}
.checkbox-label a {
    color: var(--primary);
    text-decoration: underline;
}
.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* 表单操作栏 */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.btn-cancel {
    padding: 10px 28px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}
.btn-cancel:hover {
    background: var(--bg);
    color: var(--dark);
}
.btn-submit {
    padding: 10px 36px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-submit:hover {
    background: var(--primary-dark);
}

/* ---------- 管理统计栏 ---------- */
.manage-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.manage-stat-item {
    text-align: center;
}
.manage-stat-item .m-stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}
.manage-stat-item .m-stat-label {
    font-size: 12px;
    color: var(--gray);
}
.btn-add-product {
    margin-left: auto;
    padding: 10px 22px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-add-product:hover {
    background: #43a047;
}

/* ---------- 管理表格 ---------- */
.manage-table-wrap {
    overflow-x: auto;
}
.manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.manage-table thead {
    background: #f8f9fb;
}
.manage-table th {
    padding: 12px 12px;
    text-align: left;
    color: var(--gray);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.manage-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
    vertical-align: middle;
}
.manage-table tbody tr {
    transition: var(--transition);
}
.manage-table tbody tr:hover {
    background: rgba(0,86,179,0.03);
}
.manage-table .td-title {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.manage-table .td-price {
    color: var(--danger);
    font-weight: 600;
}
.manage-table .td-discount {
    color: var(--accent);
    font-weight: 500;
}
.manage-table .td-actions {
    display: flex;
    gap: 6px;
}

/* 库存状态样式 */
.low-stock {
    color: #f44336;
    font-weight: 600;
    background: rgba(244,67,54,0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.medium-stock {
    color: #ff9800;
    font-weight: 600;
}

#lowStockStat.warning .m-stat-num {
    color: #f44336;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.btn-edit, .btn-del {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-edit {
    background: #e3f2fd;
    color: var(--primary);
}
.btn-edit:hover {
    background: var(--primary);
    color: var(--white);
}
.btn-del {
    background: #fce4ec;
    color: var(--danger);
}
.btn-del:hover {
    background: var(--danger);
    color: var(--white);
}

/* ---------- Toast 样式 ---------- */
#toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

#toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

#toast.warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

/* 表单错误样式 */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #f44336 !important;
    background: rgba(244,67,54,0.05);
}

.form-group input:focus:not(.error),
.form-group select:focus:not(.error),
.form-group textarea:focus:not(.error) {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}

/* 入驻成功弹窗 */
.success-modal .success-icon {
    font-size: 56px;
    display: block;
    text-align: center;
    margin-bottom: 12px;
}
.success-modal .success-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
}
.success-modal .success-msg {
    text-align: center;
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 24px;
}
.success-modal .btn-submit {
    display: block;
    margin: 0 auto;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .quick-categories { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .main-content { flex-direction: column; }
    .sidebar {
        width: 100%;
        position: static;
    }
    .sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 12px;
    }
    .sidebar li a {
        padding: 8px 14px;
        border-left: none;
        border-radius: 20px;
        font-size: 13px;
        border: 1px solid var(--border);
    }
    .sidebar li a.active {
        border: 1px solid var(--primary);
    }
}

@media (max-width: 768px) {
    .nav-main {
        flex-direction: column;
        gap: 12px;
    }
    .search-box { max-width: 100%; }
    .hero-content {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 40px 0;
    }
    .hero-text h1 { font-size: 26px; }
    .hero-text .hero-stats { justify-content: center; }
    .hero-image-card { margin-top: 20px; }
    .category-list a { padding: 10px 14px; font-size: 13px; }
    .quick-categories { grid-template-columns: repeat(2, 1fr); }
    .search-filter-section {
        margin: 0 0 20px;
        padding: 20px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .footer-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-actions { gap: 6px; flex-wrap: wrap; }
    .nav-actions .nav-link { padding: 6px 10px; font-size: 13px; }
    .btn-merchant, .btn-manage { padding: 6px 14px !important; font-size: 12px !important; }
    .modal-wide, .modal-xlarge { width: 95vw; margin: 0 10px; }
    .merchant-form .form-row { flex-direction: column; gap: 12px; }
    .manage-stats { flex-direction: column; align-items: flex-start; gap: 12px; }
    .btn-add-product { margin-left: 0; align-self: stretch; }
    .manage-table { font-size: 12px; }
    .manage-table th, .manage-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .quick-categories { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-grid { grid-template-columns: 1fr; }
    .product-img { height: 150px; }
    .product-info { padding: 10px; }
    .product-title { font-size: 12px; height: 34px; }
    .product-price { font-size: 16px; }
}

/* ========== 商家功能入口 ========== */
.merchant-entry-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 40px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #333;
}

/* 标签页样式 */
.manage-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0,86,179,0.05);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 结算管理样式 */
.settlement-info-card,
.settlement-stats,
.settlement-history {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.settlement-info-card h3,
.settlement-stats h3,
.settlement-history h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--dark);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 4px;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.btn-edit-settlement {
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit-settlement:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fb, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

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

.stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-value.pending {
    color: #ff9800;
}

.stat-value.settled {
    color: #4CAF50;
}

.stat-value.date {
    color: #2196F3;
    font-size: 18px;
}

.stat-value.count {
    color: #9C27B0;
}

.settlement-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

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

.settlement-table th {
    background: #f8f9fb;
    font-weight: 600;
    color: var(--dark);
}

.settlement-table tbody tr:hover {
    background: #f5f7fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff3e0;
    color: #ff9800;
}

.status-settled {
    background: #e8f5e9;
    color: #4CAF50;
}

.status-processing {
    background: #e3f2fd;
    color: #2196F3;
}

.merchant-entry-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid #444;
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.merchant-entry-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0,86,179,0.2);
}

.entry-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.merchant-entry-card h3 {
    font-size: 20px;
    color: var(--white);
    margin-bottom: 8px;
}

.merchant-entry-card p {
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-merchant-footer,
.btn-manage-footer {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.btn-merchant-footer {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.btn-merchant-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249,115,22,0.4);
}

.btn-manage-footer {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.btn-manage-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

@media (max-width: 768px) {
    .merchant-entry-section {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 0;
    }
    
    .merchant-entry-card {
        padding: 24px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .manage-tabs {
        overflow-x: auto;
    }
    
    .tab-btn {
        white-space: nowrap;
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* ========== 登录注册样式 ========== */

/* 快捷登录区域 */
.quick-login-section {
    margin-bottom: 24px;
}

.quick-login-section h4 {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 12px;
    text-align: center;
}

.social-login-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.social-login-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.social-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.social-login-btn.wechat:hover {
    border-color: #07C160;
    background: rgba(7,193,96,0.05);
}

.social-login-btn.phone:hover {
    border-color: #0056b3;
    background: rgba(0,86,179,0.05);
}

.social-login-btn.douyin:hover {
    border-color: #000000;
    background: rgba(0,0,0,0.05);
}

.social-login-btn.kuaishou:hover {
    border-color: #FF4D00;
    background: rgba(255,77,0,0.05);
}

.social-icon {
    font-size: 32px;
}

.social-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

/* 分割线 */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--gray);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
}

/* 认证表单 */
.auth-form {
    margin-top: 20px;
}

.password-input-wrapper,
.phone-input-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
}

.password-input-wrapper input,
.phone-input-wrapper input {
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: var(--transition);
}

.toggle-password:hover {
    opacity: 1;
}

.btn-send-code {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-send-code:hover {
    background: var(--primary-dark);
}

.btn-send-code:disabled {
    background: var(--light-gray);
    cursor: not-allowed;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.forgot-link {
    color: var(--primary);
    text-decoration: underline;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--gray);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    margin-left: 8px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .social-login-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-medium {
        max-width: 90%;
        margin: 20px auto;
    }
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* ========== 打印样式 ========== */
@media print {
    /* 隐藏不必要的元素 */
    .top-bar,
    header,
    .category-nav,
    footer,
    .modal-overlay,
    .btn-login,
    .btn-register,
    .cart-link,
    #toast {
        display: none !important;
    }
    
    /* 优化打印布局 */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    /* 确保链接可识别 */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* 避免分页断裂 */
    .product-card,
    .info-card,
    .testimonial-card {
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}
