/* ============================================
   主题系统 - 两套完整的颜色模板
   ============================================ */

/* 深色主题（默认） */
:root,
body.theme-dark {
    /* 文字颜色 */
    --text-primary: #dadada;
    --text-secondary: #999999;
    --text-tertiary: #666666;
    --text-disabled: #555555;
    
    /* 背景颜色 */
    --background-nav: #212122;
    --background-gray-main: #272728;
    --background-card: #2d2d2e;
    --background-hover: rgba(255, 255, 255, 0.08);
    --background-active: rgba(255, 255, 255, 0.15);
    --background-input: #1e1e1f;
    
    /* 边框颜色 */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    
    /* 品牌色 */
    --color-primary: #667eea;
    --color-primary-hover: #5568d3;
    --color-success: #4caf50;
    --color-error: #f44336;
    --color-warning: #ffc107;
    --color-warning-bg: rgba(255, 195, 7, 0.1);
    --color-warning-border: rgba(255, 195, 7, 0.3);
    --color-warning-text: #ffc107;
    
    /* 图标和Logo */
    --logo-color: var(--text-primary);
    --icon-primary: var(--text-primary);
    --icon-secondary: var(--text-primary);
    --icon-disable: var(--text-disabled);
    
    /* 按钮颜色 */
    --btn-submit-bg: #ffffff;
    --btn-submit-bg-hover: #f5f5f5;
    --btn-submit-icon: #1a1a19;
    
    /* 特殊用途 */
    --placeholder-color: #666666;
    --divider-color: rgba(255, 255, 255, 0.1);
}

/* 亮色主题 */
body.theme-light {
    /* 文字颜色 */
    --text-primary: #34322d;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-disabled: #cccccc;
    
    /* 背景颜色 */
    --background-nav: #f5f5f5;
    --background-gray-main: #f8f8f7;
    --background-card: #ffffff;
    --background-hover: rgba(0, 0, 0, 0.04);
    --background-active: rgba(0, 0, 0, 0.08);
    --background-input: #fafafa;
    
    /* 边框颜色 */
    --border-primary: #e8e8e8;
    --border-secondary: #f0f0f0;
    --border-hover: #d0d0d0;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 品牌色（亮色主题下可能需要稍微调整） */
    --color-primary: #667eea;
    --color-primary-hover: #5568d3;
    --color-success: #4caf50;
    --color-error: #f44336;
    --color-warning: #ffc107;
    --color-warning-bg: #fff3cd;
    --color-warning-border: #ffc107;
    --color-warning-text: #856404;
    
    /* 图标和Logo */
    --logo-color: var(--text-primary);
    --icon-primary: var(--text-primary);
    --icon-secondary: var(--text-primary);
    --icon-disable: var(--text-disabled);
    
    /* 按钮颜色 */
    --btn-submit-bg: #1a1a1a;
    --btn-submit-bg-hover: #2a2a2a;
    --btn-submit-icon: #ffffff;
    
    /* 特殊用途 */
    --placeholder-color: #999999;
    --divider-color: #e8e8e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局文字颜色 */
* {
    color: var(--text-primary);
}

/* 登录弹窗样式已移至 login-modal/login-modal.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px; /* 基础字体大小 */
    line-height: 1.5; /* 基础行高 */
    font-weight: 400; /* 基础字体粗细 */
    background: var(--background-gray-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* 上下布局：导航栏在上，主内容在下 */
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
}

/* 全局字体工具类 */
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 20px; }
.text-3xl { font-size: 24px; }
.text-4xl { font-size: 28px; }
.text-5xl { font-size: 48px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }

/* 通用工具类 */
.hidden { display: none !important; }

/* 消息容器样式 */
.message-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 12px auto;
    padding: 0 20px;
}

/* 文件列表容器样式 */
.file-list-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 12px auto;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    min-width: 280px; /* 确保最小宽度 */
    max-width: 280px; /* 确保最大宽度 */
    flex: 0 0 280px; /* 不增长，不缩小，固定280px */
    background-color: var(--background-nav);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative; /* 确保定位正确 */
    flex-shrink: 0; /* 明确禁止缩小 */
}

.sidebar-header {
    /* 左侧与下方菜单图标对齐：下方菜单整体左边距为 8px(sidebar-content) + 20px(menu-link) = 28px */
    padding: 20px 8px 0 28px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: block;
    color: var(--icon-secondary);
}

.sidebar-content {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.sidebar-menu-wrapper {
    flex: 1;
}

.sidebar-footer {
    padding: 12px 8px;
    margin-top: auto;
}

.sidebar-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 主题切换按钮 */
.theme-toggle-btn {
    width: 100%;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--border-primary);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.theme-toggle-btn:hover {
    border-color: var(--border-hover);
}

/* 主题切换段 */
.theme-toggle-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.theme-toggle-segment-light {
    opacity: 0.9;
}

.theme-toggle-segment-dark {
    opacity: 0.9;
}

/* 亮色主题激活时，亮色段高亮 */
body.theme-light .theme-toggle-segment-light {
    background: var(--background-active);
}

/* 暗色主题激活时，暗色段高亮 */
body.theme-dark .theme-toggle-segment-dark {
    background: var(--background-active);
}

.theme-toggle-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

.theme-toggle-icon path {
    fill: currentColor;
}

/* 默认深色主题：显示深色图标，隐藏浅色图标 */
.theme-toggle-icon-light {
    display: none;
}

.theme-toggle-icon-dark {
    display: block;
}

/* 浅色主题：显示浅色图标，隐藏深色图标 */
body.theme-light .theme-toggle-icon-light {
    display: block;
}

body.theme-light .theme-toggle-icon-dark {
    display: none;
}

.sidebar-footer-item {
    margin: 0;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-footer-link:hover {
    background: #ffffff0f;
    color: var(--text-primary);
}

.sidebar-footer-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: inline-block;
    flex-shrink: 0;
    font-size: 16px;
}

.sidebar-footer-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 侧边栏菜单项 */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu-item {
    margin: 0 0 2px 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-menu-link:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.sidebar-menu-link.active {
    background: var(--background-active);
    color: var(--text-primary);
    border-radius: 8px;
    font-weight: 600;
}

.sidebar-menu-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: inline-block;
    flex-shrink: 0;
    font-size: 18px;
}

.sidebar-menu-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 父级菜单 */
.sidebar-menu-link.parent {
    cursor: pointer;
}

.sidebar-menu-link.parent::after {
    content: '▶';
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.sidebar-menu-link.parent.expanded::after {
    transform: rotate(90deg);
}

/* 子菜单 */
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-submenu.expanded {
    max-height: 1000px;
}

.sidebar-submenu-item {
    margin: 0;
}

.sidebar-submenu-link {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 52px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-submenu-link:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.sidebar-submenu-link.active {
    background: var(--background-active);
    color: var(--text-primary);
    font-weight: 500;
}

/* 右侧主内容区域 */
.main-content {
    flex: 1 1 auto; /* 允许增长和缩小，占据剩余空间 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0; /* 允许flex子元素缩小到内容宽度以下 */
    position: relative; /* 为 control-bar 的绝对定位提供定位上下文 */
    background-color: var(--background-gray-main);
}

/* 页面容器 */
.page-container {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.page-container.active {
    display: flex;
}

/* 新建任务页面 */
.page-new-task {
    display: flex;
    flex-direction: column;
}

/* 作品库页面 */
.page-works {
    padding: 40px;
    overflow-y: auto;
}

.works-header {
    margin-bottom: 30px;
}

.works-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.works-header p {
    color: var(--text-primary);
    font-size: 14px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.work-card {
    background: var(--background-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.work-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

/* 缩略图区域占满卡片宽度，限制最大高度 */
.work-card-thumbnail {
    width: 100%;
    max-height: 600px;
    aspect-ratio: 16/9;
    background: var(--background-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

/* 图片按原始比例显示在 16:9 容器内，不裁剪，限制大小 */
.work-card-thumbnail img,
.work-card-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.work-card-info {
    padding: 16px;
}

.work-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 所有任务页面 */
.page-all-tasks {
    padding: 40px;
    overflow-y: auto;
}

.tasks-header {
    margin-bottom: 30px;
}

.tasks-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background: var(--background-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-item:hover {
    border-color: var(--border-hover);
    background: var(--background-hover);
}

.task-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-item-time {
    font-size: 13px;
    color: var(--text-primary);
}

.task-item-preview {
    font-size: 14px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 对话记录页面 */
.page-conversation {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversation-header {
    padding: 20px 40px;
    border-bottom: 1px solid var(--divider-color);
    background: var(--background-card);
}

.conversation-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.conversation-messages {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1200px; /* 与输入框对齐 */
    margin: 0 auto; /* 居中 */
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 120px; /* 为置底的输入框留出空间 */
}

.message-item {
    display: flex;
    gap: 16px;
    max-width: 800px; /* 消息的最大宽度，保持自然宽度 */
}

.message-item.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

/* 不显示角色（ME/AI），仅展示消息内容 */
.message-avatar {
    display: none;
}

.message-content {
    flex: 1;
    background: var(--background-input);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.message-item.user .message-content {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

/* 设置引导界面 */
.settings-guide {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 12px;
}

.setting-item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-item label {
    min-width: 100px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 14px;
    background: var(--background-card);
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-start-processing,
.btn-use-defaults {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start-processing {
    background: #667eea;
    color: white;
}

.btn-start-processing:hover {
    background: #5568d3;
}

.btn-use-defaults {
    background: var(--background-input);
    color: var(--text-tertiary);
}

.btn-use-defaults:hover {
    background: var(--background-hover);
}

.countdown-display {
    margin-top: 16px;
    padding: 12px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-radius: 6px;
    text-align: center;
    color: var(--color-warning-text);
    font-size: 14px;
}

.countdown-display #countdownValue {
    font-weight: 600;
    color: #f57c00;
}

.header {
    padding: 0 40px 40px;
    margin-top: 15%;
    text-align: center;
    transition: opacity 0.3s ease;
}

.header.hidden {
    opacity: 0;
    padding: 20px 20px 10px;
}

.header h1 {
    color: #34322d;
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 0;
    font-family: 'Noto Serif SC', 'Noto Serif SC Fallback', 'SimSun', '宋体', 'NSimSun', '新宋体', serif;
    letter-spacing: -0.5px;
    transition: font-size 0.3s ease;
}

.header.hidden h1 {
    font-size: 24px;
}

.header .subtitle {
    display: none;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow-y: auto;
    transition: justify-content 0.3s ease;
}

.content.has-content {
    justify-content: flex-start;
    padding-top: 60px;
    padding-bottom: 120px; /* 确保有足够空间，不与按钮重叠 */
}

.control-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

.control-bar.fixed {
    position: fixed;
    bottom: 0;
    left: 0; /* Portal 页面没有 sidebar，从左边开始 */
    right: 0;
    padding: 20px 40px 40px;
    border-top: 1px solid var(--divider-color);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center; /* 居中内容 */
}

.control-bar.fixed .input-container {
    max-width: 1200px; /* 与对话消息对齐 */
    width: 100%;
    margin: 0 auto;
}

.control-bar.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; /* 在主页时拉伸到全宽 */
    max-width: 1200px;
    padding: 0 40px;
    bottom: auto;
}

/* Manus 风格的输入框容器 - 大输入框 */
.input-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    background: var(--background-card);
    border-radius: 12px;
    padding: 0;
    gap: 0;
    transition: all 0.2s ease;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    min-height: 80px;
    position: relative;
}

.input-container:focus-within {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

/* 输入框内部的上边缘区域（用于显示上传状态） */
.input-top-bar {
    display: none;
    padding: 8px 16px;
    border-bottom: 1px solid var(--divider-color);
    background: var(--background-hover);
    border-radius: 12px 12px 0 0;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.input-top-bar.has-files {
    display: flex;
}

/* 文件上传状态项 */
.file-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--background-card);
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--border-primary);
}

.file-status-item.uploading {
    border-color: #667eea;
}

.file-status-item.success {
    border-color: #4caf50;
}

.file-status-item.error {
    border-color: #f44336;
}

.file-status-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-status-icon.uploading {
    animation: spin 1s linear infinite;
}

.file-status-name {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-status-size {
    color: var(--text-primary);
    font-size: 12px;
}

/* 文件状态项右上角关闭按钮 */
.file-status-close {
    margin-left: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

.file-status-close:hover {
    color: var(--text-primary);
}

/* 总时长显示 */
.total-duration {
    padding: 4px 12px;
    background: var(--background-input);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.total-duration-label {
    color: var(--text-primary);
    font-size: 12px;
}

/* 输入框主体区域 */
.input-main-area {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
    flex: 1;
}

/* 左侧图标组 */
.input-left-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    border: none;
    background: var(--background-input);
    border-radius: 8px;
    padding: 0;
    font-size: 20px;
    flex-shrink: 0;
}

.input-icon:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* 输入框 */
.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: inherit;
    line-height: 1.6;
    min-height: 40px;
    resize: none;
}

.chat-input::placeholder {
    color: var(--text-primary);
}

/* 右侧按钮组 */
.input-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action-primary {
    background: var(--btn-submit-bg);
    font-size: 18px;
    font-weight: 400;
    padding: 0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
}

.btn-action-primary:hover:not(:disabled) {
    background: var(--btn-submit-bg-hover);
}

.btn-action-primary:disabled {
    background: var(--background-input);
    cursor: not-allowed;
}

.btn-action-primary svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* Enabled 状态下箭头颜色使用主题变量 */
.btn-action-primary:not(:disabled) svg path {
    fill: var(--btn-submit-icon);
}

/* Disabled 状态下箭头颜色使用主题变量 */
.btn-action-primary:disabled svg path {
    fill: var(--icon-disable);
}

/* 旧的按钮样式（保留用于兼容） */
.btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-add:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-submit:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none; /* 禁用点击事件 */
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}


.btn-primary {
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 30px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--background-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #f8f9fa;
}

/* 上传进度遮罩 */
.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.upload-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.upload-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 0;
    display: none;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
    color: var(--text-tertiary);
}

/* 弹框遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

/* 弹框 */
.modal {
    background: var(--background-card);
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--divider-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--background-input);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--divider-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.modal-btn-primary {
    background: #667eea;
    color: white;
}

.modal-btn-primary:hover {
    background: #5568d3;
}

/* 错误提示和成功提示 - 含关闭按钮 */
.error-message,
.success-message {
    position: relative;
    padding-right: 36px;
}

.error-message .message-close,
.success-message .message-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.error-message .message-close:hover,
.success-message .message-close:hover {
    opacity: 1;
}

.error-message {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: none;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-warning-border);
}

.error-message.show {
    display: block;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2e7d32;
}

.success-message.show {
    display: block;
}

/* 登录弹窗样式已移至 login-modal/login-modal.css */
