/* ================= 基础重置与奢华变量 ================= */
:root {
    --lux-bg: #fcfbf9;
    --lux-surface: #ffffff;
    --lux-text: #1a1a1a;
    --lux-text-muted: #7a7570;
    --lux-accent: #a89f91;
    --lux-accent-hover: #8c8275;
    --lux-border: #e8e4df;
    --lux-font-serif: 'Cormorant Garamond', 'Times New Roman', serif;
    --lux-font-sans: 'Inter', 'Helvetica Neue', sans-serif;
    --transition-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --error-color: #c25c5c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--lux-bg);
    color: var(--lux-text);
    font-family: var(--lux-font-sans);
    font-weight: 300;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; position: relative; transition: color 0.3s var(--transition-ease); }
a::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px;
    background: var(--lux-accent); transition: width 0.4s var(--transition-ease);
}
a:hover { color: var(--lux-accent); }
a:hover::after { width: 100%; }
ul, ol { list-style: none; }
.container { width: 1320px; max-width: 95%; margin: 0 auto; position: relative; }

/* 自定义滚动条 (AI聊天区) */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--lux-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--lux-accent); }

/* ================= 顶部极简报 ================= */
.top-bar {
    background: transparent; border-bottom: 1px solid var(--lux-border);
    height: 44px; line-height: 44px; font-size: 11px; letter-spacing: 0.5px; color: var(--lux-text-muted);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-menu a { color: var(--lux-text-muted); margin: 0 12px; font-weight: 400; }
.top-menu a:hover { color: var(--lux-text); }

.user-menu { display: flex; align-items: center; margin: 0; padding: 0; }
.user-menu > li { display: flex; align-items: center; }

.top-bar .userinfo { 
    position: relative; cursor: pointer; padding: 0 12px; 
    display: flex; align-items: center; height: 100%;
    border-right: 1px solid var(--lux-border); margin-right: 12px;
}
.top-bar .userinfo > a { color: var(--lux-text-muted); font-weight: 400; }
.top-bar .userinfo > a:hover { color: var(--lux-text); }

.top-bar .userinfo .i {
    display: inline-block; width: 0; height: 0; margin-left: 6px;
    border: 4px solid transparent; border-top-color: var(--lux-text-muted); transition: transform 0.3s var(--transition-ease);
}
.top-bar .userinfo:hover .i { transform: rotate(180deg); border-top-color: var(--lux-text); }

.top-bar .dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--lux-surface); border: 1px solid var(--lux-border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06); padding: 6px 0; min-width: 140px; z-index: 1000; border-radius: 2px;
}
.top-bar .userinfo:hover .dropdown-menu { display: block; animation: fadeDown 0.25s var(--transition-ease); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.top-bar .dropdown-menu li a { 
    display: block; padding: 8px 20px; color: var(--lux-text); margin: 0; font-size: 12px; text-align: center; 
}
.top-bar .dropdown-menu li a:hover { background: var(--lux-bg); color: var(--lux-accent); }
.top-bar .dropdown-menu li a::after { display: none; }

.top-bar .cart-btn {
    background: transparent !important; border: 1px solid var(--lux-border);
    color: var(--lux-text) !important; padding: 0 16px; display: flex; align-items: center;
    justify-content: center; height: 30px; margin: 0 !important; border-radius: 2px;
    text-transform: uppercase; font-size: 10px; letter-spacing: 1px; transition: all 0.3s var(--transition-ease);
}
.top-bar .cart-btn:hover { border-color: var(--lux-accent); background: var(--lux-accent) !important; color: #fff !important; }

/* ================= 核心改进：Panda Smart AI 醒目按钮 ================= */
#topPandaAiLink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff !important;
    border-radius: 10px;
    font-weight: 300;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    text-decoration: none !important;
    margin-left: 10px;
    animation: pulse-ai 2s infinite;
}

#topPandaAiLink::after { display: none; }
#topPandaAiLink:hover { color: #fff !important; transform: scale(1.05); box-shadow: 0 6px 16px rgba(79, 172, 254, 0.5); }

@keyframes pulse-ai {
    0% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(79, 172, 254, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); }
}

#topPandaAiLink::before {
    content: '✨ 点击体验 AI 智能助手';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, bottom 0.3s;
    z-index: 1000;
    font-weight: 400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#topPandaAiLink:hover::before {
    opacity: 1;
    bottom: -45px;
}

/* ================= 主导航栏 ================= */
.main-header { background: var(--lux-bg); height: 88px; transition: background 0.3s; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo {
    font-family: var(--lux-font-serif); font-size: 32px; font-weight: 600; letter-spacing: 2px;
    color: var(--lux-text); margin-right: 40px;
}
.logo::after { display: none; }
.nav-list { display: flex; gap: 36px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 400; flex: 1; justify-content: center; }
.nav-list a::after { bottom: -4px; }
.search-box {
    width: 220px; height: 40px; border-bottom: 1px solid var(--lux-border);
    display: flex; align-items: center; transition: border-color 0.3s; position: relative;
}
.search-box input {
    border: none; outline: none; flex: 1; height: 100%; background: transparent;
    padding: 0 10px; font-size: 13px; color: var(--lux-text); font-family: inherit;
}
.search-box input::placeholder { color: var(--lux-text-muted); }
.search-box button {
    width: 40px; height: 100%; border: none; background: transparent;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--lux-text-muted); font-size: 18px; transition: color 0.3s;
}
.search-box:hover { border-color: var(--lux-accent); }
.search-box:hover button { color: var(--lux-accent); }

/* ================= 核心区域 ================= */
.hero-section { margin-top: 24px; position: relative; height: 580px; background: var(--lux-surface); }
.side-menu {
    position: absolute; left: 0; top: 0; width: 220px; height: 100%;
    background: rgba(255,255,255,0.75); backdrop-filter: blur(12px);
    border-right: 1px solid var(--lux-border); z-index: 10; padding: 40px 0;
}
.side-menu li {
    height: 48px; line-height: 48px; padding: 0 28px; color: var(--lux-text);
    font-size: 14px; font-family: var(--lux-font-serif); letter-spacing: 0.5px;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid transparent; transition: all 0.3s var(--transition-ease);
}
.side-menu li:hover { background: var(--lux-bg); border-bottom-color: var(--lux-border); padding-left: 34px; }
.side-menu a { color: var(--lux-text); width: 100%; display: block; }
.side-menu a::after { display: none; }
.banner-wrapper { width: 100%; height: 100%; }
.swiper { width: 100%; height: 100%; }
.swiper-slide { background: var(--lux-bg); display: flex; align-items: center; justify-content: center; }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0.95; transition: opacity 0.5s; }
.swiper-slide:hover img { opacity: 1; }
.swiper-button-next, .swiper-button-prev {
    color: var(--lux-text); background: rgba(255,255,255,0.8); width: 44px; height: 44px;
    border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: all 0.3s var(--transition-ease);
}
.swiper-button-next::after, .swiper-button-prev::after { font-size: 16px; font-weight: 300; }
.swiper-button-next:hover, .swiper-button-prev:hover { background: var(--lux-surface); transform: scale(1.05); }

/* =================  AI 智能助手 (右侧边栏 + Invite) ================= */
/* 🚨 核心修改：将 max-width 从 1320px 增大到 1600px，让对话框向右大幅延伸 */
.ai-home-wrapper { margin: 40px auto; max-width: 1600px; padding: 0 20px; }

.ai-home-card {
    background: var(--lux-surface);
    border: 1px solid var(--lux-border);
    border-radius: 2px;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: row;
    height: 600px; 
    min-height: 500px;
    position: relative; overflow: hidden;
}

.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ai-home-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--lux-border); flex-shrink: 0;
    background: linear-gradient(to right, var(--lux-surface), var(--lux-bg));
}
.ai-home-title {
    font-family: var(--lux-font-serif); font-size: 18px; font-weight: 600;
    color: var(--lux-text); letter-spacing: 0.5px; display: flex; align-items: center; gap: 12px;
}
.ai-home-title::before { content: ''; color: var(--lux-accent); font-size: 14px; }
.ai-home-badge {
    font-family: var(--lux-font-sans); font-size: 9px; color: var(--lux-accent); background: transparent;
    padding: 2px 6px; border-radius: 2px; border: 1px solid var(--lux-border); font-weight: 500; letter-spacing: 1px;
}

.room-info-group {
    display: flex; align-items: center; gap: 8px;
    padding-left: 20px; border-left: 1px solid var(--lux-border);
    margin-left: 10px;
}
.room-id-text { font-size: 12px; color: var(--lux-text-muted); }
.room-id-val { font-family: monospace; font-weight: 600; color: var(--lux-text); }
.btn-invite {
    font-size: 11px; color: var(--lux-accent); cursor: pointer;
    background: none; border: none; font-weight: 600; text-transform: uppercase;
    transition: color 0.3s; padding: 0 4px;
}
.btn-invite:hover { color: var(--lux-accent-hover); text-decoration: underline; }

.btn-clear-home {
    font-size: 10px; color: var(--lux-text-muted); cursor: pointer; border: 1px solid var(--lux-border);
    padding: 4px 10px; border-radius: 2px; background: transparent; transition: all 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
.btn-clear-home:hover { border-color: var(--lux-accent); color: var(--lux-accent); background: var(--lux-bg); }

.toggle-sidebar-btn {
    background: transparent; border: none; cursor: pointer; color: var(--lux-text-muted);
    margin-right: 12px; padding: 4px; transition: 0.3s;
}
.toggle-sidebar-btn:hover { color: var(--lux-text); }

/* 🚨 核心修改：将聊天历史区域改为 Flex 列布局，以便控制气泡对齐 */
#aiHomeHistory {
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 24px;
    background: repeating-linear-gradient(0deg, transparent, transparent 39px, var(--lux-border) 39px, var(--lux-border) 40px);
    background-size: 100% 40px;
    display: flex;             /* 新增：改为 Flex 布局 */
    flex-direction: column;    /* 新增：垂直排列 */
}

/*  核心修改：调整气泡宽度和对齐 */
.chat-bubble { 
    max-width: 90%; /* 默认最大宽度 */
    margin-bottom: 16px; 
    display: flex; 
    flex-direction: column; 
    animation: fadeInUp 0.3s ease; 
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 用户消息：靠右，窄一点 */
.chat-bubble.user { 
    align-self: flex-end; /* 靠右对齐 */
    max-width: 60%;       /* 用户气泡窄一点，符合聊天习惯 */
    align-items: flex-end; 
}

/* AI 消息：靠左，宽一点，填满右侧空间 */
.chat-bubble.assistant { 
    align-self: flex-start; /* 靠左对齐 */
    max-width: 95%;         /* 几乎填满宽度，解决空余空间太多的问题 */
    align-items: flex-start; 
}

.chat-bubble.member {
    align-self: flex-start;
    max-width: 80%;
    align-items: flex-start;
}

.bubble-content {
    padding: 12px 16px; border-radius: 4px; font-size: 13px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word; font-family: var(--lux-font-sans);
    border: 1px solid transparent;
    width: 100%; /* 确保内容填满气泡容器 */
    box-sizing: border-box;
}
.chat-bubble.user .bubble-content {
    background: var(--lux-accent); color: #fff; border-radius: 12px 2px 12px 12px;
    box-shadow: 0 2px 8px rgba(168,159,145,0.15);
}
.chat-bubble.assistant .bubble-content {
    background: var(--lux-bg); color: var(--lux-text); border-color: var(--lux-border);
    border-radius: 2px 12px 12px 12px;
}
.chat-bubble.member .bubble-content {
    background: #f0eeeb; color: var(--lux-text); border-color: var(--lux-border);
    border-radius: 12px 12px 2px 12px;
}
.bubble-meta { font-size: 9px; color: var(--lux-text-muted); margin-top: 4px; padding: 0 4px; letter-spacing: 0.5px; text-transform: uppercase; }

.bubble-content.error-msg {
    background: #fdf2f2; color: var(--error-color); border-color: #f5c6cb;
    font-size: 12px; font-style: italic;
}

.ai-home-input-wrapper {
    border-top: 1px solid var(--lux-border); padding: 16px 20px; background: var(--lux-surface);
    flex-shrink: 0; transition: background 0.3s;
}
.ai-home-textarea {
    width: 100%; min-height: 50px; max-height: 100px; border: none; outline: none;
    font-size: 14px; color: var(--lux-text); resize: none; margin-bottom: 8px;
    line-height: 1.6; font-family: var(--lux-font-serif); background: transparent;
}
.ai-home-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.ai-tools-left { display: flex; align-items: center; gap: 12px; flex: 1; flex-wrap: wrap; }

.chat-mode-switch {
    display: inline-flex;
    background: var(--lux-bg);
    border: 1px solid var(--lux-border);
    border-radius: 20px;
    padding: 2px;
    margin-right: 12px;
}
.mode-btn {
    padding: 4px 12px;
    font-size: 11px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--lux-text-muted);
    font-weight: 500;
    border: none;
    background: transparent;
}
.mode-btn.active {
    background: var(--lux-accent);
    color: #fff;
    box-shadow: 0 2px 4px rgba(168,159,145,0.2);
}

.lang-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-tag {
    padding: 6px 16px; border-radius: 24px; background: var(--lux-surface);
    color: var(--lux-text-muted); font-size: 13px; font-weight: 400; cursor: pointer;
    transition: all 0.3s var(--transition-ease); border: 1px solid var(--lux-border);
    letter-spacing: 0.5px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.lang-tag:hover { border-color: var(--lux-accent); color: var(--lux-text); transform: translateY(-1px); }
.lang-tag.active {
    background: var(--lux-accent); color: #fff; border-color: var(--lux-accent);
    font-weight: 500; box-shadow: 0 4px 12px rgba(168,159,145,0.3); transform: translateY(-1px);
}

.upload-icons { display: flex; gap: 6px; }
.icon-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--lux-border); border-radius: 2px; cursor: pointer; font-size: 14px;
    color: var(--lux-text-muted); transition: 0.3s; position: relative; background: transparent;
}
.icon-btn:hover { border-color: var(--lux-accent); color: var(--lux-accent); }
.icon-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ai-actions-right { display: flex; align-items: center; gap: 12px; }
.char-count { font-size: 10px; color: var(--lux-text-muted); letter-spacing: 0.5px; }
.ai-send-btn {
    width: 40px; height: 40px; border-radius: 2px; background: var(--lux-accent);
    border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: 0.3s; letter-spacing: 1px;
}
.ai-send-btn:hover { background: var(--lux-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(168,159,145,0.2); }
.ai-send-btn:disabled { background: var(--lux-border); cursor: not-allowed; transform: none; box-shadow: none; }
.file-tags-container { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.file-tag { display: inline-flex; align-items: center; padding: 3px 8px; background: var(--lux-bg); border: 1px solid var(--lux-border); border-radius: 2px; font-size: 10px; color: var(--lux-text-muted); }
.file-tag span { margin-left: 4px; cursor: pointer; color: var(--lux-text-muted); font-weight: 500; }
.file-tag span:hover { color: #c25c5c; }

/* 侧边栏样式 (可选：如果觉得右侧 History 栏太宽，可以减小 width) */
.ai-sidebar {
    width: 240px; /* 原为 260px，稍微调小一点给聊天区更多空间 */
    background: #f8f7f5;
    border-left: 1px solid var(--lux-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), padding 0.3s;
    overflow: hidden;
}
.ai-sidebar.collapsed {
    width: 0 !important;
    border-left: none;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--lux-border);
    display: flex; justify-content: space-between; align-items: center;
    white-space: nowrap;
}
.sidebar-title { font-family: var(--lux-font-serif); font-size: 16px; font-weight: 600; }
.btn-new-chat {
    background: var(--lux-accent); color: #fff; border: none;
    padding: 6px 12px; border-radius: 4px; font-size: 11px; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.5px; transition: 0.3s;
}
.btn-new-chat:hover { background: var(--lux-accent-hover); }

.session-list { flex: 1; overflow-y: auto; padding: 10px; }
.session-item {
    padding: 12px; margin-bottom: 8px; border-radius: 6px; cursor: pointer;
    transition: all 0.2s; border: 1px solid transparent; position: relative;
}
.session-item:hover { background: #fff; border-color: var(--lux-border); }
.session-item.active { background: #fff; border-color: var(--lux-accent); box-shadow: 0 2px 8px rgba(168,159,145,0.15); }
.session-title { font-size: 13px; font-weight: 500; color: var(--lux-text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-time { font-size: 10px; color: var(--lux-text-muted); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--lux-border); }
.btn-batch-delete {
    width: 100%; background: transparent; border: 1px solid var(--lux-border);
    color: var(--lux-text-muted); padding: 8px; border-radius: 4px; cursor: pointer;
    font-size: 11px; transition: 0.3s;
}
.btn-batch-delete:hover { border-color: #c25c5c; color: #c25c5c; }

/* ================= 臻选茶系导航 ================= */
.tea-section { margin: 50px auto 80px; padding: 0 20px; max-width: 1320px; }
.tea-section-title { text-align: center; font-family: var(--lux-font-serif); font-size: 28px; font-weight: 400; margin-bottom: 36px; letter-spacing: 1px; }
.tea-section-title::after { content: ''; display: block; width: 40px; height: 1px; background: var(--lux-accent); margin: 12px auto 0; }
.tea-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px; }
.tea-card {
    background: var(--lux-surface); border: 1px solid var(--lux-border); border-radius: 2px;
    padding: 28px 16px; text-align: center; color: var(--lux-text);
    transition: all 0.4s var(--transition-ease); position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}
.tea-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: var(--lux-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--transition-ease);
}
.tea-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.04); border-color: transparent; }
.tea-card:hover::before { transform: scaleX(1); }
.tea-icon {
    width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 14px; color: var(--lux-surface);
    background: linear-gradient(135deg, var(--lux-text-muted), var(--lux-text));
    transition: transform 0.4s var(--transition-ease);
}
.tea-icon svg {
    width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.tea-card:hover .tea-icon { transform: scale(1.08); }
.tea-name { font-family: var(--lux-font-serif); font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.5px; }
.tea-desc { font-size: 11px; color: var(--lux-text-muted); line-height: 1.5; letter-spacing: 0.3px; }

@media (max-width: 1024px) { .tea-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .tea-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .nav-list { display: none; } }

/* ================= 极简页脚 ================= */
.site-footer { background: var(--lux-bg); border-top: 1px solid var(--lux-border); padding: 40px 0; margin-top: 0; text-align: center; font-size: 11px; color: var(--lux-text-muted); letter-spacing: 0.5px; }
.site-footer p { opacity: 0.8; }
