/* 基础样式 */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7f8fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #007BFF;
}

a:hover {
    text-decoration: underline;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航 */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 顶部栏使用弹性布局，logo、导航和用户操作区依次排列 */
.header-top {
    display: flex;
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007BFF;
    /* 防止站点名称换行 */
    white-space: nowrap;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav li {
    /* 缩小左右间距以容纳更多导航项 */
    margin: 0 6px;
}

.nav a {
    color: #333;
    font-weight: 500;
    /* 减小内边距，使导航更加紧凑 */
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    /* 防止中文字符自动换行导致文字断开 */
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav a:hover {
    background-color: #f0f0f0;
}


/* 用户操作区域：登录/注册/购物车等，横向排列并靠右 */
.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-left: auto;
    white-space: nowrap;
}

.user-actions a {
    color: #007BFF;
}

/* 后台管理页面使用 .user-info 容器，保持同样样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-left: auto;
    white-space: nowrap;
}

/* 在大屏幕下，用户操作区保持在导航栏右侧 */
@media (min-width: 769px) {
    .user-actions,
    .user-info {
        margin-left: auto;
    }
    /* 取消固定右边距，由 flex 布局自然分配 */
    header .nav ul {
        margin-right: 0;
    }
}

/* Hero 区域 */
.hero {
    background-image: url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    border: none;
}

.btn-primary {
    background-color: #007BFF;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #565e64;
}

/* Sections */
.section {
    padding: 40px 0;
}

.section h2 {
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #333;
}

/* Coupon 卡片 */
.coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.coupon-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    min-width: 260px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.coupon-card h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #007BFF;
}

.coupon-card p {
    margin: 10px 0 20px;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 10px;
}

.card-body p {
    flex-grow: 1;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.card-body .price {
    font-size: 1.1rem;
    color: #d32f2f;
    margin-bottom: 10px;
}

.card-body button {
    align-self: flex-start;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.article-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 账户页面订单卡片样式 */
.order-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
}
.order-card h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #333;
}
.order-card ul {
    padding-left: 20px;
    margin: 5px 0;
}
.order-card ul li {
    list-style: disc;
    font-size: 0.9rem;
    color: #555;
}

.article-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.article-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card-body h3 {
    font-size: 1.1rem;
    margin: 0 0 10px;
    color: #333;
}

.article-card-body p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1;
}

.article-card-body .link-more {
    color: #007BFF;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background-color: #f4f4f4;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-col {
    flex: 1;
    min-width: 220px;
}

.footer h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2rem;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin: 8px 0;
}

.footer ul li a {
    color: #007BFF;
}

.copyright {
    text-align: center;
}

/* 购物车 */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-item .item-info {
    flex: 1;
    margin-left: 15px;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.cart-item p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.cart-item .item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-summary {
    margin-top: 20px;
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 结算页 */
.checkout-summary {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.checkout-item:last-child {
    margin-bottom: 0;
}

.payment-methods label {
    margin-right: 20px;
    font-size: 1rem;
}

/* 登录注册 */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: #007BFF;
}

.auth-tab.active {
    border-color: #007BFF;
}

.auth-form {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #333;
}

.auth-form input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* 团队页面 */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.team-member {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.team-member img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.team-member h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #333;
}

.team-member p {
    font-size: 0.9rem;
    color: #666;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .user-actions {
        margin-top: 10px;
    }
    .hero {
        height: 40vh;
    }
}