/* 全局样式定义 */
:root {
    --primary-color: #8B0000;
    --secondary-color: #4B0082;
    --accent-color: #D4AF37;
    --background-color: #FFFFF0;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --medium-gray: #ccc;
    --light-gray: #f5f5f5;
    --dark-gray: #666;
    --hover-color: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --favorite-color: #e74c3c;
    --cart-color: #3498db;
    --remove-color: #e74c3c;
    --hot-sales-bg: #f8f4e9;
    --hot-sales-text: #d35400;
    --hot-sales-border: #e67e22;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --product-image-container-width: 300px;
    --product-image-container-height: 300px;
}  

/* 基础样式重置和通用设置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

/* 图片预览覆盖层样式 */
.image-preview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f39c12;
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.image-preview-overlay.active {
    display: flex;
}

.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10001;
}

.image-preview-close:hover {
    color: #ccc;
}

.image-preview-info {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: #f39c12;
    padding: 10px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.preview-tracking-code {
    font-size: 18px;
    margin-bottom: 5px;
    word-break: break-all;
}

.preview-tracking-code a {
    color: var(--secondary-color);
    text-decoration: underline;
}

.preview-whatsapp {
    font-size: 16px;
    color: var(--secondary-color);
}

/* Navigation Bar */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    overflow: visible; /* 下拉超出条栏时不要被裁剪，也减少与下层命中重叠 */
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 5px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    background: #fdf2f3;
    align-items: center;
    justify-content: center;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .nav-link:hover {
        color: var(--text-color);
        background: transparent;
    }
}

.nav-link img {
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
}

.cart-badge, .fav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* User dropdown menu styles */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 20px;
    transition: background 0.25s;
    flex-shrink: 1;
    min-width: 0;
}
.user-dropdown:hover {
    background: #fdf2f3;
}
/* 主面板由 .open / :focus-within 控制；提高层级避免指针落在下层页面时被当成“离开菜单” */
.user-dropdown.open,
.user-dropdown:focus-within {
    z-index: 5000;
}
/* 关键：伪元素桥接按钮下沿与面板之间的空隙，避免指针落在 margin 形成的“洞”里 */
.user-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -8px;
    right: -8px;
    height: 16px;
    z-index: 999;
    pointer-events: auto;
}

.user-menu-icon {
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.user-menu-trigger {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
@media (max-width: 768px) { .user-menu-icon { height: 38px; } }
@media (max-width: 480px) { .user-menu-icon { height: 32px; } }

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px); /* 与 ::after 桥接重叠，避免 margin 造成不可命中间隙 */
    right: 0;
    background-color: #ffffff;
    min-width: 170px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0;
    max-height: calc(100vh - 80px); /* 防止移动端超出视口 */
    overflow-y: auto;
}

.dropdown-item {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #fdf2f3;
    color: var(--primary-color);
}

.user-dropdown.open .dropdown-content,
.user-dropdown:focus-within .dropdown-content {
    display: block;
}

/* 2nd-level submenu for Articles */
.dropdown-item.has-submenu {
    position: relative;
    padding: 0;
}
.submenu-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-color);
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.submenu-toggle::after {
    content: "›";
    float: right;
    color: #9a9a9a;
    transition: transform 0.2s ease;
}
/* Submenu opens only via .open (click), not :hover — hover caused collapse when moving to Sign Out */
.dropdown-item.has-submenu:hover > .submenu-toggle,
.dropdown-item.has-submenu.open > .submenu-toggle {
    background-color: #fdf2f3;
    color: var(--primary-color);
}
.dropdown-submenu {
    display: none;
    position: static;
    min-width: 100%;
    background: #fff;
    border-top: 1px solid #f2f2f2;
    border-bottom: 1px solid #f2f2f2;
    padding: 8px 10px 10px;
}
.dropdown-item.has-submenu.open > .dropdown-submenu {
    display: block;
}
.dropdown-item.has-submenu.open > .submenu-toggle::after {
    content: "▾";
    transform: translateY(-1px);
}
.submenu-item {
    padding: 8px 10px;
    white-space: normal;
    font-size: 12.5px;
    line-height: 1.3;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid #f1f1f1;
}
.submenu-caption {
    font-size: 10px;
    font-weight: 700;
    color: #8b8b8b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 2px 2px 8px;
}
.submenu-group {
    border: 1px solid #f1f1f1;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}
.submenu-group:last-child {
    margin-bottom: 0;
}
.submenu-group-toggle {
    width: 100%;
    border: 0;
    background: #fafafa;
    color: #4a4a4a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    padding: 9px 10px;
    cursor: pointer;
}
.submenu-group-toggle::after {
    content: "›";
    float: right;
    color: #9a9a9a;
}
.submenu-group.open .submenu-group-toggle {
    background: #fdf2f3;
    color: var(--primary-color);
}
.submenu-group.open .submenu-group-toggle::after {
    content: "▾";
}
.submenu-group .submenu-links {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    background: #fff;
}
.submenu-group.open .submenu-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.submenu-item:hover {
    background: #fdf2f3;
    border-color: #f5dddd;
}
.submenu-group .submenu-item {
    width: 100%;
}

/* Sign Out：仅用 padding + 顶边线分隔，避免 margin 形成透明缝（指针会命中下层页面） */
.user-dropdown .dropdown-content > .has-submenu + .dropdown-item {
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
    padding-top: 18px;
}

/* --- Mobile Responsive Styles for Navigation --- */
@media (max-width: 768px) {
    .nav-links {
        gap: 5px;
        padding: 0 5px;
    }

    .nav-link {
        padding: 3px;
    }

    .nav-link img {
        height: 38px;
    }

    .cart-badge, .fav-badge {
        top: -3px;
        right: -3px;
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    .user-menu-icon { height: 38px !important; }

    /* Touch devices: submenu drops down inline instead of flying right */
    .dropdown-content {
        right: -2px;
        min-width: 200px;
    }
    .dropdown-submenu {
        position: static;
        margin: 0;
        min-width: 100%;
        border: 0;
        border-top: 1px solid #f1f1f1;
        border-radius: 0;
        box-shadow: none;
        max-height: none;
    }
    .submenu-item {
        padding: 8px 9px;
        font-size: 12px;
    }
    .submenu-toggle::after {
        content: "›";
    }
    .dropdown-item.has-submenu.open > .submenu-toggle::after {
        content: "▾";
    }
    .submenu-links { gap: 6px; }
    .submenu-caption {
        margin-bottom: 6px;
    }
    .submenu-group .submenu-links {
        gap: 6px;
        padding: 7px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 0;
    }

    .nav-container {
        padding: 0 5px;
    }

    .nav-links {
        gap: 3px;
    }

    .nav-link {
        padding: 2px;
    }

    .nav-link img {
        height: 32px;
    }

    .cart-badge, .fav-badge {
        top: -2px;
        right: -2px;
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    .user-menu-icon { height: 32px !important; }
}

/* --- Login Page Specific Styles --- */
.login-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin: 40px auto;
    transition: all 0.3s ease;
}

.login-container:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease-out;
}

.login-logo {
    max-width: 180px;
    height: auto;
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-title {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out;
}

.form-group:nth-child(1) {
    animation-delay: 0.3s;
}

.form-group:nth-child(2) {
    animation-delay: 0.4s;
}

.form-group:nth-child(3) {
    animation-delay: 0.5s;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    background-color: var(--card-background);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #999;
    font-style: italic;
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    width: 120px;
    height: 40px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-gray);
    color: #666;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.captcha-image:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

/* 邮箱验证码组样式 */
.email-verification-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.email-verification-group .form-input {
    flex: 1;
}

.send-code-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.send-code-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.3);
}

.send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .send-code-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: none;
    }
}

.login-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.3);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(139, 0, 0, 0.3);
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .login-button:hover {
        transform: none;
        box-shadow: none;
    }
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    animation: fadeInUp 0.6s ease-out 0.7s both;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-footer a:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .form-footer a:hover {
        text-decoration: none;
        color: var(--primary-color);
    }
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--error-color);
    animation: fadeIn 0.3s ease-out, shake 0.5s ease-out;
}

.success-message {
    background: #e6ffed;
    color: #006622;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--success-color);
    animation: fadeIn 0.3s ease-out;
}

.login-notice {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    color: white;
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.login-notice-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.login-notice-content {
    font-size: 14px;
    line-height: 1.5;
}

.login-notice-content a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.login-notice-content a:hover {
    color: #fdf2f3;
    text-decoration: none;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .login-notice-content a:hover {
        color: #fff;
        text-decoration: underline;
    }
}

/* --- Login Page Responsive Styles --- */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .login-button {
        padding: 12px;
        font-size: 14px;
        margin-top: 15px;
    }

    .captcha-image {
        width: 100px;
        height: 36px;
        font-size: 12px;
    }

    .send-code-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 90px;
    }

    .login-notice {
        padding: 12px;
        margin-top: 15px;
    }

    .login-notice-content {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 20px 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
        border-radius: 10px;
    }

    .login-logo {
        max-width: 140px;
    }

    .login-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-input {
        padding: 8px 10px;
        font-size: 14px;
        border-radius: 6px;
    }

    .login-button {
        padding: 12px;
        font-size: 14px;
        margin-top: 15px;
        border-radius: 6px;
    }

    .captcha-group {
        gap: 8px;
    }

    .captcha-image {
        width: 100px;
        height: 36px;
        font-size: 12px;
        border-radius: 6px;
    }

    .email-verification-group {
        gap: 8px;
    }

    .send-code-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 90px;
        border-radius: 6px;
    }

    .form-footer {
        margin-top: 15px;
        font-size: 13px;
    }

    .login-notice {
        padding: 12px;
        margin-top: 15px;
        border-radius: 6px;
    }

    .login-notice-content {
        font-size: 13px;
    }

    .error-message,
    .success-message {
        padding: 10px;
        margin-bottom: 15px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* --- Login Page Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* --- Login Page Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .login-container,
    .login-logo,
    .form-input,
    .captcha-image,
    .login-button,
    .form-footer a,
    .login-notice-content a {
        transition: none;
    }

    .login-container,
    .logo-container,
    .login-title,
    .form-group,
    .login-button,
    .form-footer,
    .login-notice,
    .error-message,
    .success-message {
        animation: none;
    }
}

.login-container:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: custom) {
    .login-container {
        border: 2px solid #000;
    }

    .form-input {
        border: 2px solid #000;
    }

    .login-button {
        border: 2px solid #000;
    }
}

/* 打印样式 */
@media print {
    .login-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .login-button {
        display: none;
    }
}

/* --- Main Content Styles --- */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--background-color);
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
        margin: 0;
    }
}



/* 热销氛围滚动组件样式（优化版） */
.hot-sales-rolling-container {
    background: linear-gradient(135deg, #fff8f0 0%, #fff4e6 100%);
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
    position: relative;
    overflow: hidden;
    max-width: 1200px;
}

.hot-sales-rolling-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #ff9800);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.hot-sales-title {
    font-size: 16px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}

.hot-sales-title::before {
    content: "🔥";
    margin-right: 8px;
    font-size: 18px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hot-sales-rolling-wrapper {
    height: 90px; /* 3行，每行30px */
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 0;
}

.hot-sales-rolling-content {
    position: relative;
    height: 100%;
    width: 100%;
}

.hot-sales-item {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 16px;
}

/* 高亮样式 */
.hot-sales-item .country {
    font-weight: 600;
    color: #1976d2;
}

.hot-sales-item .action {
    font-weight: 500;
    color: #388e3c;
}

.hot-sales-item .amount {
    font-weight: 700;
    color: #d32f2f;
    font-size: 15px;
}

.hot-sales-item .category {
    font-weight: 600;
    color: #7b1fa2;
}

/* 给高亮元素添加间距以确保良好的隔离效果 */
.hot-sales-item .customer {
    margin-right: 6px;
    font-weight: 500;
    color: #666;
}

.hot-sales-item .country {
    margin: 0 6px;
}

.hot-sales-item .action {
    margin: 0 6px;
}

.hot-sales-item .amount {
    margin: 0 6px;
}

.hot-sales-item .category {
    margin-left: 6px;
}

/* 移动端适配 - 平板 */
@media (max-width: 1024px) {
    .hot-sales-rolling-container {
        padding: 14px 18px;
        margin: 18px auto;
    }

    .hot-sales-title {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .hot-sales-rolling-wrapper {
        height: 84px;
    }

    .hot-sales-item {
        font-size: 13px;
        padding: 7px 14px;
    }
}

/* 移动端适配 - 手机 */
@media (max-width: 768px) {
    .hot-sales-rolling-container {
        padding: 12px 16px;
        margin: 16px auto;
        border-radius: 10px;
    }

    .hot-sales-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .hot-sales-title::before {
        font-size: 16px;
        margin-right: 6px;
    }

    .hot-sales-rolling-wrapper {
        height: 78px;
    }

    .hot-sales-item {
        font-size: 12px;
        padding: 6px 12px;
        line-height: 1.4;
    }

    .hot-sales-item .amount {
        font-size: 13px;
    }
}

/* 移动端适配 - 小屏手机 */
@media (max-width: 480px) {
    .hot-sales-rolling-container {
        padding: 10px 12px;
        margin: 12px auto;
        border-radius: 8px;
        border-width: 1px;
    }

    .hot-sales-rolling-container::before {
        height: 3px;
    }

    .hot-sales-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .hot-sales-title::before {
        font-size: 15px;
        margin-right: 5px;
    }

    .hot-sales-rolling-wrapper {
        height: 72px;
        border-radius: 6px;
    }

    .hot-sales-item {
        font-size: 11px;
        padding: 5px 10px;
        line-height: 1.3;
    }

    .hot-sales-item .amount {
        font-size: 12px;
    }

    /* 在小屏幕上，保持单行显示，超长部分用省略号 */
    .hot-sales-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .hot-sales-rolling-wrapper {
        height: 60px;
    }

    .hot-sales-item {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1440px) {
    .hot-sales-rolling-container {
        padding: 18px 24px;
    }

    .hot-sales-title {
        font-size: 17px;
    }

    .hot-sales-rolling-wrapper {
        height: 96px;
    }

    .hot-sales-item {
        font-size: 15px;
        padding: 9px 18px;
    }

    .hot-sales-item .amount {
        font-size: 16px;
    }
}

/* 暗色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    .hot-sales-rolling-container {
        background: linear-gradient(135deg, #2d2416 0%, #3d2f1a 100%);
        border-color: #ff9800;
    }

    .hot-sales-title {
        color: #ffb74d;
    }

    .hot-sales-rolling-wrapper {
        background: rgba(0, 0, 0, 0.3);
    }

    .hot-sales-item {
        color: #e0e0e0;
    }

    .hot-sales-item .country {
        color: #64b5f6;
    }

    .hot-sales-item .action {
        color: #81c784;
    }

    .hot-sales-item .amount {
        color: #ef5350;
    }

    .hot-sales-item .category {
        color: #ba68c8;
    }
}

/* 打印样式 */
@media print {
    .hot-sales-rolling-container {
        display: none;
    }
}

/* 无障碍优化 */
.hot-sales-rolling-container:focus-within {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    .hot-sales-rolling-container::before {
        animation: none;
    }

    .hot-sales-title::before {
        animation: none;
    }

    .hot-sales-item {
        transition: none !important;
    }
}

.login-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.3);
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .login-button:hover {
        transform: none;
        box-shadow: none;
    }
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

/* 移动端去除hover效果 */
@media (hover: none) {
    .form-footer a:hover {
        text-decoration: none;
    }
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* 错误消息动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.success-message {
    background: #e6ffed;
    color: #006622;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.login-notice {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-notice-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.login-notice-content {
    font-size: 14px;
    line-height: 1.5;
}

.login-notice-content a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
}

.login-notice-content a:hover {
    color: #fdf2f3;
    text-decoration: none;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .login-notice-content a:hover {
        color: #fff;
        text-decoration: underline;
    }
}

/* --- Mobile Responsive Styles for Login Page --- */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
    }
    
    .captcha-group {
        flex-direction: row; /* 保持水平排列 */
        gap: 8px;
    }
    
    .captcha-input {
        flex: 1;
    }
    
    .captcha-image {
        width: 100px; /* 在移动端稍微减小宽度 */
        height: 38px; /* 保持高度 */
    }
    
    .email-verification-group {
        flex-direction: row; /* 保持水平排列 */
        gap: 8px;
    }
    
    .send-code-btn {
        padding: 12px 10px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .mobile-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .mobile-group .country-code {
        width: 100%;
    }
}



/* --- Generic Page Layout --- */
.page-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 商品展示容器 */
.products-section {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    .products-section {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .products-section {
        padding: 0 10px;
    }
}

.page-header {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

/* 最新更新时间显示样式 */
.last-update-info {
    background-color: #fdf2f3;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
    color: var(--primary-color);
}

.last-update-info p {
    margin: 0;
    font-size: 16px;
}

.last-quality-info {
    background-color: #fdf2f3;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    text-align: left;
    font-weight: 350;
    color: var(--text-color);
}

.last-quality-info p {
    margin: 0;
    font-size: 10px;
}

/* 公告区域样式 */
.announcement-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.announcement-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    text-align: center;
}

.announcement-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.announcement-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.announcement-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.announcement-content strong {
    font-weight: 600;
}

/* --- Search Form Tabs --- */
.search-tabs {
    display: flex;
    border-bottom: 2px solid var(--medium-gray);
    margin-bottom: 25px;
}

.tab-button {
    padding: 12px 12px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-gray);
    position: relative;
    transition: color 0.3s ease;
}

.tab-button.active {
    color: var(--primary-color);
}

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

.tab-content {
    display: none;
}

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

.image-source-option {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.image-source-option input[type="radio"] {
    margin-right: 10px;
}

.image-source-option .input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.input-group .form-input,
.input-group .file-input-wrapper {
    width: 100%;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.file-input-label {
    background: #fdf2f3;
    border: 2px solid var(--medium-gray);
    color: var(--primary-color);
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s ease;
    flex-grow: 1;
}

.file-input-label:hover {
    background: #fce6e7;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .file-input-label:hover {
        background: #fdf2f3;
    }
}

.clear-btn {
    margin-left: 10px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
}

/* --- NEW: Thumbnail Preview for File Upload --- */
.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.file-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.file-preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--medium-gray);
}

.file-preview-name {
    font-size: 12px;
    color: #666;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Disabled state for inputs */
.form-input:disabled,
.file-input-label.disabled {
    background: var(--light-gray);
    cursor: not-allowed;
    color: #ccc;
    border-color: var(--medium-gray);
}

.file-input-label.disabled {
    color: #aaa;
    background: var(--light-gray);
}

/* --- Search Form Specifics --- */
.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 16px;
}

.form-note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* --- Filters Styles --- */
.filters-content {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.filters-content.show {
    display: block;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

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

.filter-select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.brand-filter-wrapper {
    position: relative;
}

.brand-search-input {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.brand-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
}

.brand-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.brand-dropdown.show {
    display: block;
}

.brand-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.brand-option:hover {
    background-color: var(--hover-color);
}

.brand-checkbox {
    margin-right: 10px;
}

.selected-brands-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.brand-tag {
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    gap: 5px;
}

.brand-tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.brand-tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.clear-filters-btn {
    padding: 10px 20px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.submit-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.search-button, .submit-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-button:hover, .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.3);
}

.search-button:disabled, .submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.clear-cache-button {
    background: none;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
    padding: 10px;
    transition: color 0.3s ease;
    /* 添加响应式设计 */
    max-width: 1200px;
    margin: 30px auto;
    text-align: left;
    line-height: 1.6;
}

.clear-cache-button div {
    margin-bottom: 10px;
}

.clear-cache-button div:first-child {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
}

.clear-cache-button a {
    color: var(--primary-color);
    text-decoration: none;
}

.clear-cache-button a:hover {
    text-decoration: underline;
}

.clear-cache-button:hover {
    color: var(--primary-color);
}

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

@media (max-width: 768px) {
    .notes-container {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .clear-cache-button {
        padding: 8px;
        font-size: 13px;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .notes-container {
        padding: 0 10px;
        margin: 15px auto;
    }
    
    .clear-cache-button {
        padding: 6px;
        font-size: 12px;
        margin: 15px auto;
    }
}

/* --- Item Grids --- */
.products-grid, .favorites-grid, .cart-grid, #productsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .products-grid, .favorites-grid, .cart-grid, #productsGrid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid, .favorites-grid, .cart-grid, #productsGrid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}

.product-card, .favorite-card, .cart-item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
}

.product-card:hover, .favorite-card:hover, .cart-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 在移动端减小hover效果以提高性能 */
@media (max-width: 768px) {
    .product-card:hover, .favorite-card:hover, .cart-item-card:hover {
        transform: none;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    }
}

.product-image-container {
    width: 90%;
    max-width: var(--product-image-container-width);
    height: var(--product-image-container-height);
    position: relative;
    overflow: hidden;          /* 严格裁切，防止图片溢出遮盖下方内容 */
    flex-shrink: 0;            /* 不被 flex 父级压缩 */
    margin-bottom: 6px;
    background: #f8f8f8;       /* 图片未填满时的背景色，视觉上补白 */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .product-image-container {
        width: 88%;
        height: calc(var(--product-image-container-height) * 0.8);
    }
}

@media (max-width: 480px) {
    .product-image-container {
        width: 85%;
        height: calc(var(--product-image-container-height) * 0.7);
    }
}

.product-image, .item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* 保持纵横比，不足部分显示背景色 */
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .product-image, .item-image {
        transition: none;
    }
}

@media (max-width: 480px) {
    .product-image, .item-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

.product-info, .item-info {
    padding: 6px 10px;
    width: 100%;
}

.product-id-sn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    padding: 0 8px;
}

.product-sn {
    color: var(--primary-color);
    font-weight: 360;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    flex: 1;
    margin-right: 8px;
}

.item-id {
    color: var(--primary-color);
    font-weight: 360;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.product-id {
    color: var(--dark-gray);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    text-align: right;
    flex-shrink: 0;
}

.product-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 8px;
}

.item-actions {
    display: flex;
    gap: 6px;
}

.product-score {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
    margin-right: auto;
}

.product-actions {
    display: flex;
    gap: 6px;
}

/* 商品卡片图片容器样式调整，用于按钮悬浮 */
.product-card {
    position: relative;
}

.product-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 悬浮按钮容器 */
.product-actions-overlay {
    position: absolute;
    bottom: 2px;
    right: 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    max-width: 36px;
    width: 36px;
    align-items: center;
}

.product-card:hover .product-actions-overlay {
    background: transparent;
    box-shadow: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .product-actions-overlay {
        bottom: 2px;
        right: 2px;
        gap: 8px;
        padding: 0;
        max-width: 36px;
        width: 36px;
        align-items: center;
    }
    
    /* 移动端商品信息布局优化 */
    .product-id-sn {
        display: block;
        text-align: center;
        margin-bottom: 12px;
    }
    
    .product-sn {
        text-align: center;
        margin-right: 0;
        margin-bottom: 6px;
    }
    
    .product-id {
        text-align: center;
    }
    
    /* 移动端操作按钮优化 */
    .action-button {
        width: 36px;
        height: 36px;
        padding: 4px;
    }
    
    /* 移动端表格适配 */
    .task-table {
        font-size: 12px;
        width: 100%;
    }
    
    .task-table th:first-child,
    .task-table td:first-child,
    .task-id-cell {
        display: none;
    }
    
    .task-table button {
        font-size: 10px;
        padding: 6px 12px;
        white-space: nowrap;
        border-radius: 4px;
    }
    
    .task-table .status-cell {
        min-width: 80px;
    }
    
    .task-table .actions-cell {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .product-actions-overlay {
        bottom: 2px;
        right: 2px;
        gap: 6px;
        padding: 0;
        max-width: 40px;
        width: 40px;
        align-items: center;
    }
    
    /* 移动端操作按钮进一步优化 */
    .action-button {
        width: 40px;
        height: 40px;
        padding: 5px;
    }
    
    /* 移动端表格进一步适配 */
    .task-table {
        font-size: 11px;
    }
    
    .task-table button {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    /* 响应式搜索历史布局 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tasks-table {
        font-size: 12px;
        min-width: 100%;
        width: 100%;
    }
    
    .tasks-table th:first-child,
    .tasks-table td:first-child,
    .tasks-table .task-id-cell {
        display: none !important;
    }
    
    .tasks-table th {
        font-size: 11px;
        padding: 8px 6px;
        white-space: nowrap;
        text-align: center;
    }
    
    .tasks-table td {
        padding: 8px 6px;
        font-size: 11px;
        text-align: center;
    }
    
    .tasks-table button {
        font-size: 10px;
        padding: 6px 10px;
        white-space: nowrap;
        border-radius: 4px;
        min-width: 80px;
        margin: 4px auto;
        display: block;
        width: 100%;
        max-width: 120px;
    }
    
    .tasks-table .status-badge {
        font-size: 10px;
        padding: 3px 8px;
        display: inline-block;
        margin: 0 auto;
    }
    
    .tasks-table .task-thumb {
        width: 30px;
        height: 30px;
    }
    
    .tasks-table .query-cell {
        gap: 8px;
        justify-content: center;
    }
    
    .tasks-table .task-name {
        font-size: 11px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 移动端任务卡片布局 */
    .tasks-container.mobile {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .task-card {
        background: white;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .task-card-header {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .task-card-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .task-card-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .task-card-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }
    
    .task-card-actions button {
        font-size: 12px;
        padding: 8px 16px;
        border-radius: 4px;
    }
    
    /* 分页控件 */
    .pagination-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        margin-top: 20px;
        flex-wrap: wrap;
    }
    
    .pagination-controls button {
        font-size: 12px;
        padding: 6px 12px;
        border: 1px solid var(--medium-gray);
        border-radius: 4px;
        background: white;
        cursor: pointer;
    }
    
    .pagination-controls button.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .pagination-controls button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    

}

.action-button {
    padding: 6px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 删除商品蒙版效果 */
.product-deleted-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 100;
    animation: fadeIn 0.3s ease-in-out;
}

.deleted-message {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: rotate(-15deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.favorite-btn::before, .cart-btn::before, .remove-btn::before {
    content: "";
    display: inline-block;
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 移动端图标调整 */
@media (max-width: 768px) {
    .favorite-btn::before, .cart-btn::before, .remove-btn::before {
        width: 90%;
        height: 90%;
    }
}

@media (max-width: 480px) {
    .favorite-btn::before, .cart-btn::before, .remove-btn::before {
        width: 90%;
        height: 90%;
    }
}

.favorite-btn, .cart-btn, .remove-btn {
    background: var(--primary-color);
    color: white;
    position: relative;
}

.favorite-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.cart-btn {
    background: var(--secondary-color);
}

.cart-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E");
}

.remove-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
}

.remove-btn {
    background: var(--error-color);
}

.edit-btn::before {
    content: '🛠️';
    font-size: 16px;
    background-image: none;
    background-color: transparent;
    width: auto;
    height: auto;
    display: inline;
    mask: none;
    -webkit-mask: none;
}

.edit-btn {
    background: #4CAF50;
    color: black;
}

/* 选择按钮样式 */
.select-btn {
    background: #2196F3;
    color: white;
}

.select-btn::before {
    content: '+';
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.select-btn.selected::before {
    content: '-';
}

/* 以图搜图按钮 */
.search-similar-btn {
    background: #FF7043;
    color: white;
}

.search-similar-btn::before {
    content: "";
    display: inline-block;
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.search-similar-btn:hover {
    background: #E64A19;
    transform: scale(1.1);
}

/* 批量操作面板样式 */
.batch-operations-panel {
    position: fixed;
    right: 20px;
    top: 100px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    display: none;
}

.batch-operations-panel .panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    text-align: center;
    font-weight: 500;
}

.batch-operations-panel .selected-count {
    font-weight: bold;
    margin-right: 5px;
}

.batch-operations-panel .panel-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.batch-button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.batch-button.delete-btn {
    background: var(--error-color);
    color: white;
}

.batch-button.edit-btn {
    background: #4CAF50;
    color: white;
}

.batch-button.clear-btn {
    background: #9E9E9E;
    color: white;
}

.batch-button.select-all-btn {
    background: #2196F3;
    color: white;
}

.batch-button.select-all-btn.active {
    background: #FF9800;  /* 全选状态变橙色，明确区分 */
    color: white;
}

.batch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 批量修改模态框样式 */
.batch-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.batch-edit-modal .modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

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

.batch-edit-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.batch-edit-modal .selected-count-info {
    font-size: 14px;
    color: #666;
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.batch-edit-modal .modal-header {
    background: white;
    color: var(--text-color);
}

.batch-edit-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.batch-edit-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.batch-edit-modal .modal-header .header-content {
    display: flex;
    align-items: center;
}

.batch-edit-modal .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.batch-edit-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.batch-edit-modal .modal-body {
    padding: 20px;
}

.batch-edit-modal .form-group {
    margin-bottom: 15px;
}

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

.batch-edit-modal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.batch-edit-modal .form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.batch-edit-modal .form-note {
    font-size: 12px;
    color: var(--dark-gray);
    margin-top: 15px;
    font-style: italic;
}

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

.batch-edit-modal .modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.batch-edit-modal .cancel-btn {
    background: var(--medium-gray);
    color: var(--text-color);
}

.batch-edit-modal .save-btn {
    background: var(--success-color);
    color: white;
}

.batch-edit-modal .save-btn:hover {
    background: #45a049;
}

.batch-edit-modal .save-btn:disabled,
.batch-edit-modal .cancel-btn:disabled,
.batch-edit-modal .close-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Progress Bar Styles */
.progress-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--dark-gray);
    text-align: center;
}

/* Dropdown with Search Styles */
.dropdown-with-search {
    position: relative;
}

.brand-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 14px;
}

.brand-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--medium-gray);
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.brand-dropdown.show {
    display: block;
}

.brand-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

.brand-option:hover {
    background-color: var(--hover-color);
}

.no-results {
    padding: 10px 12px;
    color: var(--dark-gray);
    font-size: 14px;
    text-align: center;
}

.selected-value {
    margin-top: 8px;
    padding: 8px 10px;
    background-color: var(--hover-color);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
}

/* Batch Progress Notification */
.batch-progress-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 300px;
    background: white;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.batch-progress-notification .progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.batch-progress-notification .progress-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.batch-progress-notification .progress-text {
    font-size: 14px;
    color: var(--dark-gray);
    text-align: center;
}

/* Form Select Styles */
.batch-edit-modal .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.batch-edit-modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* 商品卡片选中状态 */
.product-card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .batch-operations-panel {
        right: 10px;
        min-width: 140px;
    }
    
    .batch-operations-panel .panel-header {
        padding: 10px;
        font-size: 14px;
    }
    
    .batch-operations-panel .panel-body {
        padding: 10px;
        gap: 8px;
    }
    
    .batch-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .batch-edit-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .batch-edit-modal .modal-header,
    .batch-edit-modal .modal-body,
    .batch-edit-modal .modal-footer {
        padding: 15px;
    }
    
    .batch-edit-modal .modal-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .batch-operations-panel {
        right: 5px;
        min-width: 120px;
    }
    
    .batch-operations-panel .panel-header {
        padding: 8px;
        font-size: 12px;
    }
    
    .batch-operations-panel .panel-body {
        padding: 8px;
        gap: 6px;
    }
    
    .batch-button {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .batch-edit-modal .modal-content {
        width: 98%;
        margin: 10px;
    }
    
    .batch-edit-modal .modal-header,
    .batch-edit-modal .modal-body,
    .batch-edit-modal .modal-footer {
        padding: 12px;
    }
    
    .batch-edit-modal .modal-header h3 {
        font-size: 14px;
    }
    
    .batch-edit-modal .form-group input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .batch-edit-modal .cancel-btn,
    .batch-edit-modal .save-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* --- Selection Controls (Favorites & Cart) --- */
/* --- Selection Controls (Favorites, Cart, Orders) --- */
.selection-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.control-button {
    padding: 7px 15px;
    border: 1.5px solid rgba(139,0,0,0.25);
    border-radius: 8px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.control-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fdf2f3;
}
.control-button:active {
    transform: scale(0.97);
}
.control-button:disabled {
    background: #f5f5f5;
    border-color: #ddd;
    color: #bbb;
    cursor: not-allowed;
}

/* Add-to-cart: secondary color accent */
.add-to-cart-btn {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}
.add-to-cart-btn:hover {
    background: #3a006a;
    border-color: #3a006a;
    color: #fff;
}

/* Destructive (remove) buttons in control row */
.selection-controls .remove-btn {
    background: #fff0f0;
    color: var(--error-color);
    border-color: rgba(231,76,60,0.30);
}
.selection-controls .remove-btn:hover {
    background: var(--error-color);
    color: #fff;
    border-color: var(--error-color);
}
/* Suppress the action-button icon pseudo-element on text control buttons.
   .remove-btn::before normally injects a trash-can SVG (designed for the
   small circular overlay buttons). When .remove-btn is also a .control-button
   the pseudo-element occupies 90% of the button's interior and pushes the
   label text outside the visible boundary. */
.control-button.remove-btn::before,
.selection-controls .remove-btn::before {
    display: none !important;
    content: none !important;
}
/* Same guard for favorite/cart if ever used as control-buttons */
.control-button.favorite-btn::before,
.control-button.cart-btn::before {
    display: none !important;
    content: none !important;
}

@media (max-width: 480px) {
    .selection-controls { gap: 6px; }
    .control-button { padding: 6px 10px; font-size: 12px; }
}

.item-checkbox {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 18px;
    height: 18px;
    z-index: 10;
}

/* --- Cart Page Specifics --- */
.cart-item-card {
    padding-top: 0;
    align-items: stretch;
}

.cart-card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.cart-card-header .item-checkbox {
    position: static;
    margin-right: 12px;
}

.cart-card-header .item-id {
    flex: 1;
}

.cart-card-body {
    display: flex;
    padding: 6px;
    flex: 1;
}

.cart-card-body .product-image-container {
    width: 150px;
    height: 150px;
    margin-right: 5px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.order-info {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.info-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.info-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
}

.info-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.submit-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.selected-count {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 15px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-gray);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 20px;
}

.empty-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* --- Other --- */
.loading, .no-more {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-more {
    color: var(--dark-gray);
    font-style: italic;
}

/* --- Loading Animation --- */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(139, 0, 0, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-placeholder p {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    grid-column: 1 / -1;
}

.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-preview-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.image-preview-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: var(--secondary-color);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* --- Cached Search Results --- */
.cached-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 10px;
}

.cached-search-item {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cached-query-info {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.cached-query-info strong {
    color: var(--text-color);
}

.result-query-display {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.result-query-display img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* --- Active Search Tasks Table --- */
#activeTasksContainer h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--medium-gray);
    padding-bottom: 10px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0px;
}

.tasks-table th, .tasks-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.tasks-table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

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

.query-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.task-name, .task-query-text {
    font-size: 14px;
    color: var(--text-color);
}

.task-id-cell {
    font-family: monospace;
    font-size: 12px;
    color: var(--dark-gray);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.status-completed {
    background-color: #e4f8f0;
    color: #28a745;
}

.status-badge.status-failed {
    background-color: #fceded;
    color: #dc3545;
}

.status-badge.status-processing {
    background-color: #fdf2f3;
    color: var(--primary-color);
}

.view-results-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.view-results-btn:hover {
    background: #a52525;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .view-results-btn:hover {
        background: var(--primary-color);
    }
}

.status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-time {
    font-size: 11px;
    color: var(--dark-gray);
    white-space: nowrap;
}

/* --- Cart Item Rows --- */
.cart-item-row {
    display: flex;
    padding: 5px 15px;
    width: 100%;
    align-items: center;
}

.cart-item-row.product-image-container {
    padding: 10px 15px;
    justify-content: center;
}

.cart-item-row .item-tracking-code {
    flex: 1;
    color: var(--text-color);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-row .item-id {
    width: 100%;
    text-align: left;
}

.cart-item-row .item-meta {
    width: 100%;
    text-align: left;
    color: var(--dark-gray);
    font-size: 12px;
}

.cart-item-row .item-actions {
    width: 100%;
    display: flex;
    justify-content: right;
    padding: 5px 0;
}

.past-order-item {
    margin-bottom: 20px;
}

.past-order-header {
    background: var(--light-gray);
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
}

/* --- Responsive Design --- */




/* Backend status indicator styles */
.backend-status {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.checking {
    background-color: #ffc107;
}

.status-indicator.online {
    background-color: #28a745;
}

.status-indicator.offline {
    background-color: #dc3545;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.remove-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
}

.delete-btn {
    background: var(--error-color);
    color: white;
}

.delete-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
}

.delete-task-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-task-btn::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
    margin-right: 4px;
}

.delete-task-btn:hover {
    background-color: #c82333;
}

.delete-task-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.delete-task-btn:active {
    transform: translateY(1px);
}

/* 对于失败状态下的删除按钮，可以使用不同的样式 */
.status-failed .delete-task-btn {
    background-color: #6c757d;
}

.status-failed .delete-task-btn:hover {
    background-color: #5a6268;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .delete-task-btn:hover {
        background-color: #dc3545;
    }
    
    .status-failed .delete-task-btn:hover {
        background-color: #6c757d;
    }
}

/* --- Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.pagination-controls button {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--medium-gray);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #fdf2f3;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination-controls button:active:not(:disabled) {
    transform: translateY(0);
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .pagination-controls button:hover:not(:disabled) {
        background-color: #ffffff;
        border-color: var(--medium-gray);
        color: var(--text-color);
        transform: none;
    }
}

.pagination-controls button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(139, 0, 0, 0.3);
}

.pagination-controls button:disabled {
    background-color: var(--light-gray);
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.pagination-controls button:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.pagination-controls button:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* --- Responsive Pagination --- */
@media (max-width: 768px) {
    .pagination-controls {
        gap: 4px;
        margin: 20px 0;
    }
    
    .pagination-controls button {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .pagination-controls {
        gap: 2px;
        margin: 15px 0;
    }
    
    .pagination-controls button {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 32px;
        min-height: 32px;
    }
    
    /* 在小屏幕上只显示第一页、最后一页和当前页附近的按钮 */
    .pagination-controls button.hide-mobile {
        display: none;
    }
}

/* --- Search Submission Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    padding: 30px;
    text-align: center;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
}

.modal-icon-info {
    background-color: var(--primary-color);
    color: white;
}

.modal-icon-success {
    background-color: #28a745;
    color: white;
}

.modal-icon-error {
    background-color: #dc3545;
    color: white;
}

.modal-icon-warning {
    background-color: #ffc107;
    color: #212529;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

.modal-message {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-message form {
    text-align: left;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-button {
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-button.confirm {
    background-color: var(--primary-color);
    color: white;
}

.modal-button.confirm:hover {
    background-color: #a52525;
    transform: translateY(-2px);
}

.modal-timer {
    font-size: 14px;
    color: var(--dark-gray);
    margin-top: 15px;
}

/* --- Password Change Modal Specific Styles --- */
#changePasswordModal .modal-content {
    max-width: 450px;
}

#changePasswordModal .modal-icon {
    background-color: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    font-size: 30px;
}

#changePasswordModal .form-group {
    margin-bottom: 20px;
}

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

#changePasswordModal .form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#changePasswordModal .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

#changePasswordModal .form-note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

#changePasswordModal .email-verification-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#changePasswordModal .email-verification-group .form-input {
    flex: 1;
}

#changePasswordModal .send-code-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

#changePasswordModal .send-code-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.3);
}

/* 移动端去除hover效果 */
@media (hover: none) {
    #changePasswordModal .send-code-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: none;
    }
}

#changePasswordModal .send-code-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Responsive Modal --- */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .modal-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .modal-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .modal-actions {
        gap: 10px;
    }
    
    .modal-button {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    #changePasswordModal .email-verification-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    #changePasswordModal .send-code-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .modal-message {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-button {
        width: 100%;
        padding: 10px;
    }
    
    #changePasswordModal .form-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    #changePasswordModal .email-verification-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* --- Footer Information Section --- */
.footer-info {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin: 30px auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 1200px;
}

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

.footer-info-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.footer-info-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fdf2f3;
}

.footer-info-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.footer-info-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.footer-info-status.online {
    background-color: #4caf50;
}

.footer-info-status.offline {
    background-color: #f44336;
}

.footer-info-status.checking {
    background-color: #ff9800;
}

.footer-info-url {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-bottom: 2px dashed white;
    display: block;
    margin-top: 8px;
}

.footer-info-url:hover {
    opacity: 0.9;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .footer-info-url:hover {
        opacity: 1;
    }
}

.footer-logo-url {
    display: block;
    text-decoration: none;
}

.footer-logo {
    height: 30px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.footer-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-copyright-links {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
    font-size: 14px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-link:hover {
    opacity: 0.7;
}

.footer-copyright {
    margin-top: 15px;
    color: var(--dark-gray);
}

/* --- Responsive Footer Info --- */
@media (max-width: 768px) {
    .footer-info {
        padding: 20px 15px;
        margin: 20px auto;
    }
    
    .footer-info-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-info-item {
        min-width: 100%;
    }
    
    .footer-info-value {
        font-size: 20px;
    }
    
    .footer-info-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .footer-info {
        padding: 15px 10px;
        border-radius: 10px;
    }
    
    .footer-info-value {
        font-size: 18px;
    }
    
    .footer-info-url {
        font-size: 14px;
    }
    
    .footer-copyright-links {
        padding: 15px 10px;
    }
}

/* 分类筛选样式 */
.category-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.filter-section-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.filter-inline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-label {
    white-space: nowrap;
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

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

.filter-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
}

.filter-option:hover {
    background: #e9ecef;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .filter-option:hover {
        background: #fff;
    }
}

.filter-option.active {
    background: #c1272d;
    color: white;
    border-color: #c1272d;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.alphabet-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.alphabet-option:hover {
    background: #e9ecef;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .alphabet-option:hover {
        background: #fff;
    }
}

.alphabet-option.active {
    background: #c1272d;
    color: white;
    border-color: #c1272d;
}

.filter-search input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .filter-search input {
        width: 100%;
    }
}

.brand-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.no-brands-message {
    color: #6c757d;
    font-style: italic;
    padding: 10px 0;
    margin: 0;
    text-align: center;
    flex: 1;
    width: 100%;
}

/* 已选品牌展示区域样式 */
.selected-brands-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.selected-brands-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.clear-all-brands-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.clear-all-brands-btn:hover {
    background: #c82333;
}

.selected-brands-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.selected-brand-tag {
    background: #c1272d;
    color: white;
    border-radius: 15px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.selected-brand-tag .remove-brand {
}

/* L2 Category字母筛选样式 */
#category2AlphabetFilter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 10px;
    order: 2;
}

#category2AlphabetFilter .alphabet-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#category2AlphabetFilter .alphabet-option:hover {
    background: #e9ecef;
}

#category2AlphabetFilter .alphabet-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 移动端适配 */
@media (max-width: 768px) {
    #category2AlphabetFilter {
        margin-top: 8px;
        order: 2;
    }
    
    #category2AlphabetFilter .alphabet-option {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 确保筛选标签在一行显示 */
.filter-section .filter-inline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    order: 1;
}

/* L2 Category筛选区域保持与其他筛选区域一致的布局 */
.filter-section:nth-child(2) {
    /* 移除flex-direction: column，保持默认的block布局 */
}

@media (max-width: 768px) {
    .filter-section:nth-child(2) {
        /* 移除flex-direction: column，保持默认的block布局 */
    }
}

.filter-section .filter-label {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .filter-section .filter-inline-header {
        flex-wrap: wrap;
        order: 1;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .filter-actions {
        flex-direction: row;   /* 保持横排，节省纵向空间 */
        flex-wrap: nowrap;
        gap: 8px;
    }

    .filter-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .selected-brands-section {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .selected-brands-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .selected-brands-container {
        gap: 6px;
    }
    
    .selected-brand-tag {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .clear-all-brands-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 响应式设计 - 移动端优先 */
@media (max-width: 768px) {
    .category-filters {
        padding: 15px;
    }
    
    .filter-options {
        gap: 6px;
        order: 1;
    }
    
    .filter-option {
        padding: 5px 10px;
        font-size: 13px;
    }

    .filter-controls {
        flex-direction: row;      /* 保持横排，字母筛选和搜索框在同一行 */
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .brand-options-container {
        max-height: 220px;        /* 从 150px 扩大，减少滚动负担 */
    }
    
    .filter-label {
        font-size: 14px;
    }
    
    /* L2 Category选项字体稍小 */
    #category2Filters .filter-option {
        font-size: 13px;
        padding: 5px 10px;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-options {
        gap: 7px;
    }
    
    .filter-option {
        padding: 5px 11px;
        font-size: 13px;
    }
}

/* PC端 */
@media (min-width: 1025px) {
    .filter-options {
        gap: 8px;
        order: 1;
    }
    
    .filter-option {
        padding: 6px 12px;
        font-size: 14px;
    }
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 100px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #a52525;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .btn-primary:hover {
        background: var(--primary-color);
    }
    
    .btn-secondary:hover {
        background: #6c757d;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 10px 16px;
        font-size: 15px;
        min-height: 44px; /* iOS 最小触摸目标 */
        min-width: 100px;
    }
    /* filter-actions 方向已在上方统一为 row，此处不重复设置 */
}

/* 分类筛选样式 */
.category-filters {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.filter-section-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 16px;
}

.filter-inline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-label {
    white-space: nowrap;
    font-weight: bold;
    color: var(--text-color);
    font-size: 16px;
}

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

.filter-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
}

.filter-option:hover {
    background: #e9ecef;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .filter-option:hover {
        background: #fff;
    }
}

.filter-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.alphabet-option {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.alphabet-option:hover {
    background: #e9ecef;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .alphabet-option:hover {
        background: #fff;
    }
}

.alphabet-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-search input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .filter-search input {
        width: 100%;
    }
}

.brand-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.no-brands-message {
    color: #6c757d;
    font-style: italic;
    padding: 10px 0;
    margin: 0;
    text-align: center;
    flex: 1;
    width: 100%;
}

/* 已选品牌展示区域样式 */
.selected-brands-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.selected-brands-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.clear-all-brands-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.clear-all-brands-btn:hover {
    background: #c82333;
}

.selected-brands-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.selected-brand-tag {
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.selected-brand-tag .remove-brand {
}

.selected-brand-tag .remove-brand:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .selected-brands-section {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .selected-brands-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .selected-brands-container {
        gap: 6px;
    }
    
    .selected-brand-tag {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .clear-all-brands-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 响应式设计 - 移动端优先 */
@media (max-width: 768px) {
    .category-filters {
        padding: 15px;
    }
    
    .filter-options {
        gap: 6px;
        order: 1; /* 确保显示在正确位置 */
    }
    
    .filter-option {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .brand-options-container {
        max-height: 150px;
    }
    
    .filter-label {
        font-size: 14px;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-options {
        gap: 7px;
    }
    
    .filter-option {
        padding: 5px 11px;
        font-size: 13px;
    }
}

/* PC端 */
@media (min-width: 1025px) {
    .filter-options {
        gap: 8px;
        order: 1; /* 确保显示在正确位置 */
    }
    
    .filter-option {
        padding: 6px 12px;
        font-size: 14px;
    }
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    min-width: 100px;
}

.btn-primary {
    background: #c1272d;
    color: white;
}

.btn-primary:hover {
    background: #a52525;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 移动端去除hover效果 */
@media (hover: none) {
    .btn-primary:hover {
        background: #c1272d;
    }
    
    .btn-secondary:hover {
        background: #6c757d;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 10px 16px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .filter-actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .filter-actions .btn {
        flex: 1;
        min-width: 0;
    }
}

/* Additional styles for improved filter UI */
.filters-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    user-select: none;
}

.filters-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 20px;
}

.filters-toggle-icon.open {
    transform: rotate(180deg);
}

.filters-content {
    display: none;
    margin-top: 16px;
    gap: 16px;
}

.filters-content.show {
    display: flex;
    flex-direction: column;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.filter-group {
    flex: 1;
    min-width: 0;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #999;
}

.filter-select:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.brand-filter-wrapper {
    position: relative;
}

.brand-search-input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.brand-search-input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.brand-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.brand-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
}

.brand-dropdown.show {
    display: block;
}

.brand-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-option:hover {
    background: #f5f5f5;
}

.brand-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.selected-brands-display {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.brand-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #333;
    color: white;
    border-radius: 16px;
    font-size: 13px;
}

.brand-tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.brand-tag-remove:hover {
    background: rgba(255,255,255,0.2);
}

.clear-filters-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-end;
    height: fit-content;
}

.clear-filters-btn:hover {
    border-color: #999;
    color: #333;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .brand-dropdown {
        max-height: 200px;
    }
    
    .clear-filters-btn {
        align-self: auto;
    }
}

/* Improve search button positioning */
.submit-container {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.search-button {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 480px) {
    .submit-container {
        flex-direction: column;
    }

    .search-button,
    .clear-cache-button {
        width: 100%;
    }
}

/* Query text input styles for latest.html */
.query-text-input-container {
    flex: 1; /* 占据最大可能空间 */
    min-width: 200px;
    max-width: none;
}

.query-text-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: var(--card-background);
    color: var(--text-color);
    box-sizing: border-box; /* 确保padding包含在宽度内 */
}

.query-text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.query-text-input::placeholder {
    color: #999;
    font-style: italic;
    opacity: 1; /* Firefox fix */
}

.query-text-input::-webkit-input-placeholder {
    color: #999;
    font-style: italic;
}

.query-text-input::-moz-placeholder {
    color: #999;
    font-style: italic;
    opacity: 1;
}

.query-text-input:-ms-input-placeholder {
    color: #999;
    font-style: italic;
}

/* --- Cursor Pagination Info --- */
.pagination-info {
    font-size: 0.85rem;
    color: var(--dark-gray);
    padding: 6px 14px;
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    align-self: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.pagination-page-info {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
    margin: 0 4px;
    align-self: center;
    min-width: 70px;
    text-align: center;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.pagination-nav-btn {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-nav-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(139, 0, 0, 0.25);
}

.pagination-nav-btn:disabled {
    background-color: var(--light-gray);
    color: #bbb;
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .pagination-info {
        font-size: 0.78rem;
        padding: 4px 10px;
        order: -1;          /* 移动端信息行置顶 */
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 6px;
    }
    .pagination-nav-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
    .pagination-page-info {
        min-width: 54px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .pagination-nav-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 36px;
    }
}

/* Mobile responsive styles for query text input */
@media (max-width: 768px) {
    .query-text-input-container {
        flex: 1; /* 占据最大可能空间 */
        min-width: 0; /* 允许更灵活的收缩 */
        max-width: none;
        width: 100%; /* 确保占据100%宽度 */
    }
    
    .query-text-input {
        font-size: 16px; /* Prevent zoom on iOS Safari */
        padding: 12px 15px;
        min-height: 44px; /* 遵循移动端最小触摸目标尺寸标准 */
    }
}

@media (max-width: 480px) {
    .query-text-input {
        padding: 12px 15px;
        font-size: 16px;
        min-height: 44px; /* 保持最小触摸目标尺寸 */
    }
}

/* --- Search Results Summary Bar --- */
.search-results-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fdf8f0 0%, #fef9f0 100%);
    border: 1px solid var(--accent-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    box-shadow: 0 1px 4px rgba(139, 0, 0, 0.06);
}

.search-results-summary .summary-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.search-results-summary .summary-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

.search-results-summary .summary-approx-hint {
    font-size: 0.8rem;
    color: var(--dark-gray);
    font-style: italic;
}

.search-results-summary .summary-page-hint {
    margin-left: auto;
    font-size: 0.82rem;
    color: var(--dark-gray);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .search-results-summary {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .search-results-summary .summary-page-hint {
        margin-left: 0;
        flex-basis: 100%;
    }
}

/* --- 移动端公告区域优化 --- */
@media (max-width: 768px) {
    .announcement-section {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .announcement-content h2 {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .announcement-content p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .announcement-content li {
        font-size: 13px;
    }

    .last-update-info p {
        font-size: 13px;
    }

    .last-quality-info p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .announcement-section {
        padding: 12px;
    }

    .announcement-content h2 {
        font-size: 15px;
    }

    .announcement-content p,
    .announcement-content li {
        font-size: 13px;
    }
}

/* --- 移动端 search-results-summary 优化 --- */
@media (max-width: 480px) {
    .search-results-summary {
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .search-results-summary .summary-text strong {
        font-size: 0.85rem;
    }

    .search-results-summary .summary-page-hint {
        font-size: 0.75rem;
    }
}

/* ─── Product Card Top Banner ─────────────────────────────────────────────── */

/* wrapper 包裹 img，宽度随图片实际渲染宽度自适应 */
.product-image-wrapper {
    position: absolute;        /* 撑满整个 product-image-container */
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-card-banner {
    /* 作为商品卡片的第一个元素，宽度 = 商品卡片宽度 */
    width: 100%;

    background: rgba(139, 0, 0, 0.85);
    color: #ffffff;
    text-align: center;
    padding: 4px 6px;
    border-radius: 3px 3px 0 0;
    margin-bottom: 6px;

    /* 字号自适应：用 clamp 在移动端到 PC 端平滑缩放 */
    font-size: clamp(10px, 1.8vw, 13px);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;

    /* 单行不换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    z-index: 5;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.product-card-banner:hover {
    background: rgba(139, 0, 0, 0.97);
    color: #ffffff;
    text-decoration: none;
}

/* 移动端强制不截断：缩小字号和内边距确保完整显示 */
@media (max-width: 768px) {
    .product-card-banner {
        font-size: clamp(9px, 2.5vw, 12px);
        padding: 3px 4px;
        letter-spacing: 0;
    }
}

@media (max-width: 480px) {
    .product-card-banner {
        font-size: clamp(8px, 3vw, 11px);
        padding: 2px 3px;
    }
}