/* E01 BOM 审核工具 - 样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
    padding-bottom: 40px;
}

/* ===== 顶部 header（LOGO + 返回按钮，与所有工具统一） ===== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header .back-link {
    position: absolute;
    left: 88px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.header-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    opacity: 0.9;
object-fit: contain;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}



/* ===== 主容器 ===== */
.container {
    max-width: 860px;
    margin: 28px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 26px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 14px;
}

.intro-text {
    font-size: 14px;
    color: #555;
    line-height: 1.9;
}

.red-text {
    color: #dc2626;
    font-weight: 600;
}

/* ===== 上传区 ===== */
.upload-area {
    border: 2px dashed #c3c6cf;
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f4f6ff;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 15px;
    color: #444;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: #999;
}

.file-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f4ff;
    border-radius: 8px;
    font-size: 13px;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 按钮 ===== */
.btn {
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px 24px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-download {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    padding: 10px 22px;
    font-size: 14px;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(40, 167, 69, 0.4);
}

.btn-block {
    display: block;
}

/* ===== 结果区 ===== */
.result-info {
    font-size: 14px;
    color: #333;
    line-height: 2;
    background: #f8f9fc;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.result-info .stat {
    display: inline-block;
    background: #e8ecfb;
    color: #3b4fb8;
    border-radius: 6px;
    padding: 2px 10px;
    margin-right: 8px;
    font-weight: 600;
}

.download-area {
    text-align: center;
}

/* ===== 日志 ===== */
.log-view {
    background: #162033;
    color: #b8c4d9;
    border-radius: 10px;
    padding: 14px 16px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.8;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-view .ok {
    color: #4ade80;
}

.log-view .err {
    color: #f87171;
}

.log-view .info {
    color: #60a5fa;
}

/* ===== 底部 ===== */
.footer {
    text-align: center;
    margin-top: 20px;
    color: #9ca3af;
    font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .container {
        padding: 0 14px;
        margin-top: 18px;
    }
}


/* ============================================================
   黑金高级感 · 全站统一覆盖层
   应用于所有工具内页（与首页 index.html 风格保持一致）
   仅改视觉，不动任何 JS / 结构 / 功能
   ============================================================ */
body {
    background: #0b0c0e !important;
    color: #cfd2d6 !important;
}

/* ---- 背景光晕与噪点 ---- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 62% 44% at 50% -12%, rgba(200, 168, 110, 0.10), transparent 62%),
        radial-gradient(ellipse 38% 30% at 88% 108%, rgba(200, 168, 110, 0.05), transparent 60%);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 26px 26px;
}
.container, .wrap { position: relative; z-index: 1; }

/* ---- 顶部导航 ---- */
body .header {
    background: rgba(15, 17, 21, 0.85) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(200, 168, 110, 0.18);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 8px 30px rgba(0,0,0,0.35);
    color: #edeae1;
}
body .header h1 { color: #f2efe6; font-weight: 400; letter-spacing: 0.03em; }
body .header p { color: #8a8f96; }
body .header .back-link { color: #cbb07d; letter-spacing: 0.02em; }
body .header .back-link:hover { color: #e6cf9c; }
body .header-logo {
    filter: drop-shadow(0 0 10px rgba(200, 168, 110, 0.45)) drop-shadow(0 4px 16px rgba(0, 0, 0, 0.40));
    opacity: 1;
}
body .header-logout {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(200,168,110,0.3);
    color: #cbb07d;
}
body .header-logout:hover { background: rgba(200,168,110,0.12); color: #e6cf9c; }

/* ---- 卡片 ---- */
body .card {
    background: rgba(255,255,255,0.028) !important;
    border: 1px solid rgba(255,255,255,0.075);
    border-radius: 16px;
    color: #cfd2d6;
    box-shadow: 0 10px 30px rgba(0,0,0,0.30) !important;
}
body .card-title { color: #edeae1; border-bottom-color: rgba(255,255,255,0.08); }
body .card-title::before { background: #cbb07d; }
body .card-title .count { color: #6f747b; }
body .card h2 { color: #edeae1; }

/* ---- 上传区 ---- */
body .file-upload, body .upload-area, body .dropzone {
    border-color: rgba(255,255,255,0.16) !important;
    background: rgba(255,255,255,0.02) !important;
    color: #8a8f96;
}
body .file-upload:hover, body .file-upload.dragover,
body .upload-area:hover, body .upload-area.dragover,
body .dropzone:hover, body .dropzone.dragover {
    border-color: rgba(200,168,110,0.5) !important;
    background: rgba(200,168,110,0.06) !important;
}
body .file-upload-text, body .upload-text { color: #b7bac0; }
body .file-upload-hint, body .upload-hint, body .hint { color: #6f747b; }
body .file-upload-icon, body .upload-icon { color: #cbb07d; }
body .dropzone .dz-icon { color: #cbb07d; }
body .file-info {
    background: rgba(200,168,110,0.08) !important;
    border: 1px solid rgba(200,168,110,0.18);
    color: #e6cf9c;
}
body .file-info-name { color: #e6cf9c; }
body .file-info-size { color: #8a8f96; }
body .file-remove { color: #f87171; }
body .file-list, body .file-item {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
    color: #cfd2d6;
}
body .file-item .file-size { color: #6f747b; }
body .file-empty { color: #6f747b; }

/* ---- 表单控件 ---- */
body .form-label { color: #c9ccd1; }
body .form-input, body .form-select, body .form-textarea,
body input[type="password"], body input[type="number"], body input[type="text"], body select, body textarea {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e8e5dd !important;
}
body .form-input:focus, body .form-select:focus, body .form-textarea:focus,
body input:focus, body select:focus, body textarea:focus {
    border-color: #cbb07d !important;
    box-shadow: 0 0 0 3px rgba(200,168,110,0.15) !important;
    outline: none;
}
body .form-hint { color: #6f747b; }
body .checkbox-group input[type="checkbox"] { accent-color: #cbb07d; }
body .checkbox-group label { color: #c9ccd1; }
body select option { background: #15171b; color: #e8e5dd; }

/* ---- 主按钮（金色） ---- */
body .btn-primary {
    background: rgba(200,168,110,0.88) !important;
    color: #17130a !important;
    box-shadow: 0 4px 16px rgba(200,168,110,0.18);
}
body .btn-primary:hover:not(:disabled) {
    background: #dcc38c !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,168,110,0.28);
}
body .btn-primary:disabled { background: #3a3d43 !important; color: #7a7d83 !important; box-shadow: none; }
body .btn-secondary {
    background: rgba(255,255,255,0.05) !important;
    color: #cbb07d !important;
    border: 1px solid rgba(200,168,110,0.4);
}
body .btn-secondary:hover { background: rgba(200,168,110,0.12) !important; }
body .btn-sm { background: rgba(200,168,110,0.78) !important; color: #17130a !important; }
body .btn-sm:hover { background: #dcc38c !important; }
body .btn-danger { background: rgba(220,38,38,0.14) !important; color: #f87171 !important; border: 1px solid rgba(248,113,113,0.25); }
body .btn-danger:hover { background: rgba(220,38,38,0.22) !important; }
body .btn-gray { background: rgba(255,255,255,0.06) !important; color: #b7bac0 !important; }
body .btn-gray:hover { background: rgba(255,255,255,0.10) !important; }
body .btn-download, body .download-btn {
    background: rgba(200,168,110,0.85) !important;
    color: #17130a !important;
    box-shadow: 0 4px 14px rgba(200,168,110,0.18);
}
body .btn-download:hover, body .download-btn:hover { background: #dcc38c !important; }

/* ---- 状态框 ---- */
body .status-box.processing { background: rgba(59,130,246,0.10); border: 1px solid rgba(96,165,250,0.25); color: #93c5fd; }
body .status-box.success { background: rgba(200,168,110,0.08); border: 1px solid rgba(200,168,110,0.30); color: #e6cf9c; }
body .status-box.error { background: rgba(220,38,38,0.10); border: 1px solid rgba(248,113,113,0.30); color: #fca5a5; }
body .status.info { background: rgba(200,168,110,0.10); color: #e6cf9c; border-color: rgba(200,168,110,0.25); }
body .status.ok { background: rgba(74,222,128,0.10); color: #4ade80; border-color: rgba(74,222,128,0.25); }
body .status.err { background: rgba(220,38,38,0.12); color: #f87171; border-color: rgba(248,113,113,0.3); }
body .status-title { color: inherit; }
body .status-content { color: inherit; }
body .stat-item { background: rgba(255,255,255,0.04) !important; }
body .stat-value { color: #cbb07d; }
body .stat-label { color: #8a8f96; }
body .failed-item { border-bottom-color: rgba(255,255,255,0.06); }

/* ---- 其它通用 ---- */
body .ios-tip {
    background: rgba(245,158,11,0.10);
    border-left-color: #f59e0b;
    color: #fcd34d;
}
body .mode-tab {
    background: rgba(255,255,255,0.03) !important;
    border-color: rgba(255,255,255,0.10);
    color: #b7bac0;
}
body .mode-tab.active {
    border-color: rgba(200,168,110,0.6) !important;
    background: rgba(200,168,110,0.10) !important;
    color: #e6cf9c !important;
}
body .quick-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.12);
    color: #b7bac0;
}
body .quick-btn:hover { border-color: #cbb07d; color: #cbb07d; }
body .footer { color: #565a60; }
body .muted { color: #6f747b; }
body .intro-text { color: #b7bac0; }
body .red-text { color: #f87171; }

/* ---- a02 规则管理 ---- */
body .category-header { color: #cbb07d; border-bottom-color: rgba(255,255,255,0.08); }
body .rule-item { background: rgba(255,255,255,0.03); }
body .rule-item:hover { background: rgba(255,255,255,0.06); }
body .rule-pair .find { color: #f87171; }
body .rule-pair .arrow { color: #6f747b; }
body .rule-pair .replace { color: #4ade80; }
body .rule-desc { color: #6f747b; }
body .rule-check input { accent-color: #cbb07d; }
body .add-rule-form { background: rgba(255,255,255,0.03); }
body .log-panel, body .log-view {
    background: #0d0f12 !important;
    border: 1px solid rgba(255,255,255,0.07);
}
body .loading-box { background: #15171b !important; border: 1px solid rgba(255,255,255,0.10); }
body .loading-text { color: #b7bac0; }
body .loading-spinner { border-top-color: #cbb07d; }
body .toast.info { background: rgba(200,168,110,0.85); color: #17130a; }

/* ---- e12 样式选择 ---- */
body .style-item { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.10); }
body .style-item:hover { border-color: #cbb07d; box-shadow: 0 2px 8px rgba(200,168,110,0.20); }
body .style-item.selected { border-color: #cbb07d; background: rgba(200,168,110,0.10); }
body .style-name { color: #edeae1; }
body .style-desc { color: #6f747b; }
body .result-info { color: #cfd2d6; }
body .result-info .success-text { color: #4ade80; }
body .result-info .error-text { color: #f87171; }
body .result-info .stat { background: rgba(200,168,110,0.15); color: #e6cf9c; }

/* ---- img2xlsx 表格 ---- */
body table.grid { background: #121417; }
body table.grid th { background: rgba(200,168,110,0.08); color: #e6cf9c; }
body table.grid th.rowsep, body table.grid td.rowsep { background: rgba(200,168,110,0.08); color: #e6cf9c; }
body table.grid th.rowsep.sel { background: rgba(200,168,110,0.6); color: #17130a; }
body table.grid th.colsel, body table.grid td.cell.sel { background: rgba(200,168,110,0.10); }
body table.grid td.cell.sel input.cell-input { background: rgba(200,168,110,0.10); }
body table.grid input.cell-input { color: #e8e5dd; }
body .toolbar .sep { background: rgba(255,255,255,0.10); }
body .history-item { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); color: #cfd2d6; }
body .login-box h1 { color: #edeae1; }
body .login-box label { color: #8a8f96; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(200,168,110,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(200,168,110,0.4); }

/* ---- 标题+版本号徽章 & 操作说明（默认规范） ---- */
.header-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.header-ver {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #7fb3ff;
    background: rgba(44, 82, 130, 0.18);
    border: 1px solid #2c5282;
    border-radius: 6px;
    line-height: 1.6;
    white-space: nowrap;
}
.help-link {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbb07d;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid rgba(200, 168, 110, 0.3);
    border-radius: 8px;
    padding: 6px 14px;
    background: rgba(200, 168, 110, 0.05);
}
.help-link:hover { color: #e6cf9c; border-color: rgba(200, 168, 110, 0.6); background: rgba(200,168,110,0.12); }
