/* ===== Claude工作台 - 优化主题 ===== */
/* 各区块独立颜色，视觉区分明显 */

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

:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #fafbfc;
    --bg-hover: #e8eaed;
    --bg-user: #e3f2fd;
    --bg-thinking: #fff8e1;
    --bg-selected: #fff3e0;
    --bg-pinned: #fff8e1;
    
    --accent: #D97706;
    --accent-light: #fef3c7;
    --accent-blue: #1976d2;
    --accent-blue-light: #e3f2fd;
    
    --fg: #1f2937;
    --fg-dim: #6b7280;
    --fg-light: #9ca3af;
    --fg-very-light: #d1d5db;
    --fg-thinking: #92400e;
    
    --border: #e0e0e0;
    --toggle-on: #D97706;
    --toggle-off: #d1d5db;
    --stop-btn: #dc2626;
    
    --success: #10b981;
    --error: #ef4444;
    --purple: #7c3aed;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--fg);
    padding: 15px;
}

/* ===== 登录界面 ===== */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.login-overlay.hidden { display: none; }

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    min-width: 360px;
}
.login-logo { font-size: 50px; margin-bottom: 15px; }
.login-title {
    font-size: 24px;
    color: var(--fg);
    margin-bottom: 30px;
    font-weight: 600;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-form input {
    padding: 14px 18px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--accent); }
.login-form button {
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}
.login-form button:hover { background: #b45309; }
.login-switch {
    margin-top: 15px;
    font-size: 13px;
    color: var(--fg-dim);
}
.login-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.login-switch a:hover {
    text-decoration: underline;
}
.login-error {
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
    color: var(--error);
}
.login-contact {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--fg-dim);
    position: relative;
}
.contact-trigger {
    cursor: pointer;
    transition: color 0.2s;
}
.contact-trigger:hover { color: var(--accent); }
.contact-wechat {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-weight: 600;
}
.login-contact:hover .contact-wechat { display: block; }

/* ===== 主布局 ===== */
.main-container {
    display: flex;
    height: calc(100vh - 30px);
    gap: 15px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ===== 左侧 Claude 区域 ===== */
.claude-section {
    flex: 1;
    display: flex;
    min-width: 0;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* 侧边栏 */
.claude-sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    overflow: hidden;
    border-right: 1px solid var(--border);
}
.claude-sidebar.collapsed { width: 50px; }
.claude-sidebar.collapsed .sidebar-title,
.claude-sidebar.collapsed .sidebar-collapse,
.claude-sidebar.collapsed .new-chat-text,
.claude-sidebar.collapsed .chat-item-title,
.claude-sidebar.collapsed .chat-item-badge,
.claude-sidebar.collapsed .sidebar-divider { display: none; }

/* 侧边栏收起时余额仍显示 */
.claude-sidebar.collapsed .sidebar-footer {
    padding: 8px 4px;
    text-align: center;
}
.claude-sidebar.collapsed .api-balance {
    flex-direction: column;
    gap: 2px;
}
.claude-sidebar.collapsed .api-balance-text {
    font-size: 10px;
}

.sidebar-header {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}
.sidebar-toggle {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--fg-dim);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-toggle:hover { color: var(--accent); background: var(--bg-hover); }
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg);
    flex: 1;
}
.sidebar-collapse {
    width: 24px; height: 24px;
    border: none;
    background: transparent;
    color: var(--fg-dim);
    font-size: 12px;
    cursor: pointer;
}
.sidebar-collapse:hover { color: var(--accent); }

.new-chat-row {
    margin: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-radius: 8px;
    background: var(--accent);
    color: white;
}
.new-chat-row:hover { background: #b45309; }
.new-chat-icon {
    width: 22px; height: 22px;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}
.new-chat-text {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 12px;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}
.chat-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--bg-selected); border-left: 3px solid var(--accent); }
.chat-item.pinned { background: var(--bg-pinned); }
.chat-item-icon {
    font-size: 14px;
    opacity: 0.7;
}
.chat-item-title {
    flex: 1;
    font-size: 13px;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-item-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent);
    color: white;
    border-radius: 4px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
}
.api-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}
.api-balance-icon { font-size: 14px; }

/* 聊天主区域 */
.claude-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    min-width: 0;
}

.chat-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
}
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fg);
}
.prompt-tag {
    padding: 4px 12px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* 右上角API提供商和余额 */
.provider-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.provider-badge:hover {
    background: var(--accent);
    color: white;
}
.header-settings-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.header-settings-btn:hover {
    background: var(--bg-hover);
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
}

.welcome-msg {
    text-align: center;
    padding: 80px 20px;
}
.welcome-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.8; }
.welcome-msg h2 {
    font-size: 28px;
    color: var(--fg);
    margin-bottom: 8px;
    font-weight: 400;
}
.welcome-msg p {
    font-size: 14px;
    color: var(--fg-dim);
}

.message {
    margin-bottom: 20px;
    max-width: 100%;
}
.message-user {
    background: var(--accent-blue-light);
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid var(--accent-blue);
}
.message-assistant {
    padding: 14px 18px;
    color: var(--fg);
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg-card);
    border-radius: 12px;
    border-left: 4px solid var(--accent);
}
.message-thinking {
    background: var(--bg-thinking);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--fg-thinking);
    font-size: 13px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
}
.message-time {
    font-size: 10px;
    color: var(--fg-light);
    margin-top: 8px;
    text-align: right;
}

/* 输入区域 */
.input-area {
    padding: 15px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.input-files {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.input-files:empty { display: none; }
.file-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--fg-dim);
}
.file-tag .remove {
    cursor: pointer;
    opacity: 0.6;
}
.file-tag .remove:hover { opacity: 1; color: var(--error); }

.input-box {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.input-box:focus-within { border-color: var(--accent); }
.input-box textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--fg);
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 150px;
    font-family: inherit;
    line-height: 1.5;
}
.input-box textarea::placeholder { color: var(--fg-light); }

.input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tool-icon {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--fg-dim);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-icon:hover { background: var(--bg-hover); color: var(--fg); }

.model-selector {
    font-size: 12px;
    color: var(--fg-dim);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
}
.model-selector:hover { color: var(--accent); border-color: var(--accent); }

.send-btn {
    width: 36px; height: 36px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.send-btn:hover { background: #b45309; }
.send-btn.stop { background: var(--stop-btn); }
.send-btn.stop:hover { background: #b91c1c; }

.input-status {
    font-size: 11px;
    color: var(--fg-dim);
    margin-top: 8px;
    padding-left: 4px;
}

/* ===== 右侧工具面板 ===== */
.right-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 上下分区 - 独立卡片 */
.panel-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}
.panel-section.top-section {
    flex: 1;
    min-height: 0;
}
.panel-section.bottom-section {
    height: 280px;
    flex-shrink: 0;
}
.section-header {
    padding: 12px 16px;
    background: var(--accent-blue);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* 用户卡片 */
.user-card {
    position: relative;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.user-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    flex: 1;
}
.user-level {
    padding: 3px 10px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.logout-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 12px;
    color: var(--fg-dim);
    cursor: pointer;
}
.logout-btn:hover { border-color: var(--error); color: var(--error); }

.user-expire {
    padding: 6px 12px;
    background: var(--accent-light);
    border-radius: 6px;
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 10px;
    text-align: center;
}

.user-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 6px;
    font-size: 13px;
    color: white;
    margin-bottom: 10px;
    font-weight: 500;
}
.user-balance .balance-icon {
    font-size: 14px;
}

.contact-info {
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 工具切换标签 */
.tool-tabs {
    display: flex;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
}
.tool-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--fg-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.tool-tab:hover { color: var(--fg); background: var(--bg-hover); }
.tool-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--bg-card);
}

/* 工具内容区 */
.tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.tool-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}
.tool-panel.active { display: flex; }

.panel-header {
    padding: 12px 16px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}
.panel-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 底部区域的panel-body */
.bottom-section .panel-body {
    padding: 14px;
    flex: 1;
}
.bottom-section .drop-zone {
    flex: 1;
    min-height: 120px;
}

/* 表单元素 */
.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-row label {
    font-size: 13px;
    color: var(--fg-dim);
    min-width: 45px;
}
.form-row select,
.form-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-card);
    color: var(--fg);
}
.form-row select:focus,
.form-row input:focus { border-color: var(--accent); outline: none; }

.icon-btn {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--fg-dim);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); }

.tool-textarea {
    width: 100%;
    min-height: 100px;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    background: var(--bg-sidebar);
    color: var(--fg);
    line-height: 1.5;
}
.tool-textarea.large {
    min-height: 180px;
}
.tool-textarea:focus { border-color: var(--accent); outline: none; background: var(--bg-card); }

/* 设置折叠切换 */
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--fg-dim);
    transition: all 0.2s;
}
.settings-toggle:hover { background: var(--bg-hover); color: var(--fg); }
.toggle-arrow { transition: transform 0.2s; }
.toggle-arrow.expanded { transform: rotate(180deg); }

.char-count {
    text-align: right;
    font-size: 11px;
    color: var(--fg-light);
}

/* 设置项 */
.setting-group {
    background: var(--bg-sidebar);
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    margin-top: 6px;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 500px;
}
.setting-group.collapsed {
    max-height: 0;
    padding: 0 12px;
    border-color: transparent;
    margin-top: 0;
}
.setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}
.setting-row label {
    font-size: 12px;
    color: var(--fg-dim);
    min-width: 40px;
}
.setting-row input[type="range"] {
    flex: 1;
    cursor: pointer;
}
.setting-row span {
    font-size: 12px;
    color: var(--accent);
    min-width: 36px;
    text-align: right;
    font-weight: 600;
}
.setting-row select {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-card);
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 8px;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--bg-sidebar);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); }
.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: #b45309; }
.btn.success { background: var(--success); color: white; }
.btn.success:hover { background: #059669; }
.btn.secondary { background: var(--bg-sidebar); color: var(--fg-dim); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg-hover); }
.btn.purple { background: var(--purple); color: white; }
.btn.purple:hover { background: #6d28d9; }

.tool-status {
    font-size: 12px;
    color: var(--fg-dim);
    text-align: center;
    padding: 6px;
    min-height: 28px;
}
.tool-status.success { color: var(--success); font-weight: 600; }
.tool-status.error { color: var(--error); }

/* 音频播放器 */
.audio-player {
    width: 100%;
    border-radius: 8px;
    margin-top: 6px;
}

/* 拖放区 */
.drop-zone {
    border: 2px dashed var(--accent);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-sidebar);
}
.drop-zone:hover, .drop-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-light);
}
.drop-zone .icon { font-size: 36px; margin-bottom: 10px; opacity: 0.7; }
.drop-zone h3 { font-size: 14px; color: var(--fg); margin-bottom: 6px; }
.drop-zone p { font-size: 12px; color: var(--fg-dim); }

.progress-box {
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-sidebar);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: none;
}
.progress-box.active { display: block; }
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s;
}
.progress-text {
    font-size: 11px;
    color: var(--fg-dim);
    text-align: center;
}

/* 音频列表 */
.audio-list {
    min-height: 70px;
    max-height: 100px;
    overflow-y: auto;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
}
.audio-placeholder {
    text-align: center;
    color: var(--fg-light);
    padding: 18px;
    font-size: 12px;
}
.audio-item {
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.audio-item:hover { border-color: var(--accent); }
.audio-item.selected { background: var(--accent-light); border-color: var(--accent); }

.file-input-wrapper {
    position: relative;
    flex: 1;
}
.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 320px;
    overflow: hidden;
}
.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
}
.modal-close {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    color: var(--fg-dim);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
}
.modal-close:hover { background: var(--bg-hover); }
.modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

/* 设置弹窗 */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-label {
    font-size: 13px;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 开关 */
.toggle {
    width: 44px; height: 24px;
    background: var(--toggle-off);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
.toggle.on { background: var(--toggle-on); }
.toggle::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(20px); }

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 6px 0;
    min-width: 150px;
    z-index: 2000;
}
.context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}
.context-menu-hint {
    padding: 6px 14px;
    font-size: 11px;
    color: var(--fg-dim);
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* 用户设置按钮 */
.user-settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.user-settings-btn:hover {
    opacity: 1;
    background: var(--bg-hover);
}

/* 用户设置弹窗 */
.settings-group {
    margin-bottom: 20px;
}
.settings-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--fg);
}
.settings-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.settings-group input:focus {
    outline: none;
    border-color: var(--accent);
}
.settings-input-row {
    display: flex;
    gap: 8px;
}
.settings-input-row input {
    flex: 1;
    margin-bottom: 0;
}
.settings-input-row button {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
.settings-input-row button:hover {
    background: #b45309;
}
.settings-group > button {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.settings-group > button:hover {
    background: #b45309;
}
.settings-message {
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    display: none;
}
.settings-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
}
.settings-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

/* 模型菜单 */
.model-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 8px 0;
    min-width: 160px;
    z-index: 2000;
}
.model-item {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
}
.model-item:hover { background: var(--bg-hover); }
.model-item.selected { color: var(--accent); font-weight: 600; }
.model-item.selected::before { content: '✓ '; }

/* 样式选项 */
.style-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
}
.style-item:hover { background: var(--bg-hover); }
.style-item.selected { color: var(--accent); font-weight: 600; background: var(--accent-light); }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-light); }

/* 响应式 */
@media (max-width: 1200px) {
    .right-panel { width: 360px; }
}
@media (max-width: 900px) {
    body { padding: 10px; }
    .main-container { flex-direction: column; gap: 10px; }
    .claude-section { height: 55vh; }
    .right-panel { width: 100%; height: 43vh; flex-direction: row; gap: 10px; }
    .panel-section { flex: 1; }
    .panel-section.bottom-section { height: auto; }
}

/* ===== 思考过程样式 ===== */
.thinking-block {
    background: var(--bg-thinking);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.thinking-header {
    background: rgba(245, 158, 11, 0.2);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--fg-thinking);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    font-weight: 600;
}

.thinking-content {
    padding: 12px;
    font-size: 13px;
    color: var(--fg-thinking);
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.thinking-status {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--fg-thinking);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 拖拽文件时的样式 */
.input-box.drag-over {
    border: 2px dashed var(--accent) !important;
    background: var(--accent-light) !important;
}

/* 输入框禁用样式 */
.input-box textarea:disabled {
    background: var(--bg-sidebar);
    cursor: not-allowed;
}

/* ===== 用户设置弹窗覆盖层 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-box {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-box .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-box .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
}

.modal-box .modal-body {
    padding: 20px;
}

/* 双击编辑昵称 */
.user-name {
    cursor: pointer;
}
.user-name:hover {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 2px;
}
.user-name-input {
    font-size: 14px;
    font-weight: 600;
    padding: 2px 6px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    width: 100px;
    outline: none;
    background: white;
}

/* ===== 响应式 - 手机适配 ===== */
@media (max-width: 768px) {
    body { 
        padding: 8px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .login-box {
        min-width: unset;
        width: 90%;
        max-width: 360px;
        padding: 30px 25px;
    }
    .login-logo { font-size: 40px; }
    .login-title { font-size: 20px; margin-bottom: 20px; }
    
    .main-container {
        flex-direction: column;
        gap: 10px;
        height: auto;
    }
    
    .claude-section {
        height: 60vh;
        min-height: 350px;
    }
    
    .claude-sidebar { width: 50px; }
    .claude-sidebar.collapsed { width: 50px; }
    
    .chat-header { padding: 10px 12px; }
    .chat-title { font-size: 14px; }
    .messages-area { padding: 12px; }
    
    .input-area { padding: 10px 12px; }
    .input-box textarea { font-size: 16px; }
    .model-selector { font-size: 11px; padding: 5px 8px; }
    .send-btn { width: 32px; height: 32px; }
    
    .right-panel {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        height: auto;
    }
    
    .user-card { padding: 12px; order: -1; }
    .user-name { font-size: 14px; }
    
    .panel-section { width: 100%; }
    .panel-section.top-section { min-height: 280px; }
    .panel-section.bottom-section { height: auto; min-height: 150px; }
    
    .tool-tab { padding: 10px 8px; font-size: 12px; }
    .panel-body { padding: 10px; }
    
    .form-row select, .form-row input { font-size: 14px; }
    .tool-textarea { font-size: 14px; }
    
    .modal-content { width: 95%; max-width: unset; }
    .modal-box { width: 95%; }
    
    .user-list-container { overflow-x: auto; }
    .user-table { min-width: 600px; }
}

@media (max-width: 480px) {
    body { padding: 5px; }
    
    .claude-section {
        height: 55vh;
        min-height: 280px;
        border-radius: 12px;
    }
    
    .chat-header { padding: 8px 10px; }
    .input-area { padding: 8px; }
    
    .user-card { padding: 10px; border-radius: 10px; }
    .user-name { font-size: 13px; }
    
    .panel-section { border-radius: 10px; }
    .tool-tab { padding: 8px 6px; font-size: 11px; }
    .panel-body { padding: 8px; }
    
    .drop-zone { padding: 15px 10px; }
    .drop-zone .icon { font-size: 24px; }
    .drop-zone h3 { font-size: 12px; }
}

/* ===== 右上角用户信息 ===== */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}
.header-user-name {
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-user-name:hover {
    text-decoration: underline;
}
.header-user-level {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}
.header-user-expire {
    font-size: 11px;
    opacity: 0.9;
}
.header-user-balance {
    font-size: 12px;
    font-weight: 600;
    color: #fef08a;
}
.header-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.header-btn:hover {
    background: rgba(255,255,255,0.3);
}
.header-btn.logout {
    background: rgba(239, 68, 68, 0.8);
}
.header-btn.logout:hover {
    background: rgba(239, 68, 68, 1);
}

.header-admin-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

/* ===== 充值弹窗样式 ===== */
.recharge-status {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    color: white;
}
.status-item {
    flex: 1;
    text-align: center;
}
.status-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}
.status-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.recharge-section {
    margin-bottom: 20px;
}
.recharge-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 6px;
}
.recharge-desc {
    font-size: 12px;
    color: var(--fg-dim);
    margin-bottom: 12px;
}

.recharge-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.recharge-option {
    position: relative;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.recharge-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.recharge-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}
.recharge-option.popular {
    border-color: var(--accent);
}
.option-tag {
    position: absolute;
    top: -8px;
    right: 10px;
    padding: 2px 8px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    border-radius: 4px;
}
.option-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
}
.option-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}
.option-detail {
    font-size: 11px;
    color: var(--fg-dim);
}

.recharge-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.recharge-input-row input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}
.recharge-input-row input:focus {
    outline: none;
    border-color: var(--accent);
}
.recharge-unit {
    font-size: 14px;
    color: var(--fg-dim);
}

.recharge-contact {
    padding: 15px;
    background: var(--bg-sidebar);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.contact-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 10px;
}
.contact-info-box {
    text-align: center;
}
.contact-info-box p {
    margin: 6px 0;
    font-size: 13px;
    color: var(--fg-dim);
}
.contact-info-box .wechat-id {
    font-size: 15px;
    color: var(--accent);
}
.contact-info-box .wechat-id strong {
    font-size: 16px;
}
.contact-info-box .contact-tip {
    font-size: 11px;
    color: var(--fg-light);
}

/* 手机端右上角用户信息适配 */
@media (max-width: 768px) {
    .header-user-info {
        padding: 4px 10px;
        gap: 6px;
    }
    .header-user-name {
        font-size: 12px;
        max-width: 60px;
    }
    .header-user-level {
        font-size: 9px;
        padding: 1px 6px;
    }
    .header-user-expire {
        display: none;
    }
    .header-user-balance {
        font-size: 11px;
    }
    .header-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
    .header-admin-controls {
        display: none;
    }
    
    /* 充值弹窗手机适配 */
    .recharge-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .recharge-option {
        padding: 10px 8px;
    }
    .option-name {
        font-size: 13px;
    }
    .option-price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header-user-info {
        padding: 3px 8px;
        gap: 4px;
    }
    .header-user-name {
        max-width: 50px;
    }
    .header-user-balance {
        display: none;
    }
}

/* ===== 右侧面板用户信息卡片 ===== */
.user-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.uic-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.uic-row + .uic-row {
    margin-top: 8px;
}
.uic-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.uic-name:hover {
    text-decoration: underline;
}
.uic-id {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    padding: 2px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.uic-level {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    font-weight: 600;
}
.uic-expire {
    font-size: 11px;
    opacity: 0.9;
}
.uic-balance {
    font-size: 12px;
    font-weight: 600;
    color: #fef08a;
    margin-left: auto;
}
.uic-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.uic-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
}
.uic-btn:hover {
    background: rgba(255,255,255,0.35);
}
.uic-btn.logout {
    background: rgba(239, 68, 68, 0.8);
}
.uic-btn.logout:hover {
    background: rgba(239, 68, 68, 1);
}

/* 定制联系悬浮 - hover时文字变成微信号 */
.uic-contact {
    position: relative;
    cursor: pointer;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    margin-left: auto;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}
.uic-contact:hover {
    background: #D97706;
}
.uic-contact-text {
    display: inline;
}
.uic-contact::after {
    content: 'V：zhaojianghao98';
    display: none;
    font-weight: 600;
}
.uic-contact:hover .uic-contact-text {
    display: none;
}
.uic-contact:hover::after {
    display: inline;
}

/* ===== 手机端用户栏 ===== */
.mobile-user-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.mub-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mub-name {
    font-size: 13px;
    font-weight: 600;
}
.mub-balance {
    font-size: 12px;
    color: #fef08a;
    flex: 1;
}
.mub-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.mub-btn.logout {
    background: rgba(239, 68, 68, 0.8);
}

/* 手机端响应式 */
@media (max-width: 768px) {
    /* 隐藏右侧面板用户卡片，显示手机端用户栏 */
    .user-info-card {
        display: none;
    }
    .mobile-user-bar {
        display: block;
    }
    /* 为手机端顶栏留出空间 */
    .main-container {
        padding-top: 50px;
    }
    /* 隐藏右侧面板 */
    .right-panel {
        display: none !important;
    }
    /* Claude区域全屏 */
    .claude-section {
        height: calc(100vh - 60px);
        min-height: 400px;
    }
}

/* 声音管理弹窗 */
.voice-manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.voice-manager-modal.show {
    display: flex;
}
.voice-manager-box {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.voice-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.voice-manager-header h3 {
    margin: 0;
    font-size: 16px;
}
.voice-manager-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.voice-manager-filter {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}
.voice-manager-filter label {
    font-size: 13px;
    color: #666;
}
.voice-manager-filter select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}
.voice-manager-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}
.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.voice-item:hover {
    background: #f8f8f8;
}
.voice-item-info {
    flex: 1;
}
.voice-item-name {
    font-weight: 600;
    font-size: 14px;
}
.voice-item-owner {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.voice-item-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.voice-item-delete:hover {
    background: #dc2626;
}
