/**
 * 极简购物网站 - 清新绿色系样式
 * 配色方案：
 * - 主题色：#059669（薄荷绿）
 * - 价格高亮：#dc2626（温暖红）
 * - 页面背景：#f0fdf7（浅绿白）
 * - 卡片背景：#ffffff（纯白）
 * - 文字深色：#1f2937（深灰）
 * - 文字浅色：#6b7280（中灰）
 * - 辅助色：#10b981（翠绿）
 */

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(180deg, #f0fdf7 0%, #dcfce7 100%);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf7 100%);
    padding: 1rem 2.5rem;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.08), 0 1px 2px rgba(5, 150, 105, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(5, 150, 105, 0.1);
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #047857;
    transform: scale(1.02);
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
}

.navbar-nav a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav a:hover {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.navbar-nav a.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

/* ========== 页面容器 ========== */
.container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* ========== 页面标题 ========== */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 1rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* ========== 商品卡片网格 ========== */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

/* ========== 商品卡片 ========== */
.goods-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(5, 150, 105, 0.08);
}

.goods-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(5, 150, 105, 0.15), 0 8px 16px rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.2);
}

.goods-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0fdf7 0%, #dcfce7 100%);
    transition: transform 0.3s ease;
}

.goods-card:hover .goods-card-img {
    transform: scale(1.05);
}

.goods-card-body {
    padding: 1.5rem;
}

.goods-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.goods-card-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.goods-card-price::before {
    content: '¥';
    font-size: 1.1rem;
    margin-right: 2px;
    font-weight: 600;
}

.goods-card-desc {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
    font-weight: 400;
}

/* ========== 暂无商品提示 ========== */
.no-goods {
    text-align: center;
    padding: 5rem 3rem;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.1);
}

.no-goods-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.no-goods-text {
    font-size: 1.2rem;
    color: #6b7280;
    font-weight: 500;
}

/* ========== 表单容器（外层白色大卡片，对齐商品详情弹窗卡片视觉）========== */
.form-container {
    max-width: 600px;                 /* 大屏最大宽度居中，不铺满屏幕 */
    margin: 0 auto;
    background: #ffffff;              /* 卡片纯白底色 */
    padding: 2.5rem;                  /* 上下左右统一内边距 */
    border-radius: 16px;              /* 圆角统一16px，与详情弹窗卡片视觉语言一致 */
    /* 绿色调柔和阴影（低透明度），呼应详情弹窗卡片的悬浮层次感 */
    box-shadow: 0 20px 45px rgba(5, 150, 105, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(5, 150, 105, 0.08);
}

/* 表单分组：统一间距 + 浅绿分隔线(#d1fae5)区分模块，呼应详情弹窗分割线 */
.form-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #d1fae5;
}

/* 最后一个分组（提交按钮区）去除分隔线与多余留白 */
.form-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    letter-spacing: -0.2px;
}

.form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #ffffff;
    color: #1f2937;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    background: #ffffff;
}

.form-input:hover,
.form-textarea:hover {
    border-color: #d1d5db;
}

/* 占位文字：浅灰色 #6b7280，对齐详情页次要文字色规范 */
.form-input::placeholder,
.form-textarea::placeholder {
    color: #6b7280;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-input.error,
.form-textarea.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.625rem;
    display: none;
    font-weight: 500;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    width: 100%;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #047857 0%, #0d9e73 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== 提示消息 ========== */
.toast {
    position: fixed;
    top: 100px;
    right: 24px;
    padding: 1.125rem 1.75rem;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
    backdrop-filter: blur(10px);
}

.toast.success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
    font-size: 0.9rem;
    background: linear-gradient(180deg, #f0fdf7 0%, #dcfce7 100%);
    border-top: 1px solid rgba(5, 150, 105, 0.1);
    margin-top: 4rem;
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
        margin: 2rem auto;
    }

    .navbar {
        padding: 0.875rem 1.5rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-nav a {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .goods-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .goods-card {
        border-radius: 14px;
    }

    .goods-card-img {
        height: 200px;
    }

    .form-container {
        padding: 2rem;
        border-radius: 16px;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .navbar-content {
        flex-direction: column;
        gap: 1rem;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.125rem;
    }

    .navbar-nav {
        gap: 0.25rem;
        width: 100%;
        justify-content: center;
    }

    .navbar-nav a {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .goods-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .goods-card {
        border-radius: 12px;
    }

    .goods-card-img {
        height: 180px;
    }

    .goods-card-body {
        padding: 1.25rem;
    }

    .goods-card-title {
        font-size: 1.05rem;
    }

    .goods-card-price {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .form-container {
        padding: 1.5rem;
        border-radius: 14px;
        /* 移动端柔和阴影，避免过重 */
        box-shadow: 0 12px 28px rgba(5, 150, 105, 0.10), 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    .form-group {
        margin-bottom: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .form-input,
    .form-textarea {
        padding: 0.75rem 1rem;
        border-radius: 10px;
    }

    .btn {
        padding: 0.75rem 1.5rem;
    }

    .toast {
        top: 80px;
        right: 12px;
        left: 12px;
        padding: 1rem 1.25rem;
        font-size: 0.875rem;
    }

    .footer {
        padding: 2rem 1rem;
        margin-top: 3rem;
        font-size: 0.85rem;
    }

    .no-goods {
        padding: 3rem 2rem;
        border-radius: 16px;
    }

    .no-goods-icon {
        font-size: 4rem;
    }

    .no-goods-text {
        font-size: 1rem;
    }
}

/* 大屏幕优化 */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .goods-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* 超大屏幕 */
@media (min-width: 1600px) {
    .goods-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 添加平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选中文字颜色 */
::selection {
    background: rgba(5, 150, 105, 0.2);
    color: #059669;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f0fdf7;
}

::-webkit-scrollbar-thumb {
    background: #059669;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #047857;
}

/* ========== 商品详情弹窗 ========== */

/* 全屏遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

/* 弹窗容器 */
.modal-container {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 关闭按钮 */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #6b7280;
    transition: all 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    transform: rotate(90deg);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 弹窗内容 - 左右双栏布局 */
.modal-content {
    display: flex;
    flex-direction: row;
    border-radius: 20px;
    overflow: hidden;
}

/* 左侧：商品图片区域 */
.modal-left {
    flex: 0 0 400px;
    background: linear-gradient(135deg, #f0fdf7 0%, #dcfce7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* 商品图片容器 */
.modal-image-wrapper {
    width: 100%;
    height: 100%;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
}

/* 商品图片 */
.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* 右侧：商品信息 + 下单操作 */
.modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* 商品信息区域 */
.modal-info {
    padding: 2.5rem 2rem 2rem;
    flex: 1;
    overflow-y: auto;
}

/* 商品名称 */
.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

/* 商品价格 - 清新绿主题，价格红色高亮 */
.modal-price {
    font-size: 2rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.modal-price::before {
    content: '¥';
    font-size: 1.25rem;
    margin-right: 2px;
    font-weight: 700;
}

/* 商品简介区域 */
.modal-desc {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-desc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.modal-desc-text {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 分割线 - 清新绿浅色 */
.modal-divider {
    height: 1px;
    background: linear-gradient(90deg, #d1fae5 0%, #d1fae5 100%);
    margin: 1.5rem 0;
}

/* 下单操作区域 */
.modal-order {
    padding-top: 0.5rem;
}

/* ========== 数量选择器 ========== */
.quantity-selector {
    margin-bottom: 2rem;
}

.quantity-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

/* 数量按钮 - 清新绿主题 */
.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #059669;
    background: #ffffff;
    color: #059669;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #059669;
    color: #ffffff;
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn span {
    line-height: 1;
}

/* 数量输入框 */
.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid #d1fae5;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ========== 操作按钮 ========== */
.action-buttons {
    display: flex;
    gap: 1rem;
}

/* 按钮基础样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: -0.2px;
    flex: 1;
}

/* 立即下单按钮 - 清新绿主题 */
.btn-order {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #047857 0%, #0d9e73 100%);
}

.btn-order:active {
    transform: translateY(0);
}

/* 加入购物车按钮 - 白底绿边 */
.btn-cart {
    background: #ffffff;
    color: #059669;
    border: 2px solid #059669;
}

.btn-cart:hover {
    background: #f0fdf7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.btn-cart:active {
    transform: translateY(0);
}

/* 弹窗显示状态 */
.modal-overlay.show {
    display: flex;
}

/* 弹窗关闭动画 */
.modal-overlay.closing {
    animation: fadeOut 0.25s ease;
}

.modal-overlay.closing .modal-container {
    animation: scaleOut 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 弹窗打开动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

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

/* 禁止页面滚动 */
body.modal-open {
    overflow: hidden;
}

/* ========== 弹窗响应式 ========== */

/* 平板设备（768px以下）改为上下流式布局 */
@media (max-width: 768px) {
    .modal-container {
        max-width: 100%;
        border-radius: 16px;
    }

    /* 弹窗内容改为上下布局 */
    .modal-content {
        flex-direction: column;
    }

    /* 左侧图片区域 */
    .modal-left {
        flex: none;
        width: 100%;
        padding: 1.5rem;
    }

    .modal-image-wrapper {
        max-height: 350px;
    }

    /* 右侧信息区域 */
    .modal-right {
        flex: none;
    }

    .modal-info {
        padding: 2rem 1.5rem 1.5rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
        top: 1rem;
        right: 1rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-price {
        font-size: 1.75rem;
    }

    .modal-desc-text {
        font-size: 0.95rem;
    }

    /* 数量选择器和按钮 */
    .quantity-controls {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }
}

/* 手机设备（480px以下）优化 */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-container {
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .modal-overlay.closing .modal-container {
        animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.125rem;
        top: 1rem;
        right: 1rem;
    }

    /* 左侧图片区域 */
    .modal-left {
        padding: 1rem;
    }

    .modal-image-wrapper {
        max-height: 280px;
        border-radius: 12px;
    }

    /* 右侧信息区域 */
    .modal-info {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .modal-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .modal-price {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .modal-desc {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .modal-desc-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .modal-desc-text {
        font-size: 0.875rem;
        line-height: 1.6;
    }

    .modal-divider {
        margin: 1rem 0;
    }

    /* 数量选择器 */
    .quantity-label {
        font-size: 0.9rem;
    }

    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }

    .quantity-input {
        width: 50px;
        height: 36px;
        font-size: 0.95rem;
    }

    /* 操作按钮通栏铺满 */
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
}

/* 手机端弹窗动画 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* ================================================================== */
/* ========== 新增：导航栏购物车按钮 + 下拉悬浮面板（清新绿主题） ========== */
/* ================================================================== */

/* 购物车按钮容器：用于作为下拉面板的定位参照（position: relative） */
.cart-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* 购物车图标按钮 —— 沿用导航链接样式风格 */
.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* 悬停加深为主题绿，背景浅绿 */
.cart-btn:hover {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.cart-btn-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* 购物车数量角标（红色，右上角） */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 角标数值变化时的弹跳反馈动画 */
.cart-badge.bounce {
    animation: badgeBounce 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgeBounce {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

/* 购物车下拉悬浮面板 —— 固定出现在购物车按钮下方 */
.cart-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;                 /* 右对齐购物车按钮（桌面端） */
    width: 380px;
    max-width: calc(100vw - 32px); /* 防止超出屏幕宽度 */
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(5, 150, 105, 0.18), 0 8px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.1);
    /* 层级：低于商品详情弹窗(1000)，高于普通页面内容 */
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 默认隐藏 + 淡入动画准备 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

/* 面板显示状态：淡入 + 向下滑入 */
.cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 面板顶部：标题 + 清空按钮 */
.cart-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #d1fae5;
}

.cart-dropdown-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

/* 清空购物车按钮（浅绿边框样式） */
.cart-clear-btn {
    background: #ffffff;
    color: #059669;
    border: 1px solid #d1fae5;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.cart-clear-btn:hover {
    background: #f0fdf7;
    border-color: #059669;
    color: #047857;
}

/* 商品列表区域（可垂直滚动） */
.cart-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
}

/* 单条购物车商品项 */
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    border-radius: 10px;
    transition: background 0.3s ease;
    /* 新增条目淡入动画 */
    animation: cartItemFadeIn 0.3s ease;
}

@keyframes cartItemFadeIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    background: #f0fdf7;
}

/* 商品缩略小图 */
.cart-item-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f0fdf7 0%, #dcfce7 100%);
    border: 1px solid rgba(5, 150, 105, 0.1);
}

/* 商品信息：名称 + 单价 */
.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 商品名称（超出省略） */
.cart-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 单价（红色高亮） */
.cart-item-price {
    font-size: 0.8rem;
    color: #dc2626;
    font-weight: 600;
}

/* 数量加减器 */
.cart-item-quantity {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #d1fae5;
    background: #ffffff;
    color: #059669;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1;
}

.cart-qty-minus {
    border-radius: 6px 0 0 6px;
}

.cart-qty-plus {
    border-radius: 0 6px 6px 0;
}

.cart-qty-btn:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}

.cart-qty-num {
    width: 30px;
    height: 24px;
    border-top: 1px solid #d1fae5;
    border-bottom: 1px solid #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
}

/* 小计金额（主题绿色加粗） */
.cart-item-subtotal {
    flex-shrink: 0;
    width: 58px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 700;
    color: #059669;
}

/* 删除单个商品按钮 */
.cart-item-remove {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart-item-remove:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* 空购物车居中提示 */
.cart-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    display: none;
}

.cart-empty.show {
    display: block;
    animation: cartItemFadeIn 0.3s ease;
}

.cart-empty-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.cart-empty-text {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 底部结算区域（浅绿背景） */
.cart-footer {
    background: linear-gradient(135deg, #f0fdf7 0%, #ecfdf5 100%);
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #d1fae5;
}

/* 购物车为空时隐藏结算区 */
.cart-footer.hide {
    display: none;
}

.cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.625rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.cart-summary-count em {
    color: #1f2937;
    font-weight: 700;
    font-style: normal;
}

/* 合计总价（红色高亮） */
.cart-summary-price em {
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: 800;
    font-style: normal;
}

/* 去结算主按钮（主题绿色） */
.cart-checkout-btn {
    width: 100%;
    padding: 0.7rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #047857 0%, #0d9e73 100%);
}

.cart-checkout-btn:active {
    transform: translateY(0);
}

.cart-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 购物车列表自定义滚动条 */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #d1fae5;
    border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ========== 购物车移动端自适应（≤480px） ========== */
@media (max-width: 480px) {
    /* 面板在移动端由JS水平居中，防止超出屏幕 */
    .cart-dropdown {
        width: calc(100vw - 2rem);
        max-width: 340px;
    }

    /* 单条商品项在窄屏下紧凑显示 */
    .cart-item {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .cart-item-img {
        width: 46px;
        height: 46px;
    }

    /* 隐藏单价文字，节省横向空间（小计已体现价格） */
    .cart-item-price {
        display: none;
    }

    .cart-item-subtotal {
        width: 52px;
    }
}

