/**
 * batch-common.css — 批量制图公共样式
 * 包含 modal、toast、loading、按钮等可复用组件样式
 */

/* ==================== 基础 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

/* ==================== Header ==================== */
.header {
    background: linear-gradient(135deg, #0f3460, #16213e);
    padding: 12px 24px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #00ff88;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Arial Black', sans-serif;
    font-size: 11px; font-weight: 900; color: #1a1a2e;
    letter-spacing: -1px;
}
.header .back-link {
    color: #4fc3f7;
    text-decoration: none;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.15s;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
}
.header .back-link:hover {
    background: rgba(255,255,255,0.15);
    border-color: #00ff88;
}

/* ==================== 布局 ==================== */
.main-container {
    display: flex;
    height: calc(100vh - 50px);
    margin-top: 50px;
}

/* ==================== 左侧 Sidebar ==================== */
.sidebar {
    width: 320px;
    background: #16213e;
    border-right: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-header h2 {
    font-size: 14px;
    font-weight: 500;
}
.add-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(0,255,136,0.15);
    border: 1px solid rgba(0,255,136,0.3);
    color: #00ff88;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.add-btn:hover {
    background: rgba(0,255,136,0.3);
}

/* ==================== 任务列表 ==================== */
.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.task-item {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: all 0.15s;
}
.task-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.task-item.active {
    background: rgba(0,255,136,0.08);
    border-color: rgba(0,255,136,0.25);
}
.task-item .task-header {
    display: flex;
    align-items: flex-start;
}
.task-item .project-name {
    font-size: 13px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 2px;
    word-break: break-all;
}
.task-item .file-name {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-item .created-time {
    font-size: 11px;
    color: #555;
}
.task-item .meta {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    font-size: 11px;
    color: #666;
}
.task-item .rename-btn,
.task-item .reparse-btn,
.task-item .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
    opacity: 0.5;
}
.task-item:hover .rename-btn,
.task-item:hover .reparse-btn,
.task-item:hover .delete-btn {
    opacity: 1;
}
.task-item .rename-btn:hover { background: rgba(255,152,0,0.15); }
.task-item .reparse-btn:hover { background: rgba(0,188,212,0.15); }
.task-item .delete-btn:hover { background: rgba(255,68,68,0.15); }
.project-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.project-type-badge.type-3cc {
    background: linear-gradient(135deg, rgba(255,152,0,0.2), rgba(255,87,34,0.15));
    color: #ffab40;
    border: 1px solid rgba(255,152,0,0.35);
    text-shadow: 0 0 8px rgba(255,152,0,0.3);
}
.project-type-badge.type-v1 {
    background: linear-gradient(135deg, rgba(0,150,255,0.2), rgba(41,98,255,0.15));
    color: #64b5f6;
    border: 1px solid rgba(0,150,255,0.35);
    text-shadow: 0 0 8px rgba(0,150,255,0.3);
}
/* DRAN/CRAN 图纸子类型标签 */
.drawing-subtype-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.drawing-subtype-badge.subtype-cran {
    background: linear-gradient(135deg, rgba(0,200,83,0.18), rgba(76,175,80,0.12));
    color: #69f0ae;
    border: 1px solid rgba(0,200,83,0.35);
    text-shadow: 0 0 8px rgba(0,200,83,0.3);
}
.drawing-subtype-badge.subtype-dran {
    background: linear-gradient(135deg, rgba(171,71,188,0.18), rgba(186,104,200,0.12));
    color: #ea80fc;
    border: 1px solid rgba(171,71,188,0.35);
    text-shadow: 0 0 8px rgba(171,71,188,0.3);
}

/* ==================== 映射弹窗（分页标签式） ==================== */
.mapping-info-bar {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.mapping-tabs-bar {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid #0f3460;
    overflow-x: auto;
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.mapping-tabs-bar::-webkit-scrollbar { height: 3px; }
.mapping-tabs-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.mapping-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    border: 1px solid transparent;
    flex-shrink: 0;
}
.mapping-tab:hover { background: rgba(255,255,255,0.06); }
.mapping-tab.active {
    background: rgba(0,255,136,0.12);
    border-color: rgba(0,255,136,0.25);
}
.mapping-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mapping-tab-num {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}
.mapping-tab.active .mapping-tab-num { color: #00ff88; }

.mapping-pages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.mapping-page {
    display: none;
    padding: 12px 20px 20px;
}
.mapping-page.active { display: block; }

.mapping-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 10px;
}
.mapping-page-title {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
}
.mapping-page-stat {
    font-size: 12px;
    font-weight: 600;
}

.mapping-page-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mapping-field-item {
    padding: 8px 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
}
.mapping-field-item:hover { border-color: rgba(255,255,255,0.08); }
.mapping-field-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.mapping-field-name {
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
}
.mapping-field-val {
    font-size: 12px;
}

.mapping-src-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid;
}
.mapping-path-text {
    font-size: 10px;
    color: #4fc3f7;
    background: rgba(79,195,247,0.08);
    padding: 1px 6px;
    border-radius: 3px;
}
.mapping-val-ok {
    color: #00ff88;
    font-weight: 500;
}
.mapping-val-empty {
    color: #ff9800;
    font-style: italic;
}
.mapping-val-miss {
    color: #ff4444;
    font-size: 11px;
}
.mapping-note {
    font-size: 10px;
    color: #666;
    margin-top: 3px;
    padding-left: 2px;
}
/* 差异对比 */
.mapping-diff {
    border-color: rgba(255,152,0,0.3) !important;
    background: rgba(255,152,0,0.04) !important;
}
.mapping-comp {
    font-size: 12px;
    margin-top: 4px;
}
.mapping-comp-label {
    display: inline-block;
    font-size: 10px;
    color: #00ff88;
    min-width: 36px;
    margin-right: 6px;
    font-weight: 600;
}
.mapping-comp-diff {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mapping-val-dxf {
    color: #4fc3f7;
}
.mapping-val-excel {
    color: #ff9800;
}
.status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
}
.status-completed { background: rgba(0,255,136,0.15); color: #00ff88; }
.status-processing { background: rgba(255,152,0,0.15); color: #ff9800; }
.status-error { background: rgba(255,68,68,0.15); color: #ff6b6b; }
.status-pending { background: rgba(255,255,255,0.08); color: #888; }

/* ==================== 主内容区 ==================== */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.content-header {
    padding: 12px 20px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}
.content-header h2 {
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ==================== 导航菜单 ==================== */
.nav-tabs {
    display: flex;
    gap: 2px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 2px;
}
.nav-tab {
    position: relative;
    padding: 6px 14px;
    font-size: 12px;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.nav-tab:hover {
    color: #ccc;
    background: rgba(255,255,255,0.06);
}
.nav-tab.active {
    color: #00ff88;
    background: rgba(0,255,136,0.12);
}
.nav-tab .arrow {
    font-size: 8px;
    transition: transform 0.2s;
}
.nav-tab.open .arrow {
    transform: rotate(180deg);
}
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 4px;
    min-width: 140px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.nav-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    color: #ccc;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-dropdown-item:hover {
    background: rgba(0,255,136,0.1);
    color: #00ff88;
}
.nav-dropdown-item.disabled {
    color: #555;
    cursor: not-allowed;
}
.nav-dropdown-item.disabled:hover {
    background: transparent;
    color: #555;
}

/* 级联子菜单 */
.nav-dropdown-item.has-sub {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-sub-dropdown {
    display: none;
    position: absolute;
    top: -4px;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    padding: 4px;
    min-width: 160px;
    white-space: nowrap;
    z-index: 210;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.nav-sub-dropdown.show {
    display: block;
}

/* ==================== 文件面板 ==================== */
.file-panel {
    width: 350px;
    border-right: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
}
.file-panel-header {
    padding: 10px;
    border-bottom: 1px solid #0f3460;
}
.file-panel-header .header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
#fileCount {
    font-size: 12px;
    color: #666;
}
.file-tabs {
    display: flex;
    gap: 2px;
}
.file-tab {
    padding: 3px 10px;
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #666;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.file-tab.active {
    background: rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.3);
    color: #00ff88;
}
.file-search {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: #eee;
    outline: none;
}
.file-search:focus { border-color: rgba(0,255,136,0.4); }
.file-list {
    flex: 1;
    overflow-y: auto;
}
.file-item {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.1s;
}
.file-item:hover { background: rgba(255,255,255,0.04); }
.file-item.active { background: rgba(0,255,136,0.06); }
.file-item .name {
    font-size: 12px;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.file-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
    font-size: 11px;
    color: #555;
}
.file-icon { font-size: 14px; flex-shrink: 0; }
.modified-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(0,255,136,0.15);
    color: #00ff88;
}
.dl-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0 2px;
}
.file-item:hover .dl-btn { opacity: 0.6; }
.dl-btn:hover { opacity: 1 !important; }

/* 图纸数量过滤 */
.drawing-filter {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.draw-filter-btn {
    padding: 2px 8px;
    font-size: 10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    color: #555;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.draw-filter-btn.active {
    background: rgba(0,255,136,0.12);
    border-color: rgba(0,255,136,0.25);
    color: #00ff88;
}

/* ==================== 预览面板 ==================== */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.preview-header {
    padding: 10px 15px;
    border-bottom: 1px solid #0f3460;
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.preview-content {
    flex: 1;
    overflow: auto;
    padding: 15px;
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
}
.empty-state .icon { font-size: 36px; margin-bottom: 8px; }
.empty-state .text { font-size: 13px; }

/* ==================== Info Panel ==================== */
.info-panel { max-width: 600px; }
.info-title {
    font-size: 16px;
    font-weight: 600;
    color: #ddd;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
}
.info-section {
    margin-top: 18px;
    padding: 14px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
}
.info-section h4 {
    font-size: 12px;
    color: #00ff88;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row .label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}
.info-row .value {
    font-size: 12px;
    color: #ddd;
    text-align: right;
}
.info-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}
.info-badge.success { background: rgba(0,255,136,0.15); color: #00ff88; }
.info-badge.warning { background: rgba(255,152,0,0.15); color: #ff9800; }
.info-badge.danger { background: rgba(255,68,68,0.15); color: #ff6b6b; }

/* ==================== 操作按钮 ==================== */
.detect-btn, .open-editor-btn, .modify-btn {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.detect-btn {
    background: rgba(79,195,247,0.12);
    border: 1px solid rgba(79,195,247,0.3);
    color: #4fc3f7;
}
.detect-btn:hover { background: rgba(79,195,247,0.2); }
.open-editor-btn {
    background: rgba(0,255,136,0.12);
    border: 1px solid rgba(0,255,136,0.3);
    color: #00ff88;
    margin-top: 8px;
}
.open-editor-btn:hover { background: rgba(0,255,136,0.2); }
.modify-btn {
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.3);
    color: #ff9800;
    margin-top: 8px;
}
.modify-btn:hover { background: rgba(255,152,0,0.2); }

.detect-result .result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    max-width: 580px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 15px; color: #00ff88; }
.modal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
}
.modal-body { padding: 15px 20px; }

/* ==================== File Picker ==================== */
.file-picker-list {
    max-height: 400px;
    overflow-y: auto;
}
.file-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.file-picker-item:hover {
    background: rgba(0,255,136,0.08);
    border-color: rgba(0,255,136,0.2);
}
.file-picker-item .file-icon { font-size: 24px; }
.file-picker-item .name { font-size: 13px; color: #ddd; }
.file-picker-item .size { font-size: 11px; color: #666; }

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 320px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 10001;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
    pointer-events: none;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { background: rgba(0,255,136,0.12); border: 1px solid #00ff88; color: #00ff88; }
.toast.error { background: rgba(255,107,107,0.12); border: 1px solid #ff6b6b; color: #ff6b6b; }
.toast.info { background: rgba(79,195,247,0.12); border: 1px solid #4fc3f7; color: #4fc3f7; }

/* ==================== Loading 遮罩 ==================== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}
.loading-overlay.active { display: flex; }
.loading-box {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 14px;
    padding: 44px 56px;
    text-align: center;
    min-width: 340px;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.loading-spinner {
    width: 52px; height: 52px;
    border: 4px solid rgba(0,255,136,0.15);
    border-top-color: #00ff88;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title {
    font-size: 18px;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.loading-msg { font-size: 14px; color: #ddd; margin-bottom: 8px; }
.loading-sub { font-size: 12px; color: #666; min-height: 18px; }
.loading-dots::after { content: ''; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
.loading-cancel-btn {
    margin-top: 24px;
    padding: 8px 28px;
    background: rgba(255, 68, 68, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 68, 68, 0.35);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.loading-cancel-btn:hover { background: rgba(255, 68, 68, 0.35); }

/* ==================== 结果弹窗 ==================== */
.result-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10003;
}
.result-modal {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    max-width: 520px;
    width: 92%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.result-modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.result-modal-header h3 { font-size: 15px; color: #00ff88; margin: 0; }
.result-modal-close {
    background: none; border: none; color: #555;
    font-size: 20px; cursor: pointer; line-height: 1;
    transition: color 0.2s;
}
.result-modal-close:hover { color: #aaa; }
.result-modal-body { padding: 22px; }
.result-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.result-stat-item {
    background: rgba(0,255,136,0.06);
    border: 1px solid rgba(0,255,136,0.15);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}
.result-stat-item.warn {
    background: rgba(255,152,0,0.06);
    border-color: rgba(255,152,0,0.2);
}
.result-stat-num {
    font-size: 22px;
    font-weight: bold;
    color: #00ff88;
    line-height: 1.2;
}
.result-stat-item.warn .result-stat-num { color: #ff9800; }
.result-stat-label { font-size: 11px; color: #888; margin-top: 4px; }
.result-time { font-size: 12px; color: #555; text-align: right; margin-top: 4px; }

/* ==================== 按钮 ==================== */
.btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #ccc;
}
.btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn.primary {
    background: rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.3);
    color: #00ff88;
}
.btn.primary:hover { background: rgba(0,255,136,0.25); }
.btn.warning {
    background: rgba(255,152,0,0.15);
    border-color: rgba(255,152,0,0.3);
    color: #ff9800;
}
.btn.warning:hover { background: rgba(255,152,0,0.25); }
.btn.danger {
    background: rgba(255,68,68,0.15);
    border-color: rgba(255,68,68,0.3);
    color: #ff6b6b;
}
.btn.danger:hover { background: rgba(255,68,68,0.25); }

/* ==================== 输入框 ==================== */
.modify-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}
.modify-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: #eee;
    outline: none;
    box-sizing: border-box;
}
.modify-input:focus { border-color: #00ff88; }

/* ==================== 下载进度弹窗 ==================== */
.download-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10004;
}
.download-modal {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 30px 40px;
    min-width: 360px;
    text-align: center;
}
.download-modal .title {
    font-size: 15px;
    color: #00ff88;
    margin-bottom: 10px;
}
.download-modal .filename {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
    word-break: break-all;
}
.download-modal .progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}
.download-modal .progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #00cc6a);
    border-radius: 3px;
    transition: width 0.3s;
}
.download-modal .percent {
    font-size: 12px;
    color: #00ff88;
}

/* ==================== Excel 预览 ==================== */
.excel-sheet-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #0f3460;
    background: #0d1b2e;
    padding: 0 8px;
    overflow-x: auto;
}
.excel-sheet-tab {
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}
.excel-sheet-tab:hover { color: #aaa; }
.excel-sheet-tab.active {
    color: #00ff88;
    border-bottom-color: #00ff88;
}
.excel-table-container {
    overflow: auto;
    max-height: calc(100% - 40px);
}
.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.excel-table th, .excel-table td {
    border: 1px solid #1e2a45;
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
}
.excel-table th {
    background: #0f1a30;
    color: #aaa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}
.excel-table td { color: #ccc; }
.excel-table tbody tr:hover { background: rgba(0,255,136,0.04); }
.excel-table .row-num {
    color: #444;
    text-align: center;
    width: 40px;
    min-width: 40px;
    background: #0a1220;
    font-size: 10px;
}
/* 编辑模式 */
.excel-table.edit-mode td[data-row],
.excel-table.edit-mode th[data-row] {
    cursor: text;
}
.excel-table.edit-mode td[data-row]:hover,
.excel-table.edit-mode th[data-row]:hover {
    background: rgba(0,150,255,0.08);
    outline: 1px dashed rgba(0,150,255,0.3);
    outline-offset: -1px;
}

/* ==================== 通用 ==================== */
.btnCancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btnConfirm {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.4);
}
.btnDanger {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.4);
}
