·* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

[v-cloak] {
    display: none;
}

:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

body {
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 未登录状态按钮间距 */
.logged-out {
    display: flex;
    gap: 10px;
}

/* 发布商品按钮样式 */
#post-item-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

#post-item-btn:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

#post-item-btn i {
    font-size: 0.9rem;
}

/* 用户头像区域 */
.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar span {
    display: inline-block;
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-actions {
    flex: 1;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6c757d;
}

.order-status-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
}

.user-profile span {
    margin-left: 8px;
    font-weight: 500;
}

/* 用户菜单 */
.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    display: none;
    z-index: 1000;
    margin-top: 10px;
}

.user-menu.active {
    display: block;
}

.user-menu-item {
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
    border-bottom: 1px solid #eee;
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item:hover {
    background-color: #f5f7fa;
    color: var(--primary-color);
}

.user-menu-item i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.logout-btn {
    color: #dc3545 !important;
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

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

.btn-accent:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

/* 主要内容区域 */
main {
    padding: 30px 0 60px;
    min-height: 70vh;
}

.section-title {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h2 {
    color: var(--dark-color);
    font-size: 1.8rem;
}

/* 商品展示 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-image {
    height: 180px;
    width: 100%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
}

.product-info {
    padding: 18px;
}

.product-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.product-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 10px;
}

/* 商品详情页面样式 */
.product-detail-container {
    display: none;
}

.product-detail {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--secondary-color);
}

.back-link i {
    margin-right: 8px;
}

.product-detail-images {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-thumbnail.active {
    border-color: var(--primary-color);
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-content {
    padding: 30px;
}

.product-detail-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.product-detail-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.product-detail-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.product-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    flex-wrap: wrap;
}

.product-detail-meta span {
    display: flex;
    align-items: center;
}

.product-detail-meta i {
    margin-right: 5px;
}

.product-detail-category {
    display: inline-block;
    background-color: #e9ecef;
    color: var(--dark-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 5px;
}

.product-detail-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.product-detail-description h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.product-detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.seller-info {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 30px;
}

.seller-info h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.seller-details {
    display: flex;
    align-items: center;
}

.seller-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.5rem;
    margin-right: 15px;
    overflow: hidden;
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.seller-avatar span {
    display: inline-block;
}

.seller-contact {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.seller-contact button {
    margin-right: 10px;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--dark-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 20px;
    overflow-x: hidden;
}

/* 表单样式 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    min-width: 0;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

/* 登录/注册模态框输入框缩短 */
.auth-modal .form-group {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.auth-modal .form-row {
    justify-content: center;
}

.auth-modal .form-row .form-group {
    flex: 0 1 220px;
}

.form-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

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

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

.role-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.role-toggle .btn {
    flex: 1;
}

.form-title {
    text-align: center;
    margin-bottom: 25px;
    color: var(--dark-color);
}

/* 文件上传样式 */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 15px;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.1);
}

.file-upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.file-upload-area p {
    margin-bottom: 10px;
    color: #6c757d;
}

.file-upload-area small {
    color: #adb5bd;
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.file-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.file-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

#file-input {
    display: none;
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 15px 0;
    }

    .nav-links {
        margin: 15px 0;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .user-actions {
        margin-top: 15px;
    }

    .product-detail-images {
        height: 300px;
    }

    .product-detail-actions {
        flex-direction: column;
    }

    .product-detail-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 95vh;
    }

    .product-detail-images {
        height: 200px;
    }

    .auth-modal .form-group {
        max-width: 100%;
    }

    .auth-modal .form-row .form-group {
        flex: 1 1 100%;
    }
}

/* 消息提示 */
.message {
    padding: 12px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.message.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.close-message {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
}

/* 加载动画 */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 111, 165, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 登录提示样式 */
.login-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    text-align: center;
    max-width: 400px;
    width: 90%;
    display: none;
    animation: promptFadeIn 0.3s ease forwards;
}

@keyframes promptFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.login-prompt.active {
    display: block;
}

.login-prompt h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.login-prompt p {
    margin-bottom: 20px;
    color: #666;
}

.success-prompt h3 {
    color: var(--success-color);
}

.prompt-note {
    margin-top: -10px;
    color: #999;
    font-size: 0.9rem;
}

.progress-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 6px;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background-color: var(--success-color);
    transition: width 0.05s linear;
}

.login-prompt-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    animation: fadeIn 0.3s ease;
}

.overlay.active {
    display: block;
}

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

/* 分类页面样式 */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.category-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.category-card p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 使用指南样式 */
.guide-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
}

.guide-section h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.guide-section h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.guide-steps {
    list-style-type: none;
    padding-left: 0;
}

.guide-steps li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
}

.guide-steps li:last-child {
    border-bottom: none;
}

.step-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    margin-right: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

/* 所有商品页面 */
.filter-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
}

.filter-options {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(180px, 220px));
    gap: 15px;
    align-items: center;
}

.filter-options .form-control {
    width: 100% !important;
    min-width: 0;
}

.filter-options .search-box {
    width: 100%;
    min-width: 0;
}

@media (max-width: 768px) {
    .filter-options {
        grid-template-columns: 1fr;
    }
}

.order-filter-section {
    overflow-x: auto;
}

.order-filter-options {
    flex-wrap: nowrap;
    gap: clamp(8px, 2vw, 18px);
}

.order-filter-options > * {
    flex: 1 1 0;
    min-width: 0;
}

.order-filter-options .order-filter-range {
    flex: 1.5 1 0;
}

.search-box {
    flex: 2 1 320px;
    min-width: 240px;
}

/* 返回顶部按钮：与 Dify 机器人同尺寸、垂直对齐，置于机器人上方并留间隔 */
#back-to-top {
    position: fixed;
    /* 与机器人同宽高 56px，右侧对齐 right: 24px，在机器人上方间隔 12px：24 + 56 + 12 = 92 */
    bottom: 92px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(74, 111, 165, 0.4);
}

#back-to-top i {
    font-size: 22px;
    transition: transform 0.3s ease;
}

#back-to-top:hover i {
    transform: translateY(-2px);
}

/* 响应式：保持与机器人垂直对齐及间隔 */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 82px;   /* 20 + 52 + 10 间隔 */
        right: 20px;
        width: 52px;
        height: 52px;
    }
    #back-to-top i {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    #back-to-top {
        bottom: 72px;   /* 16 + 48 + 8 间隔 */
        right: 16px;
        width: 48px;
        height: 48px;
    }
    #back-to-top i {
        font-size: 18px;
    }
}

/* Vue控制登录状态显示 */
.logged-out,
.logged-in {
    display: flex;
}

/* 表格样式 */
.table-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.order-detail-panel {
    margin-top: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.order-filter-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-filter-range .form-control {
    min-width: 0;
    width: 100%;
}

.order-filter-separator {
    color: #6c757d;
    font-size: 0.9rem;
}

.order-product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-product-image {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.order-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-product-image i {
    color: #adb5bd;
    font-size: 1.2rem;
}

.order-product-title {
    font-weight: 600;
}

.order-product-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 4px;
}

.order-detail-modal {
    max-width: 760px;
}

.order-detail-product {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: var(--border-radius);
    background-color: #f8f9fa;
    margin-bottom: 16px;
}

.order-detail-product-image {
    width: 84px;
    height: 84px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    flex-shrink: 0;
}

.order-detail-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-detail-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 6px;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    color: #495057;
    font-size: 0.95rem;
}

.order-image-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.order-image-row img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 消息布局 */
.messages-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.conversation-list {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 10px;
    max-height: 600px;
    overflow-y: auto;
}

.conversation-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.conversation-item.active {
    background-color: rgba(74, 111, 165, 0.1);
}

.conversation-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.conversation-preview {
    color: #6c757d;
    font-size: 0.85rem;
}

.conversation-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.conversation-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 12px;
    background-color: #f1f3f5;
    align-self: flex-start;
}

.message-bubble.from-me {
    background-color: rgba(74, 111, 165, 0.15);
    align-self: flex-end;
}

.message-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.message-text {
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 4px;
    text-align: right;
}

.message-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.message-input textarea {
    flex: 1;
}

.empty-state {
    color: #6c757d;
    text-align: center;
    padding: 40px 0;
}

@media (max-width: 992px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }
}

/* 管理员页面样式 */
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.85rem;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-tab {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.admin-tab.active,
.admin-tab:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.admin-panel {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.admin-products-panel .admin-toolbar {
    gap: 12px;
}

.admin-products-panel .admin-toolbar .form-control {
    flex: 1 1 200px;
    min-width: 180px;
}

.admin-products-table {
    min-width: 980px;
}

.admin-products-table th,
.admin-products-table td {
    white-space: nowrap;
}

.admin-products-table .admin-title-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-products-table .admin-status-cell {
    min-width: 72px;
    text-align: center;
}

.admin-products-table .admin-action-group {
    flex-wrap: nowrap;
    gap: 8px;
}

.admin-products-table .admin-reason-cell {
    width: 140px;
}

.admin-products-table .admin-reason-input {
    min-width: 110px;
    width: 110px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 6px;
}

.admin-inline-input {
    min-width: 160px;
}

.admin-inline-select {
    min-width: 160px;
}

.admin-user-action {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.admin-user-action-select {
    width: 120px;
    min-width: 120px;
}

.admin-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-detail-modal {
    max-width: 760px;
}

.admin-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-detail-reason {
    margin-bottom: 12px;
}

.admin-order-items {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.admin-order-item {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    background-color: white;
    color: #495057;
    font-size: 0.92rem;
}

.admin-detail-panel {
    margin-top: 20px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.admin-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    color: #495057;
    font-size: 0.95rem;
}

.admin-image-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.admin-image-row img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
