/* JMGL解密工具 - 模块化样式 */

/* ==================== 确保文字横排显示 ==================== */
/* 全局重置，确保所有元素默认为横排 */
.jmgl-decrypt-container,
.jmgl-download-page,
.jmgl-files-table,
.jmgl-files-table table,
.jmgl-files-table th,
.jmgl-files-table td,
.jmgl-stat-card,
.jmgl-usage-item,
.jmgl-decrypt-container .card-input-group,
.jmgl-decrypt-container .card-digit,
.jmgl-decrypt-container .process-step,
.jmgl-decrypt-container .step-content,
.jmgl-decrypt-container .step-title,
.jmgl-decrypt-container .step-status,
.jmgl-decrypt-container .upload-area,
.jmgl-decrypt-container .file-info-box,
.jmgl-decrypt-container .detection-result,
.jmgl-decrypt-container .result-file-box,
.jmgl-modal-container,
.jmgl-modal-body,
.jmgl-modal-footer {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    white-space: normal !important;
}

/* 表格单元格确保横排 */
.jmgl-files-table th,
.jmgl-files-table td {
    text-align: left !important;
    vertical-align: middle !important;
}

/* ==================== 后台管理页面样式 ==================== */
/* 管理页面表格样式 */
.jmgl-card-table-wrap,
.jmgl-card-table-wrap table,
.jmgl-card-table-wrap th,
.jmgl-card-table-wrap td,
.jmgl-table,
.jmgl-table th,
.jmgl-table td {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    white-space: normal !important;
    text-align: left !important;
    vertical-align: middle !important;
}

/* 全选/取消全选标签样式 */
#jmgl-select-all-label,
#jmgl-select-all-label span,
.jmgl-card-table-wrap label,
.jmgl-card-table-wrap label span {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    display: inline !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
}

/* 表格头部样式 */
.jmgl-table thead th {
    text-align: left !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* 文件管理表格样式 */
.jmgl-files-table-wrap,
.jmgl-files-table-wrap table,
.jmgl-files-table-wrap th,
.jmgl-files-table-wrap td {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    text-align: left !important;
    vertical-align: middle !important;
}

.jmgl-decrypt-container {
    max-width: 1200px;
    margin: 20px auto;
}

/* 减少卡片之间的间距 - 仅针对我们的容器 */
.jmgl-decrypt-container .mt20,
.jmgl-download-page .mt20 {
    margin-top: 12px !important;
}

/* 仅针对我们插件内的zib-widget */
.jmgl-decrypt-container .zib-widget,
.jmgl-download-page .zib-widget {
    margin-bottom: 0;
}

.jmgl-decrypt-container .zib-widget .box-title,
.jmgl-download-page .zib-widget .box-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: bold;
}

/* ==================== 自定义标签样式 ==================== */
/* 不再使用自定义标签样式，避免影响主题 */

/* ==================== 验证按钮组 ==================== */
.jmgl-decrypt-container .verify-button-group,
.jmgl-download-page .verify-button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.jmgl-decrypt-container .custom-action-btn,
.jmgl-download-page .custom-action-btn {
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.jmgl-decrypt-container .custom-action-btn:hover,
.jmgl-download-page .custom-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

@media (max-width: 768px) {
    .jmgl-decrypt-container .verify-button-group,
    .jmgl-download-page .verify-button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .jmgl-decrypt-container .verify-button-group .but,
    .jmgl-download-page .verify-button-group .but {
        width: 100%;
    }
}

/* ==================== 流程步骤箭头样式 ==================== */
.jmgl-process-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 10px;
}

.jmgl-decrypt-container .process-step {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--body-bg-color, #f5f5f5);
    border: 2px solid var(--body-bg-color, #e1e8ed);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.jmgl-decrypt-container .process-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.jmgl-decrypt-container .process-step.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.jmgl-decrypt-container .process-step.active .step-number,
.jmgl-decrypt-container .process-step.active .step-title,
.jmgl-decrypt-container .process-step.active .step-status,
.jmgl-decrypt-container .process-step.active .step-icon {
    color: #fff !important;
}

.jmgl-decrypt-container .process-step.completed {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-color: #11998e;
}

.jmgl-decrypt-container .process-step.completed .step-number,
.jmgl-decrypt-container .process-step.completed .step-title,
.jmgl-decrypt-container .process-step.completed .step-status,
.jmgl-decrypt-container .process-step.completed .step-icon {
    color: #fff !important;
}

.jmgl-decrypt-container .step-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--main-color, #667eea);
    color: #fff !important;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

body.dark-theme .jmgl-decrypt-container .step-number {
    color: #fff !important;
    background: #667eea;
}

.jmgl-decrypt-container .process-step.active .step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff !important;
}

.jmgl-decrypt-container .process-step.completed .step-number {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff !important;
}

body.dark-theme .jmgl-decrypt-container .process-step.active .step-number,
body.dark-theme .jmgl-decrypt-container .process-step.completed .step-number {
    color: #fff !important;
}

.jmgl-decrypt-container .step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.jmgl-decrypt-container .step-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--main-color, #333);
}

.jmgl-decrypt-container .process-step.active .step-title,
.jmgl-decrypt-container .process-step.completed .step-title {
    color: #fff !important;
}

body.dark-theme .jmgl-decrypt-container .process-step.active .step-title,
body.dark-theme .jmgl-decrypt-container .process-step.completed .step-title {
    color: #fff !important;
}

.jmgl-decrypt-container .step-status {
    font-size: 12px;
    color: var(--muted-color, #999);
}

.jmgl-decrypt-container .process-step.active .step-status,
.jmgl-decrypt-container .process-step.completed .step-status {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.dark-theme .jmgl-decrypt-container .process-step.active .step-status,
body.dark-theme .jmgl-decrypt-container .process-step.completed .step-status {
    color: rgba(255, 255, 255, 0.9) !important;
}

.jmgl-decrypt-container .step-arrow {
    font-size: 20px;
    color: var(--muted-color, #ccc);
    flex-shrink: 0;
    margin-left: 10px;
}

/* 响应式 */
@media (max-width: 768px) {
    .jmgl-process-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .jmgl-decrypt-container .process-step {
        width: 100%;
    }
    
    .jmgl-decrypt-container .step-arrow {
        display: none;
    }
    
    .jmgl-decrypt-container .step-arrow::before {
        content: '\f078';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
    }
}

/* ==================== 文件上传区域样式 ==================== */
.jmgl-decrypt-container .upload-area {
    border: 3px dashed #e1e8ed;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
    position: relative;
}

body.dark-theme .jmgl-decrypt-container .upload-area {
    background: #1a1a1a;
    border-color: #333;
}

.jmgl-decrypt-container .upload-area:hover {
    border-color: #667eea;
    background: #f5f5f5;
    transform: translateY(-2px);
}

body.dark-theme .jmgl-decrypt-container .upload-area:hover {
    background: #252525;
}

.jmgl-decrypt-container .upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.jmgl-decrypt-container .upload-area i {
    color: #999;
    transition: all 0.3s ease;
    display: block;
    pointer-events: none;
}

body.dark-theme .jmgl-decrypt-container .upload-area i {
    color: #aaa;
}

.jmgl-decrypt-container .upload-area:hover i {
    color: #667eea;
    transform: scale(1.1);
}

.jmgl-decrypt-container .upload-text-main {
    font-size: 16px;
    font-weight: 500;
    color: var(--main-color, #333);
    margin-bottom: 10px;
    margin-top: 10px;
    pointer-events: none;
}

.jmgl-decrypt-container .upload-text-sub {
    font-size: 14px;
    color: var(--muted-2-color, #999);
    pointer-events: none;
}

/* ==================== 文件信息卡片 ==================== */
.jmgl-decrypt-container .file-info-box,
.jmgl-decrypt-container .detection-result,
.jmgl-decrypt-container .result-file-box {
    padding: 20px;
    background: var(--body-bg-color, #f5f5f5);
    border: 1px solid var(--body-bg-color, #e1e8ed);
    border-radius: 8px;
    margin-top: 15px;
}

.jmgl-decrypt-container .file-name-text,
.jmgl-decrypt-container .detection-title,
.jmgl-decrypt-container .result-file-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--main-color, #333);
}

.jmgl-decrypt-container .file-size-text,
.jmgl-decrypt-container .detection-message-text,
.jmgl-decrypt-container .result-file-size {
    font-size: 13px;
    color: var(--muted-color, #999);
}

body.dark-theme .jmgl-decrypt-container .file-info-box,
body.dark-theme .jmgl-decrypt-container .detection-result,
body.dark-theme .jmgl-decrypt-container .result-file-box {
    background: var(--body-bg-color, #1a1a1a);
    border-color: var(--body-bg-color, #333);
}

/* ==================== 卡密输入框 ==================== */
.jmgl-decrypt-container .card-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.jmgl-decrypt-container .card-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #fff !important;
    color: #333 !important;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.jmgl-decrypt-container .card-digit:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    background: #fff !important;
    color: #333 !important;
}

body.dark-theme .jmgl-decrypt-container .card-digit {
    background: #2a2a2a !important;
    border-color: #667eea;
    color: #e0e0e0 !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.dark-theme .jmgl-decrypt-container .card-digit:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* ==================== 进度环 ==================== */
.jmgl-decrypt-container .progress-ring {
    width: 150px;
    height: 150px;
    margin: 20px auto;
    position: relative;
}

.jmgl-decrypt-container .progress-ring svg {
    transform: rotate(-90deg);
}

.jmgl-decrypt-container .progress-bg {
    fill: none;
    stroke: var(--body-bg-color, #e1e8ed);
    stroke-width: 8;
}

.jmgl-decrypt-container .progress-bar {
    fill: none;
    stroke: var(--main-color, #667eea);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.3s ease;
}

.jmgl-decrypt-container .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: var(--main-color, #333);
}

body.dark-theme .jmgl-decrypt-container .progress-bg {
    stroke: var(--body-bg-color, #333);
}

/* ==================== 统计卡片 ==================== */
.jmgl-stat-card {
    background: var(--body-bg-color, #f5f5f5);
    border: 1px solid var(--body-bg-color, #e1e8ed);
    transition: all 0.3s ease;
}

.jmgl-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.jmgl-decrypt-container .stat-label {
    font-size: 12px;
    color: var(--muted-color, #999);
    margin-bottom: 6px;
}

.jmgl-decrypt-container .stat-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--main-color, #333);
}

body.dark-theme .jmgl-stat-card {
    background: var(--body-bg-color, #1a1a1a);
    border-color: var(--body-bg-color, #333);
}

/* ==================== 提示信息 ==================== */
.jmgl-decrypt-container .tips,
.jmgl-download-page .tips {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.jmgl-decrypt-container .tips.warning,
.jmgl-download-page .tips.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--main-color, #856404);
}

body.dark-theme .jmgl-decrypt-container .tips.warning,
body.dark-theme .jmgl-download-page .tips.warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

/* ==================== 通用文字颜色 ==================== */
.jmgl-decrypt-container .box-title,
.jmgl-download-page .box-title {
    color: var(--main-color, #333);
}

.jmgl-decrypt-container .result-success-title,
.jmgl-download-page .result-success-title {
    color: #27ae60;
}

body.dark-theme .jmgl-decrypt-container .result-success-title,
body.dark-theme .jmgl-download-page .result-success-title {
    color: #2ecc71;
}

/* ==================== 自定义确认模态框 ==================== */
.jmgl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: jmglFadeIn 0.3s ease;
}

@keyframes jmglFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.jmgl-modal-container {
    background: var(--main-bg-color, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: jmglSlideUp 0.3s ease;
    overflow: hidden;
}

@keyframes jmglSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.jmgl-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--body-bg-color, #e1e8ed);
    background: var(--body-bg-color, #f5f5f5);
}

body.dark-theme .jmgl-modal-header {
    background: var(--body-bg-color, #1a1a1a);
    border-bottom-color: var(--body-bg-color, #333);
}

.jmgl-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--main-color, #333);
}

.jmgl-modal-body {
    padding: 24px;
}

.jmgl-modal-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--main-color, #666);
    white-space: pre-line;
}

.jmgl-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--body-bg-color, #e1e8ed);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--body-bg-color, #fafafa);
}

body.dark-theme .jmgl-modal-footer {
    background: var(--body-bg-color, #1a1a1a);
    border-top-color: var(--body-bg-color, #333);
}

.jmgl-modal-btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jmgl-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .jmgl-modal-container {
        width: 95%;
        max-width: none;
    }
    
    .jmgl-modal-header,
    .jmgl-modal-body,
    .jmgl-modal-footer {
        padding: 16px 20px;
    }
    
    .jmgl-modal-footer {
        flex-direction: column-reverse;
    }
    
    .jmgl-modal-btn {
        width: 100%;
    }
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .jmgl-decrypt-container .card-digit {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }
    
    .jmgl-decrypt-container .progress-ring {
        width: 120px;
        height: 120px;
    }
    
    .jmgl-decrypt-container .progress-text {
        font-size: 24px;
    }
}

/* ==================== 下载页面夜间模式优化 ==================== */
/* 基础容器 */
.jmgl-download-page {
    background: transparent;
}

/* 用户信息卡片 - 夜间模式优化 */
.jmgl-user-info.zib-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

body.dark-theme .jmgl-user-info.zib-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.jmgl-user-info.zib-widget h3,
.jmgl-user-info.zib-widget p,
.jmgl-user-info.zib-widget strong {
    color: #fff !important;
}

body.dark-theme .jmgl-user-info.zib-widget h3,
body.dark-theme .jmgl-user-info.zib-widget p,
body.dark-theme .jmgl-user-info.zib-widget strong {
    color: #fff !important;
}

/* 搜索栏 - 夜间模式优化 */
.jmgl-search-bar.zib-widget {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    background: #fff;
}

body.dark-theme .jmgl-search-bar.zib-widget {
    background: #1e1e1e;
    border: 1px solid #2d2d2d;
}

.jmgl-search-bar input[type="text"],
.jmgl-search-bar select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: all 0.3s;
}

body.dark-theme .jmgl-search-bar input[type="text"],
body.dark-theme .jmgl-search-bar select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #3d3d3d;
}

body.dark-theme .jmgl-search-bar input[type="text"]:focus,
body.dark-theme .jmgl-search-bar select:focus {
    border-color: #667eea;
    background: #2f2f2f;
    color: #fff;
}

body.dark-theme .jmgl-search-bar input[type="text"]::placeholder {
    color: #888;
}

/* 文件列表表格 - 夜间模式优化 */
.jmgl-files-table.zib-widget {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

body.dark-theme .jmgl-files-table.zib-widget {
    background: #1e1e1e;
    border: 1px solid #2d2d2d;
}

.jmgl-files-table table {
    width: 100%;
    border-collapse: collapse;
}

.jmgl-files-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

body.dark-theme .jmgl-files-table th {
    background: #252525;
    color: #e0e0e0;
    border-bottom-color: #3d3d3d;
}

.jmgl-files-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

body.dark-theme .jmgl-files-table td {
    color: #d0d0d0;
    border-bottom-color: #2d2d2d;
}

.jmgl-files-table tr:hover {
    background: #f8f9fa;
}

body.dark-theme .jmgl-files-table tr:hover {
    background: #252525;
}



/* 分页 - 夜间模式优化 */
.jmgl-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.jmgl-pagination-info {
    color: #666;
    font-size: 14px;
}

body.dark-theme .jmgl-pagination-info {
    color: #aaa;
}

body.dark-theme .jmgl-pagination-info strong {
    color: #e0e0e0;
}

.jmgl-pagination a,
.jmgl-pagination span.page-num,
.jmgl-pagination button {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

body.dark-theme .jmgl-pagination a,
body.dark-theme .jmgl-pagination span.page-num,
body.dark-theme .jmgl-pagination button {
    background: #2a2a2a;
    color: #d0d0d0;
    border-color: #3d3d3d;
}

.jmgl-pagination a:hover,
.jmgl-pagination button:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

body.dark-theme .jmgl-pagination a:hover,
body.dark-theme .jmgl-pagination button:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.jmgl-pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    font-weight: 600;
}

body.dark-theme .jmgl-pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.jmgl-pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.jmgl-pagination-jump input,
.jmgl-per-page-selector select {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    background: #fff;
    color: #333;
}

body.dark-theme .jmgl-pagination-jump input,
body.dark-theme .jmgl-per-page-selector select {
    background: #2a2a2a;
    color: #d0d0d0;
    border-color: #3d3d3d;
}

body.dark-theme .jmgl-pagination-jump input:focus,
body.dark-theme .jmgl-per-page-selector select:focus {
    border-color: #667eea;
    background: #2f2f2f;
    color: #fff;
}

/* 公告栏 - 夜间模式优化（重点优化） */
.jmgl-notice-widget {
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.jmgl-notice-widget-inner {
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
    height: 40px;
    position: relative;
    background: rgba(102, 126, 234, 0.1);
}

body.dark-theme .jmgl-notice-widget-inner {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.jmgl-notice-widget-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
    z-index: 2;
}

body.dark-theme .jmgl-notice-widget-icon {
    filter: brightness(1.2);
}

.jmgl-notice-widget-content {
    flex: 1;
    font-size: 13px;
    height: 40px;
    overflow: hidden;
    position: relative;
}

/* 渐隐遮罩 - 夜间模式优化 */
.jmgl-notice-widget-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.1), transparent);
    z-index: 2;
    pointer-events: none;
}

body.dark-theme .jmgl-notice-widget-content::before {
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.2), transparent);
}

.jmgl-notice-widget-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.1), transparent);
    z-index: 2;
    pointer-events: none;
}

body.dark-theme .jmgl-notice-widget-content::after {
    background: linear-gradient(to top, rgba(102, 126, 234, 0.2), transparent);
}

.jmgl-notice-widget-slider {
    position: relative;
    transition: transform 0.6s ease-in-out;
}

.jmgl-notice-widget-item {
    height: 40px;
    line-height: 40px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
    color: #333;
}

body.dark-theme .jmgl-notice-widget-item {
    color: #e0e0e0;
    font-weight: 500;
}

.jmgl-notice-widget-item a {
    color: #333;
    text-decoration: none;
    transition: opacity 0.3s;
}

body.dark-theme .jmgl-notice-widget-item a {
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.jmgl-notice-widget-item a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

body.dark-theme .jmgl-notice-widget-item a:hover {
    color: #fff;
}

/* 空状态 - 夜间模式优化 */
.jmgl-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

body.dark-theme .jmgl-empty {
    color: #666;
}

.jmgl-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

body.dark-theme .jmgl-empty i {
    opacity: 0.5;
}

/* 文件名截断样式 */
.jmgl-filename-truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    cursor: help;
}

@media (max-width: 768px) {
    .jmgl-filename-truncate {
        max-width: 150px;
    }
}

/* 自定义按钮悬停效果 */
.jmgl-custom-btn {
    transition: all 0.3s ease;
}

.jmgl-custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0.9;
}

body.dark-theme .jmgl-custom-btn {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-theme .jmgl-custom-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .jmgl-files-table {
        overflow-x: auto;
    }
    
    .jmgl-search-bar form {
        flex-direction: column;
    }
    
    .jmgl-search-bar input[type="text"],
    .jmgl-search-bar select {
        width: 100%;
    }
}

/* ==================== 使用帮助折叠框优化 ==================== */
.jmgl-usage-guide {
    margin-top: 10px;
}

.jmgl-usage-item {
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

body.dark-theme .jmgl-usage-item {
    background: #1a1a1a;
    border-color: #333;
}

.jmgl-usage-collapse-header {
    padding: 10px 15px !important;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

body.dark-theme .jmgl-usage-collapse-header {
    background: #252525;
}

.jmgl-usage-collapse-header:hover {
    background: #e8e8e8;
}

body.dark-theme .jmgl-usage-collapse-header:hover {
    background: #2a2a2a;
}

.jmgl-usage-collapse-icon {
    color: #667eea;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.jmgl-usage-collapse-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

body.dark-theme .jmgl-usage-collapse-title {
    color: #e0e0e0;
}

.jmgl-usage-collapse-content {
    padding: 0;
    overflow: hidden;
}

.jmgl-usage-content {
    padding: 12px 15px !important;
    color: #666;
    line-height: 1.8;
    font-size: 14px;
}

body.dark-theme .jmgl-usage-content {
    color: #b0b0b0;
}

.jmgl-usage-content p {
    margin: 6px 0 !important;
}

.jmgl-usage-content p:first-child {
    margin-top: 0 !important;
}

.jmgl-usage-content p:last-child {
    margin-bottom: 0 !important;
}

/* ==================== 描述卡片（使用子比CSS变量自动适配暗色模式） ==================== */
.jmgl-desc-card {
    background: var(--main-bg-color);
}

.jmgl-desc-text {
    color: var(--main-color);
    background: var(--muted-border-color);
}

@media (max-width: 768px) {
    .jmgl-desc-card {
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* ==================== 自定义UI信息框 ==================== */
.jmgl-ui-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: jmglUiFadeIn 0.25s ease;
}

@keyframes jmglUiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.jmgl-ui-dialog {
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: jmglUiSlideUp 0.3s ease;
    background: var(--main-bg-color);
}

@keyframes jmglUiSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.jmgl-ui-dialog-icon-area {
    padding: 28px 24px 0;
    text-align: center;
}

.jmgl-ui-dialog-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.jmgl-ui-dialog-icon.info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.jmgl-ui-dialog-icon.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.jmgl-ui-dialog-icon.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.jmgl-ui-dialog-icon.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.jmgl-ui-dialog-icon.confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.jmgl-ui-dialog-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--key-color);
    margin: 16px 0 8px;
}

.jmgl-ui-dialog-message {
    text-align: center;
    font-size: 14px;
    color: var(--muted-color);
    line-height: 1.7;
    padding: 0 24px;
    white-space: pre-line;
}

.jmgl-ui-dialog-buttons {
    display: flex;
    gap: 0;
    padding: 20px 24px 24px;
    margin-top: 16px;
}

.jmgl-ui-dialog-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.jmgl-ui-dialog-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.jmgl-ui-dialog-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.jmgl-ui-dialog-btn.secondary {
    background: var(--muted-bg-color);
    color: var(--muted-color);
    margin-right: 12px;
}

.jmgl-ui-dialog-btn.single {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* 下载模态框 - 使用子比CSS变量 */
.jmgl-download-modal-content {
    background: var(--main-bg-color) !important;
}

.jmgl-local-section {
    border-color: var(--main-border-color) !important;
}

.jmgl-local-title {
    color: var(--key-color) !important;
}

.jmgl-local-desc {
    color: var(--muted-color) !important;
}

.jmgl-cloud-section {
    border-color: var(--main-border-color) !important;
}

.jmgl-cloud-title {
    color: var(--key-color) !important;
}

.jmgl-cloud-desc {
    color: var(--muted-color) !important;
}

.jmgl-no-download-tip {
    color: var(--muted-color) !important;
}

.jmgl-extract-area {
    background: var(--muted-border-color);
}
