/* ==========================================
   认证申请邮件审核系统 - 全局磨砂玻璃样式
   纯白背景、浅蓝色主色调、响应式布局
   ========================================== */

:root {
    --primary: #87CEFA;
    --primary-dark: #5BB5E8;
    --primary-light: #B0E0F0;
    --danger: #FF6B6B;
    --danger-dark: #E85555;
    --success: #5CB85C;
    --warning: #F0AD4E;
    --white: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --border: rgba(135, 206, 250, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --shadow: 0 4px 20px rgba(135, 206, 250, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #FFFFFF;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    color: #4A90D9;
}

/* ===== 磨砂玻璃卡片 ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

/* ===== 顶部导航栏 ===== */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(135, 206, 250, 0.1);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.navbar .user-info strong {
    color: var(--text);
}

/* ===== 布局 ===== */
.main-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px - 50px);
}

/* ===== 侧边菜单栏 ===== */
.sidebar {
    width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar .menu-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.menu-item {
    margin: 2px 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.5rem;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item a:hover,
.menu-item a.active {
    background: rgba(135, 206, 250, 0.15);
    border-left-color: var(--primary);
    color: var(--primary-dark);
}

/* ===== 内容区 ===== */
.content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

/* ===== 底部页脚 ===== */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-light);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #4A9E4A;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary-dark);
}

.btn-outline:hover {
    background: rgba(135, 206, 250, 0.1);
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #E0993B;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(135, 206, 250, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    min-width: 150px;
}

/* ===== 表格 ===== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.75rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

table th {
    background: rgba(135, 206, 250, 0.1);
    font-weight: 600;
    white-space: nowrap;
}

table tr:hover td {
    background: rgba(135, 206, 250, 0.05);
}

/* ===== 工作台分栏 ===== */
.workspace {
    display: flex;
    gap: 1.2rem;
    min-height: calc(100vh - 280px);
}

.mail-list-panel {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.mail-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mail-body-attach {
    display: flex;
    gap: 1.2rem;
    flex: 1;
}

.mail-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 450px);
    word-wrap: break-word;
}

.mail-attach {
    width: 250px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(100vh - 450px);
}

.mail-list-item {
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.mail-list-item:hover {
    background: rgba(135, 206, 250, 0.08);
}

.mail-list-item.selected {
    background: rgba(135, 206, 250, 0.18);
    border-left: 3px solid var(--primary);
}

.mail-list-item .subject {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-list-item .from {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 3px;
}

.mail-list-item .date {
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.audit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== 智能分析面板 ===== */
.analysis-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.analysis-grid span {
    white-space: nowrap;
}

.analysis-warning {
    background: #FFF9E6;
    border-left: 3px solid var(--warning);
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.analysis-danger {
    background: #FFF3E0;
    border-left: 3px solid #F57C00;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.analysis-success {
    background: #E8F5E9;
    border-left: 3px solid var(--success);
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.reject-reason {
    width: 100%;
}

.reject-reason textarea {
    width: 100%;
    min-height: 70px;
    margin-bottom: 0.5rem;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(135, 206, 250, 0.2);
    padding: 1.5rem;
    min-width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ===== 标签/徽章 ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: #E8F5E9; color: #388E3C; }
.badge-danger { background: #FFEBEE; color: #D32F2F; }
.badge-warning { background: #FFF3E0; color: #F57C00; }
.badge-info { background: #E3F2FD; color: #1976D2; }

/* ===== 开关 ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ===== 加载动画 ===== */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading.active {
    display: block;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Toast消息提示 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary-dark); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== 权限复选框 ===== */
.perm-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.3rem;
}

.perm-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.perm-checkboxes label:hover {
    background: rgba(135, 206, 250, 0.08);
}

.perm-checkboxes input:checked + span {
    color: var(--primary-dark);
    font-weight: 500;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* ===== 快捷键样式 ===== */
kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: "SF Mono", "Monaco", "Menlo", monospace;
    color: #333;
    background: #f7f7f7;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 0 #bbb;
    margin: 0 2px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0.5rem;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .menu-item a {
        padding: 0.45rem 0.8rem;
        font-size: 0.8rem;
        border-left: none;
        border-radius: 6px;
    }

    .workspace {
        flex-direction: column;
    }

    .mail-list-panel {
        width: 100%;
        max-height: 250px;
    }

    .mail-body-attach {
        flex-direction: column;
    }

    .mail-attach {
        width: 100%;
        max-height: 200px;
    }

    .mail-body,
    .mail-attach {
        max-height: none;
    }

    .modal {
        min-width: auto;
        width: 95vw;
    }

    .content {
        padding: 1rem;
    }

    .navbar {
        padding: 0 1rem;
    }
}

/* ===== 附件批注层 ===== */
#wbAnnotationCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

#wbAnnotateContainer {
    position: relative;
    overflow: hidden;
    display: inline-block;
    max-width: 100%;
}

/* ===== 附件文件库表格样式增强 ===== */
.table-wrap td .btn {
    white-space: nowrap;
}

/* ===== 附件相关通用样式 ===== */
.attach-preview-wrap {
    text-align: center;
    max-height: 70vh;
    overflow: auto;
}

.attach-preview-wrap img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* ===== 协作留言板 ===== */
.comment-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.comment-body {
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== 任务分配状态区 ===== */
#assignContent {
    font-size: 0.85rem;
}

#assignContent .btn {
    vertical-align: middle;
}
