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

/* 举报按钮样式 */
.report-button {
    position: relative;
    float: right;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-right: 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.8;
}

.report-button:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
    opacity: 1;
}

.report-button:active {
    transform: translateY(0);
}

/* 举报模态框内容样式 */
.report-modal-content {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* 举报模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 举报模态框标题 */
.report-modal-content h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* 举报模态框表单组 */
.report-form-group {
    margin-bottom: 20px;
}

/* 举报模态框标签 */
.report-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

/* 举报模态框文本域 */
#report-content {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#report-content:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 举报模态框按钮组 */
.report-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* 举报模态框按钮 */
.report-modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 举报模态框提交按钮 */
#submit-report-btn {
    background-color: #1890ff;
    color: white;
}

#submit-report-btn:hover {
    background-color: #40a9ff;
    transform: translateY(-1px);
}

/* 举报模态框取消按钮 */
#cancel-report-btn {
    background-color: #f0f0f0;
    color: #333;
}

#cancel-report-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

/* 举报模态框关闭按钮 */
#close-report-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    margin: 0;
    line-height: 1;
    z-index: 2100;
}

#close-report-modal:hover {
    color: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

/* Logo样式 */
.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1890ff;
    margin: 0;
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 用户名和登录按钮的基本样式 */
.nav-links .nav-link {
    transition: all 0.3s ease;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 16px;
    outline: none;
}

.nav-link:hover {
    color: #1890ff;
    background-color: #f0f7ff;
}

.nav-link.active {
    color: #1890ff;
    font-weight: 500;
    background-color: #e6f7ff;
}

.nav-link:active {
    transform: none;
    box-shadow: none;
}

/* 登录按钮特殊样式 */
.login-btn {
    background-color: #1890ff;
    color: white !important;
    transition: background-color 0.3s ease;
    outline: none;
}

.login-btn:hover {
    background-color: #badaf5;
    color: white !important;
}

/* 登录按钮不需要active状态样式 */
.login-btn:active {
    transform: none;
    box-shadow: none;
}

/* 用户名样式 */
.user-name {
    font-weight: 500;
}

/* 登录/注册模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* 提问详情对话框样式 */
/* 用户信息部分已移除，相关样式已删除 */

.question-info-section h4 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #222;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
}

.question-info-section #detail-content {
    line-height: 1.7;
    color: #555;
    word-break: break-word;
    font-size: 15px;
    background-color: #fafafa;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

/* 模态框样式增强 */
.modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 550px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-header {
    padding: 22px 24px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #222;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    color: #666;
    line-height: 1.5;
}

/* 关闭按钮样式 */
.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #555;
}

.auth-modal {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
    overflow: hidden;
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* 密码输入框容器样式 */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 48px; /* 为眼睛图标留出空间 */
}

/* 密码可见性切换按钮样式 */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.password-toggle:hover {
    background-color: #f5f5f5;
}

/* 密码图标样式 */
.password-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group input::placeholder {
    color: #bfbfbf;
}

.submit-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.submit-btn:hover:not(:disabled) {
    background-color: #40a9ff;
}

.submit-btn:disabled {
    background-color: #d9d9d9;
    cursor: not-allowed;
}

.modal-footer {
    padding: 16px 24px 24px;
    text-align: center;
    border-top: 1px solid #e8e8e8;
}

.modal-footer p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.toggle-mode {
    color: #1890ff;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
}

.toggle-mode:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: row;
        height: auto;
        padding: 10px;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo h1 {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    .nav-links {
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 10px;
    }
    
    .nav-links a,
    .nav-link {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    /* 响应式模态框 */
    .auth-modal {
        width: 90%;
        max-width: 400px;
        margin: 20px 0;
        left: 50%; /* 明确设置左定位 */
        transform: translateX(-50%) translateY(-50%); /* 分离X和Y轴的变换 */
        right: auto; /* 确保右定位不会覆盖左定位 */
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
    
    .form-group input {
        font-size: 14px;
    }
}

/* 主内容区域样式 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 20px; /* 增加顶部padding避开固定导航栏 */
}

/* 响应式调整 - 小屏幕下调整主内容区域顶部padding，确保选项卡不被导航栏遮住 */
@media (max-width: 768px) {
    .main-content {
        padding-top: 80px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* 小屏幕设备进一步减少内边距 */
@media (max-width: 480px) {
    .main-content {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* 选项卡容器样式 */
.tabs-container {
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.tabs {
    display: flex;
    justify-content: center; /* 让选项卡居中显示 */
    gap: 40px;
}

.tab-item {
    padding: 15px 0;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: #333;
}

.tab-item.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* 选项卡内容区域样式 */
.tab-content-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 10px;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.search-button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: #357ab7;
}

.search-button:active {
    transform: translateY(1px);
}

/* 热门评价列表样式 */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.review-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

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

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

.avatar {
    width: 40px;
    height: 40px;
    background-color: #e9ecef;
    color: #000000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-placeholder {
    color: white;
    font-weight: 600;
    font-size: 16px;
}

/* 透明背景类 */
.transparent-bg {
    background-color: transparent !important;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    color: #333;
}

.date {
    font-size: 14px;
    color: #999;
}

.rating {
    font-size: 16px;
}

.stars {
    color: #ffd700;
}

.review-content {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

.review-meta {
    display: flex;
    gap: 30px;
    font-size: 14px;
    color: #999;
}

/* 需求提问列表样式 */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-item {
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.question-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.question-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 15px;
}

.question-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.question-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    white-space: normal;
}

.question-product-name {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    border: 4px solid rgba(24, 144, 255, 0.1);
    border-left-color: #1890ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-container p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* 错误提示样式 */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-container p {
    color: #ff4d4f;
    font-size: 16px;
    margin-bottom: 16px;
}

.retry-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background-color: #40a9ff;
}

/* 空数据状态样式 */
.empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-container p {
    color: #999;
    font-size: 16px;
    margin: 0;
}

/* 登录提示样式 */
.empty-container .login-prompt {
    color: #1890ff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.empty-container .login-prompt:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 评论卡片样式 */
.review-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    padding: 4px;
    margin: 0 auto;
    max-width: 1200px;
}

.review-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: calc(20% - 6px); /* 5 cards per row */
    min-width: 180px;
    max-width: 250px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: auto;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

/* 卡片封面样式 */
.review-card-cover {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.review-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.review-card-placeholder {
    font-size: 32px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #fafafa;
}

/* 卡片内容样式 */
.review-card-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.review-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -moz-box;
    -moz-line-clamp: 2;
    -moz-box-orient: vertical;
    line-clamp: 2;
    line-height: 1.4;
    flex: 1;
    /* 通过限制宽度和行数以实现最多显示约25个中文字符 */
    max-height: 3.6em; /* 2行 * 1.4行高 * 1.3缩放 */
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 卡片底部信息样式 */
.review-card-footer {
    margin-top: auto;
}

.review-card-user {
    display: flex;
    align-items: center;
}

.review-card-user span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-product-name {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .review-card {
        width: calc(25% - 10px); /* 4 cards per row */
    }
}

@media (max-width: 992px) {
    .review-card {
        width: calc(33.33% - 8px); /* 3 cards per row */
    }
}

@media (max-width: 768px) {
    .review-card {
        width: calc(50% - 3px); /* 2 cards per row */
        min-width: auto;
        max-width: none;
    }
    
    .review-cards-container {
        gap: 6px;
        padding: 4px;
    }
    
    .review-card-cover {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .review-card {
        width: calc(50% - 3px); /* 2 cards per row */
    }
    
    .review-card-cover {
        height: 100px;
    }
    
    .review-card-content {
        padding: 6px;
    }
    
    .review-card-title {
        font-size: 12px;
    }
    
    .review-cards-container {
        gap: 6px;
        padding: 4px;
    }
}

/* 超小屏幕设备，如某些特殊手机 */
@media (max-width: 320px) {
    .review-card {
        width: 100%; /* 1 card per row */
    }
    
    .review-card-cover {
        height: 110px;
    }
}