* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 280px;
    --sidebar-collapsed: 64px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 全局动画 ========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: #f8f9fa;
    color: #1a1a2e;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.layout {
    display: flex;
    height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: width 0.3s var(--transition-smooth);
    position: relative;
    z-index: 100;
    box-shadow: 1px 0 0 #e9ecef;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* 头部 */
.sidebar-header {
    height: 64px;
    padding: 0 12px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.sidebar.collapsed .logo {
    gap: 0;
}

/* 顶部收缩按钮 */
.header-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s ease;
}

.header-toggle-btn:hover {
    background: #f8f9fa;
    color: #1a1a2e;
}

.header-toggle-btn i {
    font-size: 18px;
    transition: transform 0.3s var(--transition-smooth);
}

.sidebar.collapsed .header-toggle-btn {
    display: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon i {
    color: #4263eb;
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .logo-text {
    display: none;
}

/* 侧边栏内容 */
.sidebar-content {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-content {
    padding: 8px;
    justify-content: center;
}

/* 新建按钮 */
.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 42px;
    padding: 0 16px;
    background: #f0f4ff;
    color: #4263eb;
    border: 1px solid #d6e0ff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.new-chat-btn:hover {
    background: #e5ebff;
    border-color: #c1d0ff;
}

.new-chat-btn:active {
    transform: scale(0.98);
}

.new-chat-btn i {
    font-size: 18px;
    flex-shrink: 0;
}

.new-chat-btn span {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .new-chat-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
}

.sidebar.collapsed .new-chat-btn span {
    display: none;
}

button.nav-item span {
    pointer-events: none;
}

.sidebar.collapsed button.nav-item {
    width: 48px;
    height: 48px;
    padding: 0;
    margin-bottom: 4px;
    justify-content: center;
}

.sidebar.collapsed button.nav-item span {
    display: none;
}

/* 导航菜单 */
.nav-section {
    margin-top: 4px;
}

.sidebar.collapsed .nav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px 8px;
    white-space: nowrap;
    height: 32px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    height: 0;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 450;
    margin-bottom: 4px;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.nav-item i {
    font-size: 20px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.15s ease;
}

.nav-item span {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: #f8f9fa;
    color: #1a1a2e;
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: #f0f4ff;
    color: #4263eb;
}

.nav-item.active i {
    opacity: 1;
    color: #4263eb;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #4263eb;
    border-radius: 0 3px 3px 0;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-item {
    width: calc(var(--sidebar-collapsed) - 16px);
    height: 48px;
    padding: 0;
    margin: 4px auto;
    justify-content: center;
    border-radius: 12px;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item.active::before {
    opacity: 0;
}

/* 历史记录 */
.history-section {
    flex: 1;
    margin-top: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .history-section {
    opacity: 0;
    pointer-events: none;
    flex: 0;
    height: 0;
    margin: 0;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 8px;
    white-space: nowrap;
}

.history-header i {
    font-size: 14px;
    color: #adb5bd;
    flex-shrink: 0;
}

.history-header span {
    font-size: 11px;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.clear-all-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #adb5bd;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.history-section:hover .clear-all-btn {
    opacity: 1;
}

.clear-all-btn:hover {
    background: #ffe3e3;
    color: #e03131;
}

.clear-all-btn i {
    font-size: 14px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    overflow: hidden;
    gap: 10px;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-icon {
    font-size: 14px;
    color: #adb5bd;
    flex-shrink: 0;
}

.history-item.active .history-icon {
    color: #4263eb;
}

.history-text {
    font-size: 13px;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.history-time {
    font-size: 11px;
    color: #adb5bd;
    flex-shrink: 0;
}

/* 底部展开按钮（仅收起时显示） */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 40px;
    padding: 0 16px;
    width: 100%;
    background: transparent;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    color: #6c757d;
    font-size: 13px;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.toggle-btn:hover {
    background: #f8f9fa;
    color: #1a1a2e;
    border-color: #dee2e6;
}

.toggle-btn i {
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.3s var(--transition-smooth);
}

.toggle-btn span {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .toggle-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-color: transparent;
}

.sidebar.collapsed .toggle-btn:hover {
    border-color: #e9ecef;
}

.sidebar.collapsed .toggle-btn i {
    transform: rotate(180deg);
}

.sidebar.collapsed .toggle-btn span {
    display: none;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9fa;
}

/* 聊天容器 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* 消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0 0;
    display: flex;
    flex-direction: column;
}

.chat-messages-inner {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    padding: 0 32px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

/* 欢迎区域 */
.welcome-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 32px 40px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.welcome-section::before {
    display: none;
}

.welcome-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(248,249,250,0.85), rgba(248,249,250,0.95));
    z-index: 0;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.welcome-icon i {
    font-size: 28px;
    color: #4263eb;
}

.welcome-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.gens-logo {
    background: linear-gradient(120deg, #6aa8ff, #a58bff, #7be0c3, #6aa8ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gens-text-flow 7s ease-in-out infinite;
    font-weight: 700;
}

.welcome-desc {
    color: #6c757d;
    font-size: 15px;
    margin-bottom: 40px;
}

.welcome-section > * {
    position: relative;
    z-index: 1;
}

@keyframes gens-flow {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(55px);
    }
    50% {
        transform: translate3d(3%, -2%, 0) scale(1.05);
        filter: blur(60px);
    }
    100% {
        transform: translate3d(-4%, 3%, 0) scale(1.08);
        filter: blur(58px);
    }
}

@keyframes gens-text-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.welcome-inline-icon {
    font-size: 24px;
    color: #4263eb;
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 600px;
}

.quick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
}

.quick-item i {
    font-size: 16px;
    color: #4263eb;
}

.quick-item:hover {
    border-color: #4263eb;
    background: #f8f9ff;
}

/* 消息样式 */
.message {
    margin-bottom: 24px;
    display: flex;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding: 0 24px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 20px;
    border-radius: 20px 20px 6px 20px;
    max-width: 70%;
    font-size: 14px;
    line-height: 1.6;
}

.ai-message {
    align-items: flex-start;
}

.message-body {
    flex: 1;
    max-width: 100%;
}

.ai-message .message-content {
    font-size: 14px;
    line-height: 1.7;
    color: #1a1a2e;
    padding: 4px 0;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
    padding: 0 4px;
}

.message-sources {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.message-sources i {
    font-size: 14px;
}

.message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-message:hover .message-actions,
.ai-message:hover .message-sources {
    opacity: 1;
}

.message-sources {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    color: #1a1a2e;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    height: 24px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* 输入区域 - 悬浮效果 */
.input-area {
    padding: 8px 32px 12px;
    background: linear-gradient(to top, #f8f9fa 60%, transparent);
    position: sticky;
    bottom: 0;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

.input-disclaimer {
    text-align: center;
    font-size: 11px;
    color: #adb5bd;
    margin-top: 8px;
}

.input-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

.input-main {
    display: flex;
    align-items: flex-start;
    padding: 16px 16px 12px 20px;
    gap: 12px;
}

.input-main textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    color: #1a1a2e;
    min-height: 48px;
    max-height: 200px;
    font-family: inherit;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.input-main textarea::-webkit-scrollbar {
    display: none;
}

.input-main textarea::placeholder {
    color: #adb5bd;
    font-size: 14px;
}

.send-btn {
    width: 28px;
    height: 28px;
    background: #e9ecef;
    color: #adb5bd;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn i {
    font-size: 15px;
}

.send-btn.active {
    background: #4263eb;
    color: #fff;
}

.send-btn.active:hover {
    background: #3451c7;
}

/* 工具栏 */
.input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 6px;
    border-top: 1px solid #f1f3f4;
    margin: 0 8px;
}

.toolbar-left {
    display: flex;
    gap: 2px;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: #f8f9fa;
    color: #1a1a2e;
}

.toolbar-btn i {
    font-size: 17px;
}

.toolbar-right {
    position: relative;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    transition: all 0.15s ease;
}

.model-selector:hover {
    background: #f1f3f4;
    color: #495057;
}

.model-selector i {
    font-size: 12px;
    color: #adb5bd;
}

.model-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 6px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.model-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: background 0.15s ease;
}

.model-option:hover {
    background: #f8f9fa;
}

.model-option .check-icon {
    font-size: 14px;
    color: #4263eb;
    opacity: 0;
}

.model-option.active {
    background: #f0f4ff;
}

.model-option.active .check-icon {
    opacity: 1;
}

/* ========== 文案生成页 ========== */
.article-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.article-container::-webkit-scrollbar {
    width: 6px;
}

.article-container::-webkit-scrollbar-track {
    background: transparent;
}

.article-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.article-container::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

.article-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px;
}

.article-header {
    margin-bottom: 28px;
}

.article-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.article-header p {
    font-size: 14px;
    color: #6c757d;
}

.article-content {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

.article-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    height: fit-content;
    position: sticky;
    top: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #4263eb;
}

.form-input::placeholder {
    color: #adb5bd;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group {
    display: flex;
    gap: 8px;
}

.option-item {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.option-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-text {
    display: block;
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.option-item:hover .option-text {
    border-color: #ced4da;
}

.option-item.active .option-text {
    background: #f0f4ff;
    border-color: #4263eb;
    color: #4263eb;
}

.generate-btn {
    width: 100%;
    padding: 12px;
    background: #4263eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
    margin-top: 4px;
}

.generate-btn:hover {
    background: #3451c7;
}

.generate-btn i {
    font-size: 16px;
}

.article-result {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    min-height: 400px;
}

.result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #adb5bd;
}

.result-empty i {
    font-size: 48px;
    margin-bottom: 12px;
}

.result-empty p {
    font-size: 14px;
}

.result-content {
    padding: 28px;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.result-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
}

.result-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.result-actions .action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s ease;
}

.result-actions .action-btn:hover {
    background: #e9ecef;
    color: #1a1a2e;
}

.result-body {
    font-size: 14px;
    line-height: 1.8;
    color: #495057;
}

.result-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 24px 0 12px;
}

.result-body h3:first-child {
    margin-top: 0;
}

.result-body p {
    margin-bottom: 12px;
}

.result-body pre {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    margin: 16px 0;
}

.result-body code {
    font-family: 'SF Mono', Consolas, monospace;
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.tag {
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 12px;
    color: #495057;
}

.result-image {
    margin-top: 20px;
}

.image-placeholder {
    background: #f8f9fa;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #adb5bd;
    gap: 8px;
}

.image-placeholder i {
    font-size: 32px;
}

.image-placeholder span {
    font-size: 13px;
}


/* ========== 设置页 ========== */
.settings-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.settings-container::-webkit-scrollbar {
    width: 6px;
}

.settings-container::-webkit-scrollbar-track {
    background: transparent;
}

.settings-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.settings-container::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

.settings-wrapper {
    max-width: 720px;
    margin: 0 auto;
}

.settings-content {
    padding: 0 32px 32px;
}

.settings-header {
    padding: 32px 32px 24px;
}

.settings-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.settings-header p {
    font-size: 14px;
    color: #6c757d;
}

.settings-section {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-header i {
    font-size: 18px;
    color: #4263eb;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.settings-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.setting-input,
.setting-select,
.setting-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: all 0.15s ease;
}

.setting-input:focus,
.setting-select:focus,
.setting-textarea:focus {
    border-color: #4263eb;
    box-shadow: 0 0 0 3px rgba(66, 99, 235, 0.1);
}

.setting-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

.setting-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
}

.setting-password {
    position: relative;
}

.setting-password .setting-input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6c757d;
    border-radius: 6px;
}

.toggle-password:hover {
    background: #f8f9fa;
}

.setting-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-range input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #e9ecef;
    border-radius: 2px;
    outline: none;
}

.setting-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4263eb;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    min-width: 32px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-row .setting-label {
    margin-bottom: 0;
}

.setting-row .setting-hint {
    margin-top: 2px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e9ecef;
    border-radius: 24px;
    transition: 0.2s ease;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: #4263eb;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: #4263eb;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #3451c7;
}

.btn-secondary {
    background: #fff;
    color: #495057;
    border: 1px solid #e9ecef;
}

.btn-secondary:hover {
    background: #f8f9fa;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #e9ecef;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s ease;
}

.btn-small:hover {
    background: #e9ecef;
}

.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== Markdown 渲染样式 ========== */
.message-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.5;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
}

.message-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    color: #e64980;
}

.message-content h3,
.message-content h4 {
    margin: 16px 0 8px;
    font-weight: 600;
    color: #1a1a2e;
}

.message-content h3 {
    font-size: 16px;
}

.message-content h4 {
    font-size: 14px;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.message-content a {
    color: #4263eb;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content p {
    margin: 8px 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* 表格样式 */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.message-content thead {
    background: #f8f9fa;
}

.message-content th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #e9ecef;
}

.message-content td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f3f5;
    color: #1a1a2e;
}

.message-content tbody tr:last-child td {
    border-bottom: none;
}

.message-content tbody tr:hover {
    background: #f8f9fa;
}

/* 历史记录选中状态 */
.history-item.active {
    background: #f0f4ff;
}

.history-item.active .history-text {
    color: #4263eb;
    font-weight: 500;
}

/* 历史记录删除按钮 */
.history-item {
    position: relative;
}

.history-item .history-text {
    cursor: pointer;
    flex: 1;
}

.history-delete {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #adb5bd;
    padding: 4px;
    border-radius: 4px;
}

.history-delete:hover {
    color: #fa5252;
    background: #fff5f5;
}

.history-item:hover .history-time {
    display: none;
}

.history-item:hover .history-delete {
    display: block;
}

/* ========== 全局动画 ========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
