@font-face {
    font-family: 'iconfont';
    src: url('../fonts/iconfont.woff2?t=1631608872177') format('woff2'),
    url('../fonts/iconfont.woff?t=1631608872177') format('woff'),
    url('../fonts/iconfont.ttf?t=1631608872177') format('truetype');
    font-display: swap; /* 优化字体加载，避免阻塞渲染 */
}

/* CSS 变量系统 - 与 index.css 保持一致 */
:root {
    --primary-color: #0071e3;
    --primary-hover: #0077ed;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --background: #ffffff;
    --background-light: #f5f5f7;
    --background-header-top: #f1f1f1;
    --border-color: rgba(0, 0, 0, 0.06);
    --border-color-light: #e5e5e7;
    --border-color-medium: #dadada;
    --border-color-hover: #d2d2d7;
    --border-color-hover-alt: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.16);
    --shadow-inset: 0 -1px 3px rgba(0, 0, 0, 0.03) inset;
    --shadow-search: 0 12px 24px -18px rgba(0, 0, 0, 0.5);
    --shadow-primary-active: 0 4px 16px rgba(0, 113, 227, 0.2);
    --shadow-primary-focus: 0 0 0 4px rgba(0, 113, 227, 0.08);
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --overlay-bg-light: rgba(0, 0, 0, 0.04);
    --overlay-bg-medium: rgba(0, 0, 0, 0.06);
    --overlay-bg-hover: rgba(0, 0, 0, 0.08);
    --overlay-bg-active: rgba(0, 113, 227, 0.08);
    --overlay-bg-hover-alt: rgba(0, 113, 227, 0.1);
    --text-inverse: #ffffff;
    --error-color: #e84c3d;
}

/* 提高选择器特异性，避免使用 !important */
body .ali-icon,
.ali-icon {
    font-family: "iconfont", sans-serif;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 保留 float 工具类以兼容旧代码，但建议使用 Flexbox */
.fl {
    float: left;
}
.fr {
    float: right;
}

/* 页面装载 */
.page-wrapper {
    background-color: var(--background);
}

.header-top {
    background-color: var(--background-header-top);
    border-bottom: 1px solid var(--border-color-medium);
    box-shadow: var(--shadow-inset);
    font-size: 0.875rem; /* 14px */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
}

.header-top-right-btns {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-top-right-btns .btn-group {
    display: flex;
    margin: 0;
}

.header-top-right-btns .btn-group>button {
    padding: 0.5rem 0.625rem; /* 8px 10px */
    margin: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem; /* 14px */
    border-right: 1px solid var(--border-color-light);
    border-left: 1px solid transparent;
    background: transparent;
    border-top: none;
    border-bottom: none;
    transition: all 0.2s ease;
}

.btn-group>button:hover {
    color: var(--error-color);
    background-color: var(--background-light);
    border-right-color: var(--border-color-light);
}

.header-top-right-btns .btn-group:last-child>button {
    border-right-color: transparent;
}

.header {
    padding: 1.25rem 0; /* 20px */
    border-bottom: 1px solid var(--border-color-light);
    background: var(--background);
}

/* 导航栏容器：使用 Flexbox 实现三栏布局 */
.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

/* Logo 区域（左侧） */
.navbar-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* 导航菜单（居中，向两边伸展） */
.navbar-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    gap: 2rem;
    margin: 0;
    padding: 0 2rem;
    list-style: none;
}

.navbar-menu .nav-item {
    margin: 0;
}

.navbar-menu .nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.navbar-menu .nav-link:hover,
.navbar-menu .nav-link.active {
    color: var(--primary-color);
}

/* 操作按钮组（右侧） */
.nav-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    flex: 0 0 auto;
    margin-left: 1rem;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.nav-icon-btn i {
    font-size: 1.3rem;
    line-height: 1;
}

.nav-icon-btn:hover,
.nav-icon-btn:focus {
    background-color: var(--overlay-bg-hover);
    color: var(--text-primary);
    outline: none;
}

.nav-search-form {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.25s ease, opacity 0.25s ease;
}

.nav-action-group.is-open .nav-search-form {
    width: 14rem;
    opacity: 1;
}

.nav-action-group.is-open #searchToggle {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.nav-search-pill {
    display: flex;
    align-items: center;
    background-color: var(--background-light);
    border-radius: 999px;
    padding: 0 0.5rem;
    border: 1px solid transparent;
    height: 2.5rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-action-group.is-open .nav-search-pill {
    border-color: var(--border-color-hover);
    background-color: var(--background);
    box-shadow: var(--shadow-search);
}

.nav-search-input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    padding: 0 0.5rem;
    min-width: 0;
    outline: none;
    color: var(--text-primary);
}

.nav-search-submit {
    color: var(--text-primary);
}

.nav-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* 移动端菜单按钮 */
.navbar-toggler {
    display: none;
    border: 0;
    padding: 0;
    background: transparent;
    width: 2.5rem;
    height: 2.5rem;
    position: relative;
    z-index: 1001;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler:hover {
    color: var(--primary-color);
}

.navbar-toggler i {
    transition: transform 0.3s ease;
}

.navbar-toggler[aria-expanded="true"] i {
    transform: rotate(90deg);
}

/* 抽屉打开时隐藏菜单按钮 */
body.drawer-open .navbar-toggler,
.mobile-drawer.active ~ * .navbar-toggler {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 移动端购物袋按钮 */
.mobile-cart-btn {
    order: 3;
    margin-left: auto;
}

/* 移动端抽屉式侧边栏 */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 20rem;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top-right-radius: var(--radius-xl);
    border-bottom-right-radius: 0;
}

.mobile-drawer.active {
    transform: translateX(0);
}

.mobile-drawer-header {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: none;
    flex-shrink: 0;
    background: transparent;
    position: relative;
}

.mobile-drawer-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.06) 20%,
        rgba(0, 0, 0, 0.06) 80%,
        transparent 100%
    );
}

.mobile-drawer-header-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-direction: column;
}

.mobile-drawer-header-top {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.mobile-drawer-search {
    flex: 1;
    min-width: 0;
}

.mobile-drawer-close {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:focus {
    background-color: var(--overlay-bg-medium);
    color: var(--text-primary);
    transform: rotate(90deg);
    outline: none;
}

.mobile-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
    -webkit-overflow-scrolling: touch;
}

.mobile-drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-drawer-item {
    margin: 0;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0.25rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.0625rem;
    font-weight: 400;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-md);
    position: relative;
    letter-spacing: 0.01em;
    border-bottom: none;
}

.mobile-drawer-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    width: 3px;
    height: 0;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer-link:hover,
.mobile-drawer-link:focus {
    background-color: var(--overlay-bg-light);
    color: var(--text-primary);
    text-decoration: none;
    transform: translateX(4px);
}

.mobile-drawer-link:hover::before,
.mobile-drawer-link:focus::before {
    transform: translateY(-50%) scaleX(1);
    height: 1.5rem;
}

.mobile-drawer-link.active {
    color: var(--primary-color);
    font-weight: 500;
    background-color: var(--overlay-bg-active);
    transform: translateX(4px);
}

.mobile-drawer-link.active::before {
    transform: translateY(-50%) scaleX(1);
    height: 1.5rem;
}

.mobile-drawer-footer {
    border-top: none;
    padding: 1.5rem 1.25rem 1.5rem;
    flex-shrink: 0;
    background: transparent;
    margin-top: auto;
    position: relative;
}

.mobile-drawer-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 0, 0, 0.06) 20%,
        rgba(0, 0, 0, 0.06) 80%,
        transparent 100%
    );
}

.mobile-drawer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.mobile-social-link {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--overlay-bg-light);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.125rem;
}

.mobile-social-link:hover,
.mobile-social-link:focus {
    background-color: var(--overlay-bg-hover-alt);
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-primary-active);
    text-decoration: none;
}

.mobile-social-link:active {
    transform: translateY(0);
}

/* 社交媒体图标特定颜色 */
.mobile-social-link[aria-label="Facebook"]:hover {
    background-color: #1877f2;
    color: var(--text-inverse);
}

.mobile-social-link[aria-label="Twitter"]:hover,
.mobile-social-link[aria-label="X"]:hover {
    background-color: #000;
    color: var(--text-inverse);
}

.mobile-social-link[aria-label="Instagram"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: var(--text-inverse);
}

.mobile-social-link[aria-label="YouTube"]:hover {
    background-color: #ff0000;
    color: var(--text-inverse);
}


.mobile-drawer-copyright {
    text-align: center;
    padding-top: 0;
    border-top: none;
}

.mobile-drawer-copyright p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.mobile-drawer-search {
    width: 100%;
}

.mobile-search-form {
    width: 100%;
}

.mobile-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--overlay-bg-light);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.mobile-search-input-wrapper:focus-within {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: var(--border-color-hover-alt);
    box-shadow: var(--shadow-primary-focus);
}

.mobile-search-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.mobile-search-input-wrapper:focus-within .mobile-search-icon {
    color: var(--text-secondary);
}

.mobile-search-input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-primary);
    padding: 0;
    outline: none;
    min-width: 0;
}

.mobile-search-input::placeholder {
    color: var(--text-secondary);
}

.mobile-search-clear {
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    background: var(--overlay-bg-hover);
    color: var(--text-primary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 0.5rem;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-clear:hover {
    background: var(--overlay-bg-medium);
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .navbar-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .navbar-toggler {
        display: flex;
        order: 1;
        margin-right: 0.5rem;
    }

    /* 提高选择器特异性，避免使用 !important */
    body .navbar-logo,
    .navbar-logo {
        display: none;
    }

    /* 隐藏桌面端导航菜单 */
    body .navbar-collapse,
    .navbar-collapse {
        display: none;
    }
}

/* 桌面端隐藏抽屉 */
@media (min-width: 992px) {
    body .mobile-drawer,
    body .mobile-drawer-overlay,
    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none;
    }
}

/* 小屏幕优化 */
@media (max-width: 575.98px) {
    .header {
        padding: 15px 0;
    }

    .logo-img {
        height: 40px;
    }

    .nav-action-group.is-open .nav-search-form {
        width: 12rem;
    }
}

.footer {
    background-color:transparent;
}
