/* 安雨AI导购 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

.anyu-ai-app {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ===== 搜索框 ===== */
.anyu-ai-search-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.anyu-ai-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.anyu-ai-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

.anyu-ai-input-wrap {
    display: flex;
    gap: 8px;
    background: #f8fafc;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px;
    transition: border-color 0.2s;
}

.anyu-ai-input-wrap:focus-within {
    border-color: #3b82f6;
    background: #fff;
}

.anyu-ai-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    padding: 10px 12px;
    color: #111827;
}

.anyu-ai-input-wrap button {
    padding: 10px 24px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

.anyu-ai-input-wrap button:hover { opacity: 0.9; }
.anyu-ai-input-wrap button:active { transform: scale(0.96); }

.anyu-ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

.anyu-ai-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: anyu-spin 0.8s linear infinite;
}

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

/* ===== 商品列表 ===== */
.anyu-ai-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.anyu-ai-product-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
}

.anyu-ai-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.anyu-ai-product-img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.anyu-ai-product-info {
    flex: 1;
    margin-left: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.anyu-ai-product-name {
    font-size: 14px;
    color: #111827;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.anyu-ai-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.anyu-ai-price-box {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.anyu-ai-final-price {
    font-size: 20px;
    font-weight: 700;
    color: #ef4444;
}

.anyu-ai-final-price::before {
    content: '¥';
    font-size: 14px;
}

.anyu-ai-original-price {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}

.anyu-ai-coupon-tag {
    display: inline-block;
    background: #fef2f2;
    color: #ef4444;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.anyu-ai-sales {
    font-size: 12px;
    color: #9ca3af;
}

.anyu-ai-buy-btn {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #fff;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s;
}

.anyu-ai-buy-btn:hover { opacity: 0.9; color: #fff; }

.anyu-ai-mall-name {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

/* ===== 分页 ===== */
.anyu-ai-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.anyu-ai-pagination button {
    padding: 8px 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.anyu-ai-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.anyu-ai-page-info {
    font-size: 14px;
    color: #6b7280;
}

/* ===== AI 对话 ===== */
.anyu-ai-chat-container {
    min-height: 400px;
}

.anyu-ai-welcome {
    padding: 40px 20px;
    text-align: center;
}

.anyu-ai-robot-icon {
    width: 80px;
    height: 80px;
    background: #eff6ff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.anyu-ai-welcome-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.anyu-ai-welcome-desc {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 32px;
}

.anyu-ai-examples-title {
    font-size: 13px;
    color: #9ca3af;
    text-align: left;
    margin: 28px 0 12px;
}

.anyu-ai-examples-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anyu-ai-example {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    color: #374151;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}

.anyu-ai-example:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* 聊天视图 */
.anyu-ai-chat-view {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.anyu-ai-msg {
    display: flex;
    gap: 10px;
}

.anyu-ai-msg-user {
    justify-content: flex-end;
}

.anyu-ai-msg-user .bubble {
    background: #3b82f6;
    color: #fff;
    border-radius: 16px 16px 4px 16px;
}

.anyu-ai-msg-ai .bubble {
    background: #f3f4f6;
    color: #111827;
    border-radius: 16px 16px 16px 4px;
}

.anyu-ai-msg .bubble {
    max-width: 80%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
}

.anyu-ai-msg-ai .product-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anyu-ai-msg-ai .product-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.anyu-ai-msg-ai .product-item img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

.anyu-ai-msg-ai .product-item-info {
    flex: 1;
    min-width: 0;
}

.anyu-ai-msg-ai .product-item-title {
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.anyu-ai-msg-ai .product-item-desc {
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
}

.anyu-ai-msg-ai .product-item-btn {
    display: block;
    margin-top: 6px;
    padding: 4px 12px;
    background: #f97316;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    align-self: flex-start;
}

.anyu-ai-input-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 16px;
    border-top: 1px solid #f0f2f5;
}

.anyu-ai-disclaimer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    padding: 12px;
}

/* 空状态 */
.anyu-ai-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.anyu-ai-empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ===== v2.0 新增：排序条 ===== */
.anyu-ai-sort-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.anyu-ai-sort-label {
    font-size: 13px;
    color: #6b7280;
}

.anyu-ai-sort-btn {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.anyu-ai-sort-btn:hover {
    border-color: #3b82f6;
    color: #2563eb;
}

.anyu-ai-sort-btn.is-active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
    font-weight: 600;
}

/* ===== v2.0 新增：省钱 / 返佣标签 ===== */
.anyu-ai-save-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.anyu-ai-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.anyu-ai-commission {
    font-size: 11px;
    color: #059669;
    font-weight: 600;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== v2.0 新增：每日神价榜 ===== */
.anyu-ai-top-block {
    margin-top: 28px;
}

.anyu-ai-top-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.anyu-ai-top-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.anyu-ai-top-desc {
    font-size: 12px;
    color: #9ca3af;
}

.anyu-ai-top-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.anyu-ai-top-app .anyu-ai-top-header {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}

/* ===== v2.0 新增：未配置引导 ===== */
.anyu-ai-setup {
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    margin-top: 8px;
}

.anyu-ai-setup-tip {
    margin-top: 10px;
    font-size: 13px;
}

.anyu-ai-setup-tip a {
    color: #2563eb;
    font-weight: 600;
}
