/* ========== AI 选品助手 - 全局样式 ========== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    padding-bottom: 80px;
}

/* 顶部导航（与首页一致） */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid #e2e8f0;
}
.nav .logo {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    text-decoration: none;
}
.nav .logo span { color: #3b82f6; }
.nav .links { display: flex; align-items: center; gap: 32px; }
.nav .links a {
    text-decoration: none;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav .links a:hover, .nav .links a.active { color: #0f172a; }
.nav .links .btn {
    padding: 10px 24px;
    background: #0f172a;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.nav .links .btn:hover { background: #3b82f6; }

/* 页脚（与首页一致） */
.footer {
    background: #0f172a;
    color: #fff;
    padding: 60px 40px 40px;
    margin-top: 60px;
}
.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer .brand { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.footer .brand span { color: #60a5fa; }
.footer p { color: #94a3b8; font-size: 14px; line-height: 1.8; }
.footer h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: #e2e8f0; text-transform: uppercase; letter-spacing: 0.05em; }
.footer a { color: #94a3b8; text-decoration: none; font-size: 14px; display: block; margin-bottom: 8px; transition: color 0.2s; }
.footer a:hover { color: #fff; }
.footer .bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
@media (max-width: 768px) {
    .footer .container { grid-template-columns: 1fr; }
    .nav { padding: 12px 20px; }
    .nav .links { gap: 16px; }
    .nav .links a:not(.btn) { display: none; }
}

/* ========== 页面头部 ========== */
.discover-header {
    position: relative;
    background: linear-gradient(135deg, #1a365d 0%, #4a1a8a 50%, #6b46c1 100%);
    color: #fff;
    padding: 60px 24px 40px;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(107, 70, 193, 0.4) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%);
    animation: bgShift 8s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(3deg); }
}

.header-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-30px) scale(1.5); opacity: 0.8; }
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 36px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header-content h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #e0d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 28px;
}

/* 统计数据 */
.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

/* ========== AI 对话区域 ========== */
.chat-section {
    max-width: 800px;
    margin: -30px auto 24px;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.chat-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-bubble {
    background: #f0f2f5;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    font-size: 15px;
    line-height: 1.6;
    max-width: 70%;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
    color: #fff;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #a0aec0;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.chat-input-area {
    display: flex;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    background: #fafbfc;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: #6b46c1;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

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

/* ========== 需求确认条 ========== */
.confirm-section {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 0 16px;
}

.confirm-bar {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease;
}

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

.confirm-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #166534;
}

.confirm-btn {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.confirm-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

/* ========== 产品瀑布流 ========== */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.products-header h2 {
    font-size: 20px;
    color: #1a365d;
}

.products-count {
    font-size: 14px;
    color: #718096;
}

.waterfall {
    columns: 5;
    column-gap: 16px;
}

@media (max-width: 1024px) { .waterfall { columns: 4; } }
@media (max-width: 768px) { .waterfall { columns: 3; } }
@media (max-width: 480px) { .waterfall { columns: 2; } }

.product-card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

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

.card-image {
    position: relative;
    background: #f7fafc;
    background-size: cover;
    background-position: center;
    min-height: 140px;
}

.no-image {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 32px;
}

.card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    transition: all 0.2s;
    opacity: 0;
}

.product-card:hover .card-check,
.card-check.checked {
    opacity: 1;
}

.card-check.checked {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border-color: #16a34a;
    animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.card-info {
    padding: 12px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a365d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: #e53e3e;
}

.card-brand {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: #718096;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #6b46c1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.no-more {
    text-align: center;
    padding: 24px;
    color: #a0aec0;
    font-size: 14px;
}

/* ========== 产品详情弹窗 ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 24px;
}

.detail-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.detail-image {
    width: 200px;
    height: 150px;
    border-radius: 12px;
    background: #f7fafc;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-large {
    color: #a0aec0;
    font-size: 16px;
}

.detail-title h2 {
    font-size: 20px;
    color: #1a365d;
    margin-bottom: 8px;
}

.detail-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.detail-meta .tag {
    background: #ebf4ff;
    color: #3182ce;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.detail-price {
    font-size: 24px;
    font-weight: 700;
    color: #e53e3e;
}

.detail-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    font-size: 15px;
    color: #4a5568;
    margin-bottom: 10px;
}

.detail-section p {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
}

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

.detail-section li {
    font-size: 14px;
    color: #4a5568;
    padding: 4px 0;
}

.detail-section li::before {
    content: "• ";
    color: #6b46c1;
    font-weight: bold;
}

.detail-supplement {
    background: #f7fafc;
    padding: 16px;
    border-radius: 10px;
}

.detail-supplier {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #fbbf24;
}

.supplier-locked {
    text-align: center;
    color: #92400e;
}

.supplier-locked p {
    margin-bottom: 12px;
}

.btn-upgrade {
    display: inline-block;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-show-supplier {
    background: #fff;
    border: 1px solid #d97706;
    color: #d97706;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.detail-actions {
    margin-top: 20px;
}

.btn-add-cart {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart {
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
    color: #fff;
}

.btn-add-cart:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.btn-add-cart.added {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

/* ========== 底部浮动栏 ========== */
.floating-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
    animation: slideUp 0.3s ease;
}

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

.floating-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.floating-icon {
    font-size: 20px;
}

.floating-actions {
    display: flex;
    gap: 12px;
}

.btn-clear {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #718096;
    font-size: 14px;
    cursor: pointer;
}

.btn-preview {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-preview:hover {
    transform: scale(1.05);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .discover-header { padding: 40px 16px 30px; }
    .header-content h1 { font-size: 24px; }
    .stats-row { padding: 16px 24px; gap: 20px; }
    .stat-number { font-size: 24px; }
    .detail-header { flex-direction: column; }
    .detail-image { width: 100%; height: 200px; }
}

/* ========== 未登录遮罩 ========== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.login-overlay-content {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: slideUp 0.4s ease;
}

.login-overlay-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-overlay-content h2 {
    font-size: 24px;
    color: #1a365d;
    margin-bottom: 12px;
}

.login-overlay-content p {
    color: #718096;
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.login-overlay-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.btn-login, .btn-register {
    padding: 12px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-login {
    background: linear-gradient(135deg, #4a1a8a, #6b46c1);
    color: #fff;
}

.btn-login:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.btn-register {
    background: #fff;
    color: #6b46c1;
    border: 2px solid #6b46c1;
}

.btn-register:hover {
    background: #f5f0ff;
}

.login-overlay-hint {
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 0;
}
