html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}



/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 顶部条样式 */
.top-bar {
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    padding: 0.5rem 1rem;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

    .user-dropdown-toggle:hover {
        background-color: #f5f5f5;
    }

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 50%;
}

.user-name {
    font-weight: 500;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    margin-top: 0.5rem;
    display: none;
}

/* 使用JavaScript或改用:focus-within来控制显示 */
.user-dropdown:hover .user-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

    .dropdown-item:hover {
        background-color: #f5f5f5;
    }

.logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.auth-links {
    display: flex;
    gap: 1rem;
}

.auth-link {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

    .auth-link:hover {
        color: #0056b3;
        text-decoration: underline;
    }

/* 主导航栏样式 */
.main-header {
    background-color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

    .logo img {
        height: 40px;
        margin-right: 10px;
    }

.logo-text {
    display: flex;
    flex-direction: column;
}

    .logo-text span:first-child {
        font-size: 20px;
        font-weight: bold;
        color: #ff6a00;
    }

    .logo-text span:last-child {
        font-size: 12px;
        color: #999;
        margin-top: 3px;
    }

.search-box {
    display: flex;
    width: 500px;
    margin: 0 30px;
}

    .search-box input {
        width: 100%;
        padding: 12px 15px;
        border: 2px solid #ff6a00;
        border-radius: 4px 0 0 4px;
        outline: none;
        font-size: 14px;
    }

    .search-box a {
        background-color: #ff6a00;
        color: white;
        border: none;
        padding: 0 20px;
        border-radius: 0 4px 4px 0;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.3s;
    }

        .search-box a:hover {
            background-color: #e65d00;
        }

.cart {
    display: flex;
    align-items: center;
    position: relative;
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    transition: background-color 0.3s;
    border-radius: 4px;
}

    .cart:hover {
        background-color: #fff5f0;
        color: #ff6a00;
    }

.cart-icon {
    font-size: 22px;
    margin-right: 5px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff6a00;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* 分类导航样式 */
.category-nav {
    background-color: #ff6a00;
    padding: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .nav-menu li {
        padding: 12px 20px;
        position: relative;
    }

        .nav-menu li a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            font-size: 15px;
        }

        .nav-menu li:hover {
            background-color: #e65d00;
        }

        .nav-menu li.active {
            background-color: #d95400;
        }


/* 底部样式优化 */
.footer {
    background-color: #f8f8f8;
    padding: 40px 0 20px;
    font-size: 13px;
    color: #666;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.footer-column {
    flex: 1;
    min-width: 160px;
    padding: 0 15px;
    margin-bottom: 20px;
}

    .footer-column h4 {
        font-size: 14px;
        color: #333;
        margin-bottom: 15px;
        font-weight: bold;
        position: relative;
        padding-bottom: 8px;
    }

        .footer-column h4:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 30px;
            height: 2px;
            background-color: #ff6a00;
        }

    .footer-column ul {
        list-style: none;
        padding: 0;
    }

        .footer-column ul li {
            margin-bottom: 8px;
            line-height: 1.5;
        }

            .footer-column ul li a {
                color: #666;
                text-decoration: none;
                transition: color 0.3s;
            }

                .footer-column ul li a:hover {
                    color: #ff6a00;
                    padding-left: 3px;
                }

.qr-code {
    width: 90px;
    height: 90px;
    background-color: #fff;
    padding: 5px;
    border: 1px solid #e0e0e0;
}

    .qr-code img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
    color: #999;
}

.copyright a {
    color: #ff6a00;
    text-decoration: none;
    margin: 0 3px;
}

.powered-by {
    margin-top: 8px;
    color: #ccc;
}

/* 用户下拉菜单样式 */
.user-icon {
    margin-right: 8px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    color: #333;
}

    .dropdown-item:hover {
        background-color: #f1f1f1;
    }
