/* 照片 EXIF 隐私清除器 - 样式（布局对照设计稿：顶部工具栏 + 左文件列表/缩略图 + 右双标签字段区） */
:root {
  --amber: #d97706;
  --amber-dark: #b45309;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --green: #4eb389;
  --green-dark: #419673;
  --gold: #ffd926;
  --risk: #fbe681;
  --safe: #f0fdf4;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 10px 30px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gray-900);
  background: #fff;
  line-height: 1.6;
  font-size: 14px;
}

/* ============ 顶部品牌栏（对齐 excel2all/h5 的 .topbar：吸顶 + 毛玻璃 + logo/brand/pill） ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--gray-200);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.logo {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid #cfe2f7;
  box-shadow: 0 2px 8px rgba(0, 91, 145, .14);
}
.logo img, .logo svg { display: block; width: 100%; height: 100%; }
.brand h1 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: .2px; color: var(--gray-900); }
.brand p { margin: 0; font-size: 12px; color: var(--gray-500); }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #0a8f7f; background: #e6f7f4; border: 1px solid #bfe8e1;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #08B89E;
  box-shadow: 0 0 0 3px rgba(8, 184, 158, .16);
}

@media (max-width: 640px) {
  .topbar-inner { padding: 12px 14px; gap: 10px; }
  .brand p { display: none; }
}

/* ============ 主容器（对齐 excel2all 的 .container + .title/.desc） ============ */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 18px 24px; }
.title { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: var(--gray-900); line-height: 1.45; }
.desc { color: var(--gray-500); margin: 0 0 22px; font-size: 13.5px; line-height: 1.8; }

/* 空状态（框与图标对照 excel2all/h5 的 dropzone：虚线灰框 + 图标 + 「点击上传」链接 + 小字提示） */
.upload-panel { position: relative; }
.drop-zone {
  background: #fff; border: 2px dashed var(--gray-300); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 16px; text-align: center; cursor: pointer;
  color: var(--gray-500); transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--green); background: #f2f8f4; }
.file-picker { display: none; }
.dz-icon { color: var(--green); line-height: 0; margin-bottom: 10px; }
.dz-text { font-size: 15px; color: var(--gray-700); }
.link { color: var(--green); font-weight: 600; }
.hint { font-size: 12px; color: var(--gray-500); margin-top: 8px; }
.privacy-badge {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-align: center; color: var(--green); font-size: 13px; margin-top: 12px;
}
.privacy-badge svg { flex: 0 0 auto; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--gray-200); border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none; padding: 10px 12px; background: #fff;
}
.toolbar .spacer, .action-bar .spacer { flex: 1; }

/* 工作台 */
.workbench {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--gray-200); border-radius: 0 0 var(--radius) var(--radius);
  min-height: 520px; background: #fff; overflow: hidden;
}
.file-col {
  width: 232px; flex: 0 0 232px; border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column; background: #fff;
}
.file-head {
  text-align: center; font-weight: 600; padding: 8px 6px;
  border-bottom: 1px solid var(--gray-200); background: var(--gray-50); font-size: 13px;
}
.file-list { flex: 1; overflow-y: auto; max-height: 420px; }
/* .risk=仍有常见隐私项，.safe=已无常见隐私项；选中各自加深 */
.file-item {
  padding: 8px 10px; border-bottom: 1px solid var(--gray-100); cursor: pointer;
  font-size: 13px; color: var(--gray-700);
}
.file-item.risk { background: var(--risk); }
.file-item.safe { background: var(--safe); }
.file-item.risk:hover { background: #f6dd5e; }
.file-item.safe:hover { background: #dcfce7; }
.file-item.risk.active { background: var(--gold); color: var(--gray-900); font-weight: 700; }
.file-item.safe.active { background: var(--green); color: #fff; font-weight: 700; }
.file-item .name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left;
}
.file-item .state { display: block; font-size: 12px; font-weight: 400; color: var(--gray-500); }
.file-item.risk.active .state { color: #6b5200; }
.file-item.safe.active .state { color: rgba(255, 255, 255, .95); }
.thumb-box { border-top: 1px solid var(--gray-200); padding: 10px; text-align: center; background: var(--gray-50); }
.thumb-box img {
  max-width: 100%; max-height: 180px; border: 1px solid var(--gray-200); border-radius: 6px;
  background: #fff; cursor: zoom-in; display: block; margin: 0 auto;
}

/* 字段区 */
.meta-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 12px; padding: 12px 14px 0; }
.tab {
  flex: 1; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--gray-100);
  padding: 8px 10px; font-size: 14px; font-weight: 600; color: var(--gray-700); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tab:hover { background: var(--gray-200); }
.tab.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.tab.active:hover { background: var(--green); }

.tab-body { flex: 1; overflow-y: auto; padding: 12px 14px; }

.field-row {
  display: flex; align-items: center; gap: 10px; min-height: 40px;
  border-bottom: 1px solid var(--gray-100); padding: 4px 2px;
}
.field-name { flex: 0 0 168px; font-weight: 600; font-size: 14px; }
.field-tag { color: var(--gray-500); font-weight: 400; font-size: 12px; margin-left: 6px; }
.field-value {
  flex: 1; min-width: 0; color: var(--gray-700); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.field-value.empty { color: var(--gray-300); }
/* 清除后只加中划线，颜色保持正常，方便看清被删的是哪一项 */
.field-row.cleared .field-name { text-decoration: line-through; }
.field-row.cleared .field-value { text-decoration: line-through; }
.cleared-mark { color: var(--red); font-size: 12px; flex: 0 0 auto; }
.icon-btn {
  flex: 0 0 auto; border: none; background: transparent; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--gray-500); padding: 6px;
}
.icon-btn:hover { color: var(--red); }
.icon-btn[disabled] { visibility: hidden; }

/* 值编辑 */
.editable {
  cursor: text; border-radius: 4px;
  text-decoration: underline dashed var(--gray-300); text-underline-offset: 3px;
  transition: background .15s;
}
.editable:hover { background: #fffbe6; text-decoration-color: var(--amber); }
.edit-input {
  width: 100%; min-width: 0; font-size: 13px; font-family: inherit;
  padding: 3px 6px; border: 1px solid var(--amber); border-radius: 4px; background: #fff; color: var(--gray-900);
}
.edit-input:focus { outline: 2px solid rgba(217, 119, 6, .35); outline-offset: 0; }
.meta-table td.v.editable { padding-right: 11px; }

/* 查看更多 */
.meta-group { border: 1px solid var(--gray-200); border-radius: 8px; margin-bottom: 8px; overflow: hidden; background: #fff; }
.meta-group > summary {
  cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13px;
  background: var(--gray-50); list-style: none; display: flex; align-items: center; gap: 8px;
}
.meta-group > summary::-webkit-details-marker { display: none; }
.meta-group[open] > summary { border-bottom: 1px solid var(--gray-200); }
.risk-badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #fee2e2; color: var(--red); font-weight: 600; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meta-table td { padding: 5px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.meta-table tr:last-child td { border-bottom: none; }
.meta-table td.k { color: var(--gray-500); width: 40%; word-break: break-word; }
.meta-table td.v { color: var(--gray-900); word-break: break-word; }
.empty-meta { text-align: center; color: var(--gray-500); padding: 20px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; }

/* 操作条 */
.action-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--gray-200); padding: 10px 14px; background: var(--gray-50);
}
.opt { font-size: 13px; color: var(--gray-700); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.saved-tip { padding: 0 14px 10px; font-size: 13px; color: var(--gray-500); background: var(--gray-50); min-height: 20px; }

/* 按钮（配色对照 sqllite：btn-mini=打开其他文件，btn-save=保存数据库） */
.btn {
  border: 1px solid transparent; border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-mini { background: #fff; border-color: var(--gray-300); color: var(--gray-700); padding: 6px 12px; }
.btn-mini:hover:not(:disabled) { background: var(--gray-100); border-color: var(--gray-500); }
.btn-save { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-save:hover:not(:disabled) { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.btn-plain { background: var(--gray-200); border-color: var(--gray-200); color: var(--gray-700); }
.btn-plain:hover:not(:disabled) { background: var(--gray-300); border-color: var(--gray-300); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 原图预览 */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .82); }
.lightbox-body { position: relative; max-width: 94vw; max-height: 92vh; }
.lightbox-body img {
  display: block; max-width: 94vw; max-height: 92vh; width: auto; height: auto;
  background: #fff; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute; right: -14px; top: -38px; width: 34px; height: 34px;
  border: none; border-radius: 50%; background: #fff; color: var(--gray-900);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: var(--gold); }

/* ============ 说明与常见问题（对齐 excel2all：panel + seo + FAQ） ============ */
.panel {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--gray-200);
}
.panel-head .ic {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  flex: 0 0 auto; background: #e6f7f4; color: #08B89E;
}
.panel-head h2 { font-size: 14.5px; margin: 0; font-weight: 700; color: var(--gray-900); }
.panel-head .hint { font-size: 12px; color: var(--gray-500); margin-left: auto; text-align: right; }
.panel-body { padding: 18px; }

.seo { margin-top: 24px; }
.seo .panel-body { display: grid; gap: 18px; padding-top: 16px; }
.seo code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: #e6f7f4; color: #0a8f7f; padding: 1px 5px; border-radius: 5px;
}
.seo p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--gray-500); }
.seo .lead { font-size: 13.5px; color: var(--gray-700); }
.seo .lead b { color: var(--gray-900); font-weight: 600; }
.seo h3 { font-size: 14px; color: var(--gray-900); margin: 0 0 8px; font-weight: 600; }
.seo ul, .seo ol { margin: 0; padding-left: 20px; }
.seo li { font-size: 13px; line-height: 1.8; color: var(--gray-500); }
.seo li b { color: var(--gray-700); font-weight: 600; }
.seo li + li { margin-top: 2px; }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px 28px; }
.seo .note {
  font-size: 12.5px; color: var(--gray-500);
  border-left: 3px solid #bfe8e1; padding-left: 10px; margin-top: 10px;
}
.seo details { border-top: 1px solid var(--gray-200); padding: 9px 0; }
.seo details:first-of-type { border-top: 0; padding-top: 0; }
.seo summary {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--gray-900);
}
.seo summary::-webkit-details-marker { display: none; }
.seo summary::before { content: "+"; flex: 0 0 auto; width: 14px; color: #08B89E; font-weight: 700; line-height: 1.6; }
.seo details[open] summary::before { content: "\2212"; }
.seo .faq-a { margin: 7px 0 0; padding-left: 22px; }

/* ============ 底部说明（对齐 excel2all footer.foot） ============ */
footer.foot {
  max-width: 1180px; margin: 8px auto 40px; padding: 0 18px;
  color: var(--gray-500); font-size: 12px; text-align: center; line-height: 1.7;
}
footer.foot p { margin: 4px 0; }
footer.foot b { color: var(--gray-700); font-weight: 600; }
footer.foot a { color: #0a8f7f; text-decoration: none; }
footer.foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .seo .faq-a { padding-left: 0; }
  .panel-head .hint { display: none; }
}

.toast-tip {
  position: fixed; left: 50%; top: 24px; transform: translate(-50%, -16px);
  background: rgba(15, 23, 42, .92); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 9999; pointer-events: none;
}
.toast-tip.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .workbench { flex-direction: column; }
  .file-col { width: 100%; flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--gray-200); }
  .file-list { max-height: 180px; }
  .field-name { flex-basis: 120px; }
  .toolbar { flex-wrap: wrap; }
}
