/* ==========================================
   消息交互平台 - 类似QQ/微信风格
   ========================================== */

:root {
    --sidebar-width: 280px;
    --header-height: 60px;
    --primary-color: #07C160;
    --primary-hover: #06AD56;
    --bg-color: #EDEDED;
    --sidebar-bg: #2E3238;
    --sidebar-hover: #3A3F45;
    --header-bg: #FFFFFF;
    --msg-self-bg: #95EC69;
    --msg-other-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #999999;
    --text-light: #FFFFFF;
    --border-color: #E6E6E6;
    --danger-color: #FA5151;
    --bot-color: #E91E63;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg-color);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
}

/* ==================== 登录页面 ==================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90vw;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 24px;
    color: #333;
}

.login-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 20px;
    font-size: 14px;
}

/* 登录/注册切换 */
.login-mode {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.mode-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 15px;
    color: #999;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.mode-tab:hover {
    color: #666;
}

.mode-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* 登录提示 */
.login-hint {
    margin-top: 20px;
    padding: 12px 16px;
    background: #FFF3E0;
    border-radius: 8px;
    font-size: 13px;
    color: #E65100;
    line-height: 1.8;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #666;
}

.login-box input,
.login-box select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.login-box input:focus,
.login-box select:focus {
    border-color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: var(--primary-hover);
}

/* ==================== 主布局 ==================== */

.app-container {
    display: flex;
    height: 100vh;
    display: none;
}

/* ==================== 侧边栏 ==================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-header h2 {
    color: var(--text-light);
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #44D7B6;
    margin-right: 6px;
}

.sidebar-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.sidebar-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-tab.active {
    color: #fff;
    border-bottom-color: var(--primary-color);
}

.sidebar-tab .badge {
    display: inline-block;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* 在线用户列表 */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-item:hover {
    background: var(--sidebar-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
}

.user-avatar.bot-avatar {
    border: 2px solid var(--bot-color);
}

.user-avatar .online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--sidebar-bg);
}

.user-avatar .online-dot.online {
    background: #44D7B6;
}

.user-avatar .online-dot.offline {
    background: #999;
}

.user-info {
    margin-left: 12px;
    flex: 1;
    min-width: 0;
}

.user-name {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-name .bot-tag {
    display: inline-block;
    background: var(--bot-color);
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.user-status {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 2px;
}

/* ==================== 主聊天区域 ==================== */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.chat-header {
    height: var(--header-height);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.chat-header .header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.header-btn:hover {
    background: #e8e8e8;
}

/* ==================== 消息区域 ==================== */

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

.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* 消息气泡 */
.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.self {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.message-body {
    max-width: 60%;
    margin: 0 12px;
}

.message .sender-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.message.self .sender-name {
    text-align: right;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
}

.message.self .message-bubble {
    background: var(--msg-self-bg);
    border-top-right-radius: 2px;
}

.message.other .message-bubble {
    background: var(--msg-other-bg);
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.message.bot-message .message-bubble {
    background: #FFF0F5;
    border: 1px solid #FFD6E0;
    border-top-left-radius: 2px;
}

/* 消息中的 @提及 高亮 */
.mention-highlight {
    color: #E91E63;
    font-weight: 600;
    background: rgba(233, 30, 99, 0.08);
    padding: 0 3px;
    border-radius: 3px;
}

.message .message-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.message.self .message-time {
    text-align: right;
}

/* 系统消息 */
.system-message {
    text-align: center;
    margin: 12px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.system-message span {
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 4px;
}

/* ==================== 输入区域 ==================== */

.input-area {
    padding: 12px 20px;
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative; /* 作为@提及弹窗的锚点 */
}

.input-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.toolbar-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    transition: color 0.2s;
}

.toolbar-btn:hover {
    color: var(--primary-color);
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-row textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    padding: 8px 4px;
    background: transparent;
}

.send-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.send-btn:hover {
    background: var(--primary-hover);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==================== Bot 状态面板 ==================== */

.bot-panel {
    position: fixed;
    right: -320px;
    top: 0;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.bot-panel.open {
    right: 0;
}

.bot-panel-header {
    padding: 20px;
    background: var(--bot-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-panel-header h3 {
    font-size: 16px;
}

.bot-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.bot-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.bot-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bot-status-label {
    font-size: 14px;
    color: #666;
}

.bot-status-value {
    font-size: 14px;
    font-weight: 500;
}

.bot-log-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid var(--primary-color);
}

.bot-log-item.failed {
    border-left-color: var(--danger-color);
}

.bot-log-item .log-time {
    font-size: 11px;
    color: #999;
}

.bot-log-item .log-request {
    margin: 4px 0;
    font-weight: 500;
}

.bot-log-item .log-status {
    font-size: 12px;
    color: var(--primary-color);
}

.bot-log-item.failed .log-status {
    color: var(--danger-color);
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        z-index: 100;
        height: 100vh;
        display: none;
    }

    .sidebar.show {
        display: flex;
    }

    .main-area {
        width: 100%;
    }

    .message-body {
        max-width: 80%;
    }

    .bot-panel {
        width: 100%;
        right: -100%;
    }
}

/* ==================== @提及弹窗 ==================== */

.mention-popup {
    position: absolute;
    bottom: 100%;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
    transform-origin: bottom center;
    z-index: 999;
}

.mention-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mention-popup-header {
    padding: 10px 16px;
    font-size: 12px;
    color: #999;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.mention-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f5f5f5;
}

.mention-item:hover,
.mention-item.selected {
    background: #f0f8ff;
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.mention-info {
    margin-left: 12px;
    flex: 1;
    min-width: 0;
}

.mention-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.mention-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.mention-tag {
    font-size: 11px;
    color: #E91E63;
    background: #FFF0F5;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 指令选择列表 */
.mention-instruction-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
}

.mention-instruction-item:hover {
    background: #f5f5f5;
}

.mention-instruction-item:active {
    background: #e8e8e8;
}

.mention-instruction-item.need-file {
    border-left: 3px solid #FF9800;
}

.mention-instruction-item.need-date {
    border-left: 3px solid #2196F3;
}

.mention-instruction-item.need-file.need-date {
    border-left: 3px solid #9C27B0;
}

.mention-ins-icon {
    font-size: 16px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.mention-ins-text {
    font-size: 14px;
    color: #333;
}

/* 输入区域相对定位，作为弹窗的锚点 */

/* ==================== 管理面板 ==================== */

.side-panel {
    position: fixed;
    right: -380px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.admin-panel-header {
    padding: 20px;
    background: #FF5722;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.admin-panel-header h3 {
    font-size: 16px;
}

.admin-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.admin-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.admin-tab:hover {
    color: #333;
    background: #f5f5f5;
}

.admin-tab.active {
    color: #FF5722;
    border-bottom-color: #FF5722;
    font-weight: 600;
}

.admin-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.admin-user-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.admin-user-item:hover {
    background: #fafafa;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.admin-user-info {
    margin-left: 12px;
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.admin-user-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.admin-badge {
    display: inline-block;
    background: #FF5722;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.bot-badge {
    display: inline-block;
    background: #E91E63;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.admin-del-btn {
    padding: 4px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    color: #FA5151;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.admin-del-btn:hover {
    background: #FFF0F0;
    border-color: #FA5151;
}

/* 创建用户表单 */
.admin-create-user {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.admin-create-scheduled {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    align-items: center;
}

.admin-create-input {
    flex: 1;
    min-width: 80px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.admin-create-input:focus {
    border-color: #FF5722;
}

.admin-create-btn {
    padding: 6px 16px;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-create-btn:hover {
    background: #E64A19;
}

.admin-user-count {
    padding: 8px 12px;
    font-size: 12px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
}

/* 配置表单 */
.admin-config-form {
    padding: 16px;
}

.config-group {
    margin-bottom: 14px;
}

.config-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.config-group input:focus,
.config-group select:focus {
    border-color: #FF5722;
}

.config-save-btn {
    width: 100%;
    padding: 10px;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.config-save-btn:hover {
    background: #E64A19;
}

/* 日志列表 */
.admin-log-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    border-left: 3px solid #07C160;
}

.admin-log-item.failed {
    border-left-color: #FA5151;
}

.admin-log-time {
    font-size: 11px;
    color: #999;
}

.admin-log-req {
    margin: 4px 0;
    color: #333;
    font-weight: 500;
}

.admin-log-status {
    font-size: 12px;
    color: #07C160;
}

.admin-log-item.failed .admin-log-status {
    color: #FA5151;
}

/* 任务队列 */
.admin-task-stats {
    padding: 10px 12px;
    font-size: 12px;
    color: #666;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.admin-task-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.admin-task-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-task-ins {
    font-weight: 500;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-task-status {
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 8px;
}

.admin-task-meta {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.admin-task-result {
    font-size: 12px;
    color: #07C160;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f0faf0;
    border-radius: 4px;
}

.admin-task-error {
    font-size: 12px;
    color: #FA5151;
    margin-top: 4px;
    padding: 4px 8px;
    background: #FFF0F0;
    border-radius: 4px;
}

/* 指令管理 */
.ins-add-form {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.ins-add-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.ins-add-input:focus {
    border-color: #FF5722;
}

.ins-add-btn {
    padding: 7px 16px;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.ins-add-btn:hover {
    background: #E64A19;
}

.ins-count {
    padding: 8px 12px;
    font-size: 12px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
}

.ins-check-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ins-date-format-row {
    font-size: 13px;
    color: #666;
}

.ins-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.ins-item:hover {
    background: #fafafa;
}

.ins-icon {
    font-size: 18px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.ins-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    margin-left: 8px;
}

.ins-file-badge {
    font-size: 14px;
    margin-left: 4px;
}

.ins-need-file-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    cursor: pointer;
}

.ins-need-file-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.ins-del-btn {
    padding: 4px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    color: #FA5151;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ins-del-btn:hover {
    background: #FFF0F0;
    border-color: #FA5151;
}

@media (max-width: 768px) {
    .side-panel {
        width: 100%;
        right: -100%;
    }
}

/* 邮件桥接 */
.email-status-bar {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}
.email-status-bar.ok { background: #f0faf0; color: #07C160; }
.email-status-bar.warn { background: #FFF8E1; color: #FF9800; }

.email-help {
    padding: 16px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.mail-server-bar {
    padding: 12px 16px;
    background: #E8F5E9;
    border-bottom: 1px solid #C8E6C9;
}

.mail-server-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-server-label {
    font-size: 14px;
    font-weight: 500;
    color: #2E7D32;
}

.mail-server-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: white;
}

/* 邮件系统界面 */
.email-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.email-tabs-mini {
    display: flex;
    gap: 4px;
}

.email-tab-mini {
    padding: 5px 14px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.15s;
}
.email-tab-mini:hover { background: #eee; }
.email-tab-mini.active {
    background: #FF5722;
    color: white;
}

.email-refresh-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 12px;
    cursor: pointer;
}
.email-refresh-btn:hover { background: #f5f5f5; }

.email-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.email-auto-indicator {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #eee;
    color: #999;
    cursor: default;
}
.email-auto-indicator.active {
    background: #E8F5E9;
    color: #07C160;
    animation: autoPulse 2s ease-in-out infinite;
}

@keyframes autoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.email-list-header {
    display: flex;
    padding: 8px 16px;
    font-size: 12px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
}

.email-item {
    display: flex;
    padding: 10px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}
.email-item:hover { background: #fafafa; }
.email-item.unread { font-weight: 600; background: #FFF8E1; }
.email-item.unread:hover { background: #FFF3CD; }

.email-col-from {
    width: 160px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-col-subject {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-col-time {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    color: #999;
    font-size: 12px;
}

/* 邮件详情 */
.email-detail-header {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
}

.email-back-btn {
    padding: 5px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    cursor: pointer;
}
.email-back-btn:hover { background: #f5f5f5; }

.email-del-btn {
    padding: 5px 14px;
    border: 1px solid #FA5151;
    border-radius: 4px;
    background: white;
    color: #FA5151;
    font-size: 13px;
    cursor: pointer;
}
.email-del-btn:hover { background: #FFF0F0; }

.email-detail-meta {
    padding: 16px;
    font-size: 13px;
    line-height: 2;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.email-detail-body {
    padding: 20px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 写邮件 */
.compose-email-form {
    padding: 16px;
}
.compose-field {
    margin-bottom: 12px;
}
.compose-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}
.compose-actions {
    display: flex;
    align-items: center;
    margin-top: 16px;
}