/* 图片转 Excel 工具 —— 浅色背景 + 紫色 #8147E7 主色调 */
:root {
  --primary: #667eea;
  --primary-dark: #5b4b9e;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2329;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(30, 30, 60, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 顶部紫色横幅 ---------- */
/* ---------- 顶部横幅（与 PDF工具集其它工具页保持统一规格） ---------- */
.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;
  gap: 4px;
  transition: opacity 0.2s;
}
.header .back-link:hover {
  opacity: 0.85;
}
.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-logout {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.header-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

.wrap {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.outline {
  background: #fff;
  color: var(--primary);
}
.btn.outline:hover {
  background: var(--primary-light);
}
.btn.danger {
  background: #fff;
  color: var(--danger);
  border-color: #f3b8ba;
}
.btn.danger:hover {
  background: #fdecec;
  border-color: var(--danger);
}
.btn.sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ---------- 输入框 ---------- */
input[type="password"] {
  width: 100%;
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ---------- 登录 ---------- */
#view-login {
  max-width: 380px;
  margin: 8vh auto;
}
.login-box .logo {
  text-align: center;
  margin-bottom: 16px;
}
.login-box .logo .icon {
  font-size: 40px;
}
.login-box h1 {
  text-align: center;
  font-size: 20px;
  margin: 0 0 20px;
  color: var(--primary-dark);
}
.login-box label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-sub);
}

/* ---------- 上传区 ---------- */
.dropzone {
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius);
  background: var(--primary-light);
  padding: 28px;
  text-align: center;
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: #ece2fc;
}
.dropzone .dz-icon {
  font-size: 30px;
  color: var(--primary);
}
.fileinfo {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text);
}
.fileinfo .fname {
  font-weight: 600;
  word-break: break-all;
}

/* ---------- 状态提示 ---------- */
.status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
}
.status.show { display: block; }
.status.info { background: var(--primary-light); color: var(--primary-dark); }
.status.ok { background: #e9f9ef; color: var(--ok); }
.status.err { background: #fdecec; color: var(--danger); }

/* ---------- 表格编辑区 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.toolbar .sep {
  width: 1px;
  height: 22px;
  background: var(--border);
}
.hint {
  color: var(--text-sub);
  font-size: 12px;
  margin: 0 0 10px;
}
.table-scroll {
  overflow: auto;
  max-height: 460px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
table.grid {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
table.grid th,
table.grid td {
  border: 1px solid var(--border);
  padding: 0;
  min-width: 90px;
  position: relative;
}
table.grid th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  text-align: center;
}
table.grid th.colsel,
table.grid td.cell.sel {
  background: #eef2ff;
}
table.grid th.rowsep,
table.grid td.rowsep {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  width: 34px;
  min-width: 34px;
  text-align: center;
  cursor: pointer;
}
table.grid th.rowsep.sel {
  background: var(--primary);
  color: #fff;
}
table.grid input.cell-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}
table.grid td.cell.sel input.cell-input {
  background: #eef2ff;
}

/* ---------- 历史记录 ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
}
.history-item .meta {
  min-width: 0;
}
.history-item .meta .name {
  font-weight: 600;
  word-break: break-all;
}
.history-item .meta .sub {
  color: var(--text-sub);
  font-size: 12px;
}
.history-item .ops {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.empty {
  color: var(--text-sub);
  text-align: center;
  padding: 20px;
}

/* ---------- 通用 ---------- */
.hidden { display: none !important; }
.muted { color: var(--text-sub); font-size: 12px; }
.center { text-align: center; }


/* ============================================================
   黑金高级感 · 全站统一覆盖层
   应用于所有工具内页（与首页 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); }
