/* ============================================================
   Boss — Boss的第二大脑 | Design System
   风格：简洁白底 + 金色点缀 + 扁平纯色
   ============================================================ */

:root {
    /* 白色基调 - 更柔和的米白 */
    --bg-primary: #fefefe;
    --bg-secondary: #f8f7f4;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fffdf8;
    --bg-input: #f5f4f1;
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* 金色品牌色 - 更饱和 */
    --gold: #b8954e;
    --gold-light: #d4a84c;
    --gold-dark: #8b7030;
    --gold-glow: rgba(184, 149, 78, 0.12);
    --gold-border: rgba(184, 149, 78, 0.4);
    --gold-bg: #faf6ed;

    /* 文字 - 更深的对比度 */
    --text-primary: #0f0f0f;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --text-gold: #9a7b3a;

    /* 功能色 */
    --green: #059669;
    --red: #dc2626;
    --blue: #2563eb;
    --orange: #d97706;

    /* 来源标签色 */
    --tag-personal: #4f46e5;
    --tag-industry: #059669;
    --tag-public: #2563eb;

    /* 间距 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* 字体 — 系统原生字体栈，无需外部加载 */
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* 关键：body 直接作为 flex 容器，让 chat-body 撑满中间 */
    display: flex;
    flex-direction: column;
}

/* ===== 通用按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.btn-gold {
    background: var(--gold);
    color: #ffffff;
}
.btn-gold:hover {
    background: var(--gold-dark);
}
.btn-gold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid #e0e0e0;
}
.btn-outline:hover {
    border-color: var(--gold-border);
    color: var(--text-gold);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
}
.btn-ghost:hover {
    color: var(--text-gold);
}

/* ===== 表单 ===== */
input, textarea, select {
    font-family: var(--font);
    background: var(--bg-input);
    border: 1px solid #e5e5e5;
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    width: 100%;
    transition: border-color 0.2s;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--gold);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

/* ===== 来源标签 ===== */
.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}
.source-tag.personal {
    background: rgba(99, 102, 241, 0.1);
    color: var(--tag-personal);
}
.source-tag.industry {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tag-industry);
}
.source-tag.public {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tag-public);
}
.source-tag.warning {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

/* ===== 主容器 ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* ===== 聊天头部 (纯功能按钮) ===== */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    background: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    flex-shrink: 0; /* 防止被 flex 容器挤压 */
}
.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}
.header-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}
.header-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-logo img {
    height: 24px;
    width: auto;
}
.user-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--gold-glow);
    border: 1px solid var(--gold-border);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}
.user-avatar-btn svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 8px 16px;
    }
}

/* ===== 侧边栏 (Sidebar) ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-sidebar);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}
.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-new-chat {
    margin: 0 16px 20px;
}
.btn-new-chat {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}
.btn-new-chat:hover {
    background: var(--gold-glow);
    border-color: var(--gold-border);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}
.history-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 12px;
    text-transform: uppercase;
}
.history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.history-item .hist-main {
    flex: 1;
    min-width: 0;
}
.history-item .hist-main .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-item .hist-main .time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.hist-more-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}
.history-item:hover .hist-more-btn {
    opacity: 1;
}
.hist-more-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}

/* 历史记录操作菜单 */
.hist-action-menu {
    position: absolute;
    right: 8px;
    top: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 200;
    padding: 4px;
    min-width: 120px;
    animation: menu-slide-up 0.15s ease;
}
.hist-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.hist-action-item:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}
.hist-action-item.hist-action-danger {
    color: var(--red);
}
.hist-action-item.hist-action-danger:hover {
    background: rgba(220,38,38,0.06);
}

.history-item:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text-primary);
}
.history-item.active {
    background: var(--gold-glow);
    color: var(--text-gold);
    font-weight: 500;
}

/* ===== 个人中心浮层 (User Dropdown) ===== */
.user-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 220px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 500;
    display: none;
    padding: 8px;
    animation: menu-slide-up 0.2s ease;
}
.user-menu.active {
    display: block;
}

/* Chat 推广条（菜单内） */
.menu-promo-chat {
    background: linear-gradient(135deg, var(--gold-bg) 0%, #fff9eb 100%);
    color: var(--gold-dark) !important;
    font-weight: 600;
    border-radius: 8px;
    margin: 4px 6px;
    position: relative;
}
.menu-promo-chat:hover {
    background: linear-gradient(135deg, #f5ecd5 0%, #fff3d6 100%);
}
.promo-badge {
    font-size: 10px;
    background: var(--gold);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: auto;
    font-weight: 600;
    letter-spacing: 0.5px;
}
@keyframes menu-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}
.menu-item:hover {
    background: #f8f8f8;
    color: var(--text-primary);
}
.menu-item.logout {
    color: var(--red);
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

/* ===== 聊天主体 ===== */
.chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* 核心消息流居中显示 */
    scroll-behavior: smooth;
}
.chat-body-content {
    width: 95%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
}

/* ===== 欢迎屏 (完全左对齐结构) ===== */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 5%;
    max-width: 800px;
    margin: 40px auto 30px;
    width: 100%;
}
.welcome-avatar {
    width: auto;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
}
.welcome-brand {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #CFAB51 0%, #E6C57A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--gold); /* 降级 */
    letter-spacing: -0.5px;
}
/* ===== 文字提问列表 (左对齐无边框) ===== */
.quick-questions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 40px;
    width: 100%;
}
.quick-q-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    font-family: var(--font);
    text-align: left;
}
.quick-q-btn .q-icon {
    margin-right: 12px;
    font-size: 18px;
    color: var(--text-muted);
}
.quick-q-btn:hover {
    color: var(--text-gold);
}

/* ===== 场景卡片 — 一行横向卡片 ===== */
.scene-scroll-wrapper {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    display: flex;
    justify-content: center;
    padding-bottom: 30px;
    position: relative;
}

.scroll-arrow {
    position: absolute;
    top: calc(50% - 15px);
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.scroll-arrow:hover {
    color: var(--gold);
    border-color: var(--gold-border);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.15);
}
.scroll-arrow-left {
    left: calc(50vw - 425px);
}
.scroll-arrow-right {
    right: calc(50vw - 425px);
}
@media (max-width: 850px) {
    .scroll-arrow-left { left: 10px; }
    .scroll-arrow-right { right: 10px; }
    .hide-on-mobile { display: none !important; }
}
.scene-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 5%;
    max-width: 800px;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
/* 隐藏网页底部的横向滚动条！ */
body { overflow-x: hidden; }
.scene-grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scene-card {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    padding-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid #e8e8e8;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}
.scene-card:hover {
    border-color: var(--gold-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.08);
}

/* 信息建设卡片 — 虚线边框 + 金色微光提示"待补充" */
.scene-card.info-card {
    border-style: dashed;
    border-color: var(--gold-border);
    background: linear-gradient(135deg, #fffdf8 0%, #faf6ed 100%);
    position: relative;
}
.scene-card.info-card::after {
    content: '补充信息';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: var(--gold);
    background: var(--gold-glow);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}
.scene-card.info-card:hover {
    border-color: var(--gold);
    background: linear-gradient(135deg, #faf6ed 0%, #f5eedd 100%);
    box-shadow: 0 4px 20px rgba(184, 149, 78, 0.15);
}

/* 自我突破卡片 — 极简白底高对比 */
.scene-card.challenge-card {
    background: linear-gradient(135deg, #ffffff 0%, #fcf9f2 100%);
    border-color: var(--gold-border);
    color: var(--text-primary);
}
.scene-card.challenge-card .scene-title {
    color: var(--text-primary);
}
.scene-card.challenge-card .scene-desc {
    color: var(--text-secondary);
}
.scene-card.challenge-card:hover {
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
    background: linear-gradient(135deg, #fff 0%, #fef3c7 100%);
}

/* 大衍推盘卡片 — 淡淡的浅紫背景 */
.scene-card.card-iching {
    background: #fdfcff;
    border: 1px solid #e8e3f0;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.scene-card.card-iching::before {
    display: none;
}
.scene-card.card-iching .scene-title {
    color: #5b4b73;
    font-weight: 600;
}
.scene-card.card-iching .scene-desc {
    color: var(--text-secondary);
}
.scene-card.card-iching .scene-icon {
    font-size: 1.4rem;
}
.scene-card.card-iching:hover {
    border-color: #d7cce6;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(118, 93, 160, 0.06);
    background: #f7f3fc;
}
/* Chat 推广卡片（场景卡末尾） */
.scene-card.chat-promo-card {
    background: linear-gradient(135deg, var(--gold-bg) 0%, #fef3c7 100%);
    border: 1.5px solid var(--gold);
    position: relative;
}
.scene-card.chat-promo-card .scene-title {
    color: var(--gold-dark);
    font-weight: 700;
}
.scene-card.chat-promo-card .scene-desc {
    color: var(--text-secondary);
}
.scene-card.chat-promo-card:hover {
    border-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(184, 149, 78, 0.2);
    background: linear-gradient(135deg, #fff9eb 0%, #fef3c7 100%);
}
/* 画像完善度指示器 (收纳在个人中心菜单中) */
.profile-status {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.status-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.status-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}
.status-bar-bg {
    width: 100%;
    height: 6px;
    background: #e8e6e0;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}
.status-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-light), var(--gold));
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.status-tip {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}
.is-complete .status-tip {
    color: var(--gold-dark);
    font-weight: 500;
}
.scene-icon {
    font-size: 20px;
    margin-bottom: 4px;
}
.scene-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.scene-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.scene-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: normal; /* 允许折行 */
}

/* ===== 消息气泡容器 (支持头像) ===== */
/* ===== 消息气泡容器 (支持头像) ===== */
.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
}
.msg-row.user-row {
    justify-content: flex-end;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.msg {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
    animation: msgIn 0.25s ease-out;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.user {
    background: #FDFaf2;
    border: 1px solid rgba(184, 149, 78, 0.15);
    color: #333;
    border-bottom-right-radius: 4px;
    font-size: 14.5px;
}

.msg.ai {
    background: #fff;
    color: #353535;
    box-shadow: 0 4px 16px rgba(184, 149, 78, 0.04);
    border: 1px solid rgba(184, 149, 78, 0.2);
    border-top-left-radius: 4px;
}

/* ===== AI 消息内 Markdown 高级排版 (Premium Reporting Style) ===== */
.msg.ai {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    line-height: 1.75;
    font-size: 15px;
    letter-spacing: 0.2px;
}
.msg.ai h1, .msg.ai h2, .msg.ai h3, .msg.ai h4 {
    color: #9A7730;
    font-weight: bold;
    margin-top: 26px;
    margin-bottom: 12px;
    line-height: 1.4;
    border: none;
}
.msg.ai h1 { font-size: 18px; color: #8F6D25; }
.msg.ai h2 { font-size: 17px; }
.msg.ai h3 { font-size: 16px; }
.msg.ai p { margin: 12px 0; }
.msg.ai a { color: var(--gold); text-decoration: none; border-bottom: 1px dashed var(--gold); transition: all 0.2s; }
.msg.ai a:hover { color: #9A7730; border-bottom-style: solid; }
.msg.ai blockquote {
    background: linear-gradient(135deg, rgba(250, 246, 237, 0.7), rgba(255, 253, 248, 0.4));
    border-left: 4px solid var(--gold);
    padding: 14px 18px;
    margin: 16px 0;
    color: var(--text-secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14.5px;
}
.msg.ai table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14.5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
    border-radius: var(--radius-sm);
}
.msg.ai table th, .msg.ai table td {
    padding: 12px 16px;
    border: 1px solid rgba(184, 149, 78, 0.15);
    text-align: left;
    vertical-align: top;
}
.msg.ai table th {
    background: rgba(250, 246, 237, 0.8);
    color: #8c6a21;
    font-weight: 600;
    white-space: nowrap;
}
.msg.ai table tr:hover td {
    background: rgba(250, 246, 237, 0.2);
}
.msg.ai ul, .msg.ai ol { padding-left: 1.8em; margin: 14px 0; }
.msg.ai li { margin-bottom: 10px; }
.msg.ai li::marker { color: #C9A84C; font-weight: 500; }
.msg.ai strong { color: #111; font-weight: bold; }
.msg.ai code {
    background: rgba(69, 172, 126, 0.1);
    color: #2e8d64;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
.msg.ai pre {
    background: #f8f9fa;
    color: #333;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid #eee;
}
.msg.ai pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-weight: normal;
    white-space: pre;
}
.msg.ai hr {
    border: none;
    border-top: 1px dotted rgba(201, 168, 76, 0.4);
    margin: 20px 0;
}

/* ===== 思考动画 ===== */
.thinking {
    display: flex;
    gap: 6px;
    padding: 4px 0;
}
.thinking span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.4;
    animation: blink 1.4s infinite both;
}
.thinking span:nth-child(2) { animation-delay: 0.2s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* ===== 深度思考展示块 (Thinking Block - Embedded in AI Response) ===== */
.thinking-block {
    margin: -16px -20px 16px -20px;
    background: linear-gradient(180deg, rgba(246, 244, 238, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* 当思考块后面有正文内容时，给一个间距 */
.thinking-block + .ai-content-body {
    margin-top: 12px;
}
/* 正文内容体（v3：与思考块共享同一个 .msg.ai 容器） */
.ai-content-body {
    line-height: inherit;
    font-size: inherit;
}
.thinking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 12px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}
.thinking-header:hover {
    background: rgba(201, 168, 76, 0.06);
}
.thinking-icon {
    font-size: 16px;
    display: inline-block;
    animation: thinkPulse 2.5s ease-in-out infinite;
}
@keyframes thinkPulse {
    0% { filter: drop-shadow(0 0 2px rgba(201,168,76,0.2)); transform: scale(0.95); opacity: 0.7; }
    50% { filter: drop-shadow(0 0 6px rgba(201,168,76,0.8)); transform: scale(1.1); opacity: 1; }
    100% { filter: drop-shadow(0 0 2px rgba(201,168,76,0.2)); transform: scale(0.95); opacity: 0.7; }
}
.thinking-block.collapsed .thinking-icon {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
}
.thinking-toggle {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    flex: 1;
    letter-spacing: 0.5px;
}
.thinking-arrow {
    font-size: 14px;
    color: var(--gold);
    opacity: 0.6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.thinking-block.collapsed .thinking-arrow {
    transform: rotate(-90deg);
}
.thinking-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 0 20px 14px 20px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s, opacity 0.3s;
    opacity: 1;
}
.thinking-block.collapsed .thinking-content {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
    overflow: hidden;
}
.thinking-content-text {
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    color: rgba(60, 60, 60, 0.8) !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    margin: 0 !important;
    background: transparent !important;
    padding: 0 0 0 12px !important;
    border: none !important;
    border-left: 2px solid rgba(201, 168, 76, 0.3) !important;
    border-radius: 0 !important;
}
/* 思考内容滚动条 */
.thinking-content::-webkit-scrollbar { width: 4px; }
.thinking-content::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 2px; }

/* ===== 新版输入气泡 (类似截图) ===== */
.chat-footer {
    padding: 16px 24px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0; /* 防止由于键盘或溢出被挤没 */
}
.chat-input-bubble {
    display: flex;
    flex-direction: column;
    max-width: 820px;
    margin: 0 auto;
    background: #f6f6f6;
    border-radius: 20px;
    padding: 12px 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.chat-input-bubble:focus-within {
    background: #fff;
    border-color: var(--gold-border);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.08);
}
.chat-input-bubble textarea {
    width: 100%;
    background: transparent;
    border: none !important;
    padding: 4px 8px;
    margin-bottom: 8px;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    font-size: 15px;
    line-height: 1.5;
    outline: none !important;
    box-shadow: none !important;
}

/* 操作行 */
.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.actions-left {
    display: flex;
    gap: 12px;
}
.action-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--gold);
}

/* 圆形发送按钮 */
.send-btn-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}
.send-btn-circle:hover {
    background: var(--gold-dark);
    transform: scale(1.05);
}
.send-btn-circle svg {
    margin-top: 1px; /* 视觉微调 */
}

/* ===== 决策重心菜单 (Focus Menu) ===== */
.focus-menu {
    position: absolute;
    bottom: calc(100% + 12px); /* 永远悬浮在输入区域上方 */
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 16px;
    padding: 8px;
    width: 240px;
    display: none;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    z-index: 999; /* 确保置顶 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .focus-menu {
        width: 90%;
        left: 5%;
        bottom: calc(100% + 20px);
        border-radius: 20px;
        padding: 12px;
    }
    .focus-item {
        padding: 12px 16px;
    }
}

.focus-menu.active {
    display: flex;
    animation: menuUp 0.2s ease-out;
}
@keyframes menuUp {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.focus-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}
.focus-item:hover {
    background: var(--gold-bg);
}
.focus-item.active {
    background: var(--gold-bg);
    color: var(--text-gold);
}
.focus-item .mode-icon {
    font-size: 18px;
}
.focus-item .mode-info {
    display: flex;
    flex-direction: column;
}
.focus-item .mode-name {
    font-size: 14px;
    font-weight: 600;
}
.focus-item .mode-desc {
    font-size: 11px;
    opacity: 0.7;
}

/* 激活态滑块图标 */
.action-btn.active {
    color: var(--gold);
    transform: scale(1.1);
}
.send-btn-circle:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* ===== 历史记录面板 ===== */
.history-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 90;
}
.history-overlay.open { display: block; }

.history-panel {
    position: fixed;
    top: 0; right: -360px;
    width: 340px; height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid #f0f0f0;
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
    transition: right 0.3s ease;
    box-shadow: -4px 0 16px rgba(0,0,0,0.08);
}
.history-panel.open { right: 0; }

.history-panel .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.history-panel .header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}
.history-item:hover {
    border-color: var(--gold-border);
    background: var(--gold-bg);
}
.history-item .title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-item .time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .chat-header { 
        padding: 12px 16px; 
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }
    .chat-body { padding: 16px; }
    .chat-footer { 
        padding: 12px 16px; 
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .msg { max-width: 90%; font-size: 15px; padding: 14px 16px; }
    .msg-row { gap: 0; margin-bottom: 20px; padding: 0 4px; }
    .msg-avatar { display: none; }
    .msg.ai { border-radius: 12px 12px 12px 2px; }
    .msg.user { border-radius: 12px 12px 2px 12px; }
    
    /* Mobile specific thinking block negative margins to match new msg padding */
    .thinking-block { margin: -14px -16px 14px -16px; }
    .thinking-header { padding: 14px 16px 10px 16px; }
    .thinking-content { padding: 0 16px 12px 16px; }
    .thinking-block.collapsed .thinking-content { padding: 0 16px; }
    .welcome-brand { font-size: 36px; }
    .welcome-sub { font-size: 14px; margin-bottom: 32px; }
    .scene-grid { gap: 8px; }
    .scene-card { padding: 10px 16px; }
    .history-panel { width: 280px; right: -300px; }
    .scene-scroll-wrapper { width: 100%; margin-left: 0; }
}

@media (max-width: 480px) {
    .scene-grid { gap: 8px; }
    .scene-card { padding: 10px 14px; }
    .scene-title { font-size: 13px; }
}

/* ===== 行内表单卡片 (Inline UI) ===== */
.inline-form-msg {
    width: 100%;
    max-width: 100% !important;
}
.inline-intro {
    font-size: 15px;
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}
.inline-form-card {
    background: var(--bg-secondary);
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    padding: 20px;
}

/* 引导提示标签行 */
.guidance-hints-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}
.guidance-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 4px;
    white-space: nowrap;
}
.guidance-hint-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-gold);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
    white-space: nowrap;
    user-select: none;
}
.guidance-hint-tag:hover {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(184, 149, 78, 0.25);
}
.guidance-hint-tag.used {
    background: #f0f0f0;
    border-color: #ddd;
    color: var(--text-muted);
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* 主输入框 */
.inline-input-main {
    width: 100%;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    transition: border-color 0.2s;
    outline: none;
    resize: none;
    min-height: 120px;
}
.inline-input-main:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 78, 0.08);
}
.inline-input-main::placeholder {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* 底部操作栏 */
.inline-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}
.inline-attach-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.inline-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.inline-attach-btn:hover {
    border-color: var(--gold-border);
    color: var(--text-gold);
    background: var(--gold-bg);
}
.inline-attach-btn.has-file {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-bg);
}
.inline-attach-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.attach-info {
    font-size: 13px;
    color: var(--text-gold);
    display: none;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 提交按钮（紧凑型） */
.inline-submit-btn {
    padding: 10px 24px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 提交后状态 */
.inline-form-submitted {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.inline-form-submitted .inline-form-card {
    position: relative;
}
.inline-form-submitted .inline-form-card::after {
    content: '✓ 已提交';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--gold);
    font-weight: 600;
    background: rgba(255,255,255,0.85);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--gold-border);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .guidance-hints-row {
        gap: 6px;
    }
    .guidance-hint-tag {
        padding: 6px 14px;
        font-size: 14px;
        margin-bottom: 2px;
    }
    .guidance-label {
        display: block;
        font-size: 15px;
        margin-bottom: 8px;
        font-weight: 600;
    }
    .inline-input-main {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 14px;
        min-height: 120px;
    }
    .inline-bottom-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .inline-submit-btn {
        width: 100%;
        justify-content: center;
    }
    .attach-info {
        max-width: 120px;
    }
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.inline-input {
    width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
    resize: none;
}
.inline-input:focus {
    border-color: var(--gold);
}
.inline-upload {
    border: 2px dashed #d9d9d9;
    background: #fafafa;
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.inline-upload:hover {
    border-color: var(--gold);
    background: var(--gold-bg);
}
.upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.8;
}
.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}
.skeleton-shimmer {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #2a2a2a 0%, #3a3a3a 20%, #2a2a2a 40%, #2a2a2a 100%);
    background-repeat: no-repeat;
    animation: shimmer 1s linear infinite;
    background-size: 800px 104px;
}

/* ===== 个人画像完善弹窗 ===== */
.profile-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}
.profile-modal-content {
    position: relative;
    background: var(--bg-primary);
    width: 90%; max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex; flex-direction: column;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.modal-header h3 {
    margin: 0; font-size: 18px; color: var(--text-primary); font-weight: 600;
}
.modal-close-btn {
    background: none; border: none; font-size: 24px; color: #999;
    cursor: pointer; line-height: 1; margin: -5px; padding: 5px;
}
.modal-close-btn:hover { color: var(--text-primary); }
.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block; margin-bottom: 6px; font-size: 14px;
    color: var(--text-secondary); font-weight: 500;
}
.form-group select, .form-group input, .form-group textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
    box-sizing: border-box; background: rgba(0,0,0,0.02);
    font-size: 14px; color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}
.form-group select:focus, .form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--gold); background: var(--bg-primary);
}
/* ===== 导出操作按钮组 (Export Actions) ===== */
.export-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    border-top: 1px dashed rgba(201, 168, 76, 0.25);
    padding-top: 14px;
    flex-wrap: wrap;
}
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #faf6ed 0%, #fff 100%);
    border: 1px solid rgba(201, 168, 76, 0.35);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-gold);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font);
    white-space: nowrap;
}
.export-btn:hover {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(184, 149, 78, 0.3);
}
.export-btn:active {
    transform: translateY(0);
    box-shadow: none;
}
@media (max-width: 480px) {
    .export-actions {
        gap: 6px;
    }
    .export-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

.form-group textarea { resize: vertical; }

/* ===== 认知面板（让 Boss 更了解你） ===== */
.cognition-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}
.cognition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.cognition-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.cognition-update {
    font-size: 12px;
    color: var(--text-muted);
}
.cognition-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}
.cognition-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-all;
    line-height: 1.4;
    transition: all 0.2s;
}
.cognition-tag:hover {
    border-color: var(--gold-border);
    color: var(--text-gold);
}
.tag-forget-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    margin-right: -4px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}
.cognition-tag:hover .tag-forget-btn {
    opacity: 1;
}
.tag-forget-btn:hover {
    background: rgba(0,0,0,0.06);
    color: var(--red);
}

/* 适配移动端触屏：删除按钮不再依赖 hover，常态可见，且扩大点击区域 */
@media (hover: none) and (pointer: coarse) {
    .tag-forget-btn {
        opacity: 0.6;
        width: 28px;
        height: 28px;
        margin-right: -8px;
        color: var(--text-muted);
    }
    .tag-forget-btn:active {
        background: rgba(0,0,0,0.06);
        color: var(--red);
    }
}
.cognition-tag-domain {
    background: var(--gold-glow);
    border-color: var(--gold-border);
    color: var(--text-gold);
}
.cognition-loading {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}
.cognition-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
    line-height: 1.5;
}

/* 行动卡片 */
.cognition-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.cognition-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}
.cognition-action-card:hover {
    border-color: var(--gold-border);
    background: var(--gold-glow);
}
.cognition-action-card .action-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.cognition-action-card .action-info {
    flex: 1;
    min-width: 0;
}
.cognition-action-card .action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.cognition-action-card .action-desc {
    font-size: 12px;
    color: var(--text-muted);
}
.cognition-action-card svg {
    flex-shrink: 0;
    color: var(--text-muted);
}
.cognition-action-card .chevron-icon {
    transition: transform 0.25s ease;
}

/* 折叠表单 */
.profile-form-collapse {
    padding: 16px 0 8px;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 4px;
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 600px; }
}

/* 隐私声明 */
.privacy-pledge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    border: 1px solid rgba(0,0,0,0.04);
}
.pledge-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}
.pledge-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 重置按钮区域 */
.reset-section {
    text-align: center;
    padding-top: 12px;
}
.reset-section .btn-ghost {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 12px;
}
.reset-section .btn-ghost:hover {
    color: var(--red);
}

/* ===== 场景卡片精度引导角标 ===== */
.scene-card.has-precision-hint {
    /* 不再需要 position relative 或强制 padding bottom */
}
.precision-hint {
    align-self: flex-end;
    margin-top: auto;
    font-size: 10px;
    color: var(--gold);
    background: var(--gold-glow);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    z-index: 1;
}
.precision-hint:hover {
    background: var(--gold);
    color: #fff;
    transform: scale(1.05);
}

/* ===== Wiki 更新 toast 通知 ===== */
.wiki-update-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--gold-border);
    color: var(--text-gold);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(184, 149, 78, 0.15);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--font);
}
.wiki-update-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   锦囊面板 (Tips Panel) — 全量场景卡片分类展示
   ============================================================ */

/* 侧边栏锦囊按钮 */
.sidebar-tips-btn {
    margin: 0 16px 12px;
}
.btn-tips {
    width: 100%;
    padding: 11px 12px;
    background: linear-gradient(135deg, #fffdf8 0%, #faf6ed 100%);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-gold);
    transition: all 0.2s;
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
}
.btn-tips:hover {
    background: linear-gradient(135deg, #faf6ed 0%, #f5eedd 100%);
    border-color: var(--gold);
    box-shadow: 0 2px 12px rgba(184, 149, 78, 0.12);
}
.btn-tips .tips-icon {
    font-size: 18px;
}
.btn-tips .tips-count {
    margin-left: auto;
    font-size: 12px;
    background: var(--gold-glow);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* 首页「更多锦囊」入口卡 */
.scene-card.card-more-tips {
    background: linear-gradient(135deg, #fdfcff 0%, #f8f6f0 100%);
    border: 1.5px dashed var(--gold-border);
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.scene-card.card-more-tips .scene-icon {
    font-size: 24px;
}
.scene-card.card-more-tips .scene-title {
    color: var(--text-gold);
}
.scene-card.card-more-tips .scene-desc {
    color: var(--text-muted);
    font-size: 12px;
}
.scene-card.card-more-tips:hover {
    border-color: var(--gold);
    background: linear-gradient(135deg, #faf6ed 0%, #f5eedd 100%);
    box-shadow: 0 4px 20px rgba(184, 149, 78, 0.12);
    transform: translateY(-2px);
}

/* 锦囊面板覆盖层 */
.tips-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.tips-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 锦囊面板主体 */
.tips-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: var(--bg-primary);
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
}
.tips-panel.active {
    transform: translateX(0);
}

.tips-panel-header {
    padding: 20px 24px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}
.tips-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tips-panel-title .tips-title-icon {
    font-size: 22px;
}
.tips-panel-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.tips-panel-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* 锦囊内容区域 */
.tips-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 40px;
}

/* 分类标题 */
.tips-category {
    margin-bottom: 24px;
}
.tips-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.tips-category-icon {
    font-size: 16px;
}
.tips-category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.tips-category-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* 锦囊面板内的卡片网格 */
.tips-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tips-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}
.tips-card:hover {
    border-color: var(--gold-border);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(184, 149, 78, 0.08);
}
.tips-card:active {
    transform: scale(0.98);
}
.tips-card-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}
.tips-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tips-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tips-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 大衍推盘在锦囊面板中的特殊样式 */
.tips-card.tips-card-iching {
    background: #fdfcff;
    border-color: #e8e3f0;
}
.tips-card.tips-card-iching:hover {
    border-color: #d7cce6;
    box-shadow: 0 3px 12px rgba(118, 93, 160, 0.06);
}

/* 移动端适配 */
@media (max-width: 520px) {
    .tips-panel {
        max-width: 100%;
    }
    .tips-card-grid {
        grid-template-columns: 1fr;
    }
}
