/* E12 Excel 表格美化工具 - 样式 */
* {
    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;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============ 头部 ============ */
.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 .back-link {
    position: absolute;
    left: 88px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.header .back-link:hover {
    opacity: 1;
}

.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));
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header p {
    font-size: 15px;
    opacity: 0.85;
}

/* ============ 卡片 ============ */
.card {
    background: #ffffff;
    color: #333;
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef0f4;
}

/* ============ 样式选择 ============ */
.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.style-item {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}

.style-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
}

.style-item.selected {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 2px 10px rgba(102,126,234,0.25);
}

.style-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    margin: 0 auto 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.style-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.style-desc {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
}

/* ============ 上传区 ============ */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 15px;
    color: #4b5563;
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* ============ 文件列表 ============ */
.file-list {
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #334155;
}

.file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.file-item .file-size {
    color: #94a3b8;
    margin-right: 10px;
    font-size: 12px;
}

.file-item .file-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.file-empty {
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 10px;
}

/* ============ 按钮 ============ */
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.btn-gray {
    background: #e2e8f0;
    color: #475569;
}

.btn-gray:hover {
    background: #cbd5e1;
}

/* ============ 结果区 ============ */
.result-info {
    font-size: 14px;
    color: #334155;
    line-height: 1.8;
    margin-bottom: 14px;
}

.result-info .success-text {
    color: #16a34a;
    font-weight: 600;
}

.result-info .error-text {
    color: #dc2626;
    font-weight: 600;
}

.download-area {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-block;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============ 日志 ============ */
.log-view {
    background: #0f172a;
    border-radius: 8px;
    padding: 12px;
    height: 200px;
    overflow-y: auto;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #cbd5e1;
}

.log-line {
    margin-bottom: 2px;
}

.log-time {
    color: #64748b;
    margin-right: 6px;
}

.log-info { color: #cbd5e1; }
.log-success { color: #4ade80; }
.log-error { color: #f87171; }
.log-warn { color: #fbbf24; }

.log-actions {
    margin-top: 10px;
    text-align: right;
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ============ 底部 ============ */
.footer {
    text-align: center;
    margin-top: 20px;
    color: #9ca3af;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
    .container {
        padding: 16px 12px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================================
   黑金高级感 · 全站统一覆盖层
   应用于所有工具内页（与首页 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); }
