* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Roboto, sans-serif;
}
:root {
    --chat-font: 15px;
}
body {
    background: #f5f5f5;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 无障碍条 */
.access-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 8px 24px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.access-bar.show {
    display: flex;
}
.access-btn {
    padding: 5px 12px;
    border: 1px solid #c8102e;
    background: #fff;
    color: #c8102e;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
/* 左侧实验栏 */
.experiment-panel {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e0d5;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow-y: auto;
    z-index: 20;
}
.experiment-panel.collapsed {
    width: 55px;
    padding: 20px 0;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0e7dc;
}
.panel-title {
    font-size: 16px;
    font-weight: bold;
    color: #c8102e;
}
.collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8f5f0;
    border: 1px solid #e5e0d5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #c8102e;
}
.experiment-panel.collapsed .panel-content,
.experiment-panel.collapsed .track-container,
.experiment-panel.collapsed .event-log,
.experiment-panel.collapsed .panel-title {
    display: none;
}
.experiment-panel.collapsed .collapse-btn {
    margin: 0 auto;
}
.control-item {
    margin-bottom: 18px;
}
.control-item label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}
.control-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2dbcf;
    border-radius: 6px;
    background: white;
}
.track-container {
    margin-top: 20px;
}
#trackCanvas {
    width: 100%;
    height: 140px;
    border: 1px solid #e5e0d5;
    border-radius: 6px;
    background: #fafafa;
    display: block;
}
.event-log {
    margin-top: 20px;
    background: #fef9f0;
    border-radius: 10px;
    padding: 10px;
    font-size: 11px;
    border: 1px solid #f0e2cf;
}
.log-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #c8102e;
}
.log-list {
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 10px;
    color: #2c3e4e;
}
.log-item {
    border-bottom: 1px dotted #efdbc4;
    padding: 4px 0;
}
/* 主区域 */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.container {
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}
.header {
    background: linear-gradient(90deg, #c8102e 0%, #e85d04 50%, #ffba08 100%);
    padding: 18px 24px;
    color: white;
    transition: background 0.3s ease;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.emblem svg {
    width: 42px;
    height: 42px;
}
.title-text h1 {
    font-size: 22px;
}
.top-links {
    display: flex;
    gap: 24px;
    font-size: 14px;
    cursor: pointer;
}
/* 聊天核心区 flex布局: chat-left, source-sidebar(中间), chat-right */
.main-chat-area {
    flex: 1;
    display: flex;
    padding: 24px;
    gap: 20px;
    overflow: hidden;
    position: relative;
}
.chat-left {
    flex: 2.5;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.source-sidebar {
    width: 170px;
    background: #fffbf5;
    border-left: 1px solid #f0e2cf;
    border-right: 1px solid #f0e2cf;
    padding: 20px 16px;
    display: none;
    overflow-y: auto;
    border-radius: 16px;
}
.source-sidebar.show {
    display: block;
}
.source-item {
    font-size: 13px;
    color: #004b8f;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #f0dcc8;
}
.source-item a {
    color: #c8102e;
    text-decoration: none;
    font-weight: 500;
}
.source-item a:hover {
    text-decoration: underline;
}
.chat-right {
    flex: 0.6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* 智能弹窗（悬停） */
.custom-tooltip {
    position: fixed;
    background: white;
    border: 2px solid #c8102e;
    border-radius: 16px;
    padding: 14px;
    width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none;
    font-size: 13px;
    line-height: 1.5;
    backdrop-filter: blur(2px);
}
.tooltip-logo {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #c8102e, #a00b28);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}
.tooltip-title {
    font-weight: bold;
    font-size: 16px;
    color: #c8102e;
    text-align: center;
    margin-bottom: 6px;
}
.tooltip-url {
    font-size: 11px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 8px;
    word-break: break-all;
    background: #f7f2ea;
    padding: 4px;
    border-radius: 6px;
}
.tooltip-desc {
    font-size: 12px;
    color: #333;
    text-align: center;
}
.click-hint {
    font-size: 10px;
    color: #a55;
    text-align: center;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f0e7dc;
}
.ref-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #c8102e;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 4px;
    text-decoration: none;
    transition: 0.1s;
}
.ref-number:hover {
    background-color: #8a0b1f;
    transform: scale(1.05);
}
.bubble {
    max-width: 80%;
    background: #f5f0e6;
    padding: 12px 18px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: var(--chat-font);
    white-space: pre-wrap;
}
/* 统一其他组件样式 */
.chat-header h2 {
    border-bottom: 2px solid #f0e7dc;
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.message {
    display: flex;
    gap: 10px;
}
.message.user {
    justify-content: flex-end;
}
.msg-avatar {
    width: 36px;
    height: 36px;
    background: #c8102e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}
.msg-avatar.user {
    background: #607d8b;
}
.input-area {
    border: 1px solid #e2dbcf;
    border-radius: 20px;
    padding: 16px;
    background: #fff;
}
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.tag {
    background: #ffeef0;
    color: #c8102e;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}
.input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 8px 15px;
}
.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}
.send-btn {
    margin-top: 12px;
    background: #c8102e;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 32px;
    cursor: pointer;
    float: right;
}
.common-q, .history-q {
    background: #fefcf8;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #f2ebe0;
}
.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #c8102e;
    border-left: 4px solid #c8102e;
    padding-left: 12px;
    margin-bottom: 14px;
}
.list-item {
    padding: 8px 0 8px 8px;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
    font-size: 13px;
}
.clear-btn {
    font-size: 12px;
    border: none;
    background: none;
    cursor: pointer;
    color: #a00;
    float: right;
}

/* 思考动画样式 */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thinking-text {
    font-size: 14px;
    color: #666;
}

.thinking-dot {
    font-size: 18px;
    font-weight: bold;
    color: #c8102e;
    transition: opacity 0.2s ease;
}

.thinking-dot:nth-child(2) { animation-delay: 0s; }
.thinking-dot:nth-child(3) { animation-delay: 0.2s; }
.thinking-dot:nth-child(4) { animation-delay: 0.4s; }

/* 或者用纯CSS动画替代JS */
.thinking-indicator-css {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thinking-indicator-css .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #c8102e;
    animation: pulse 1.2s ease-in-out infinite;
}

.thinking-indicator-css .dot:nth-child(1) { animation-delay: 0s; }
.thinking-indicator-css .dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator-css .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 添加到 style.css 末尾 */

/* 防止图片被下载/拖拽/右键保存 */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* 确保圆形容器内的图片也是圆形 */
.msg-avatar {
    width: 36px;
    height: 36px;
    background: transparent !important;  /* 移除原有背景色 */
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-avatar.user {
    background: transparent !important;
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 左上角 emblem 容器样式 */
.emblem {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
}

.emblem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}