/* ExifFix — 明亮主题 */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --bg-soft: #f8fafc;
  --line: #e4e9f1;
  --line-strong: #cfd8e6;
  --text: #1c2a3f;
  --muted: #64748b;
  --accent: #2f6bff;
  --accent-2: #7c5cff;
  --accent-soft: #eef4ff;
  --green: #15803d;
  --green-soft: #e8f7ee;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --amber: #b45309;
  --amber-soft: #fff4e0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 35, 61, .04), 0 10px 30px -18px rgba(23, 35, 61, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(124, 92, 255, .07) 0%, transparent 60%),
    radial-gradient(900px 420px at 8% -12%, rgba(47, 107, 255, .08) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: 96px;
}
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; }
h3 { font-size: 16px; display: flex; align-items: center; gap: 7px; }
h4 { font-size: 13.5px; color: var(--muted); margin-top: 20px; letter-spacing: .02em; display: flex; align-items: center; gap: 7px; }
a { color: var(--accent); }

/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 500;
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: linear-gradient(135deg, #2f6bff, #7c5cff);
  box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .55);
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: .3px; }
.brand-sub { margin: 0; font-size: 12.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.privacy-chip {
  font-size: 12.5px; color: var(--green); background: var(--green-soft);
  border: 1px solid #bfe6cd; border-radius: 999px; padding: 4px 12px;
}
.gh-link {
  color: var(--text); text-decoration: none; font-size: 13.5px;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 14px;
  background: #fff; transition: .15s;
}
.gh-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 布局 ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 20px; }

/* ---------- 拖放区 ---------- */
.dropzone {
  margin-top: 28px;
  border: 2px dashed #c4d3ea; border-radius: 22px;
  padding: 58px 24px 44px; text-align: center; cursor: pointer;
  transition: .18s; background: rgba(255, 255, 255, .75);
  box-shadow: var(--shadow);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-2px);
}
.dz-icon {
  width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-soft), #f3efff);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
}
.dropzone h2 { font-size: 21px; }
.dropzone > p { color: var(--muted); margin: 6px 0 0; }
.dz-steps {
  margin-top: 26px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.dz-step {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px 6px 6px; font-size: 13.5px; color: var(--text);
  box-shadow: 0 1px 2px rgba(23, 35, 61, .05);
}
.dz-step b {
  width: 22px; height: 22px; border-radius: 50%; font-size: 12.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.dz-arrow { color: #b6c2d6; font-size: 15px; }

/* ---------- 工作区 ---------- */
.workspace {
  display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-top: 22px; align-items: start;
}
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } }

/* 文件列表 */
.filepanel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: sticky; top: 76px; box-shadow: var(--shadow);
}
@media (max-width: 900px) { .filepanel { position: static; } }
.filepanel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft);
  font-size: 13px;
}
.check-all-wrap { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.file-count { color: var(--muted); }
.filelist { max-height: 68vh; overflow-y: auto; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid #eef2f8; cursor: pointer; transition: .12s;
}
.file-item:hover { background: #f6f9ff; }
.file-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.f-check { flex: none; accent-color: var(--accent); }
.f-thumb {
  width: 46px; height: 46px; object-fit: cover; border-radius: 9px; flex: none;
  background: #eef2f7; border: 1px solid var(--line);
}
.f-info { min-width: 0; flex: 1; }
.f-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.badge {
  font-size: 10.5px; border-radius: 5px; padding: 0 6px; line-height: 17px;
  background: var(--accent-soft); color: #2b5fd9; border: 1px solid #dbe7ff;
}
.badge.gps { background: var(--green-soft); color: var(--green); border-color: #c4ead2; }
.badge.mod { background: var(--amber-soft); color: var(--amber); border-color: #f5e0b8; }

/* 编辑区 */
.editpanel { min-width: 0; }
.tabs {
  display: inline-flex; gap: 4px; margin-bottom: 14px;
  background: #e9edf5; border-radius: 13px; padding: 4px;
}
.tab {
  background: transparent; border: none; color: var(--muted);
  padding: 8px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; transition: .15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: #fff; box-shadow: 0 1px 4px rgba(23, 35, 61, .14); font-weight: 600; }
.tab-count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.tab-count:empty { display: none; }

.empty-hint { color: var(--muted); text-align: center; padding: 90px 0; font-size: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 12px; }
.muted { color: var(--muted); font-size: 12.5px; }

/* 预览卡 */
.preview-card { display: flex; gap: 18px; align-items: flex-start; }
#preview {
  max-width: 300px; max-height: 260px; border-radius: 12px; border: 1px solid var(--line);
  object-fit: contain; background:
    repeating-conic-gradient(#f1f5f9 0 25%, #e9eef5 0 50%) 0 0 / 18px 18px;
  display: block; cursor: zoom-in;
}
.preview-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-title { font-weight: 600; word-break: break-all; font-size: 16px; }
.kind-badge {
  font-size: 11px; color: var(--accent-2); border: 1px solid #ded4ff;
  background: #f6f3ff; padding: 0 8px; border-radius: 999px;
}
.preview-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 表单 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.field {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 9px 11px; border-radius: 12px; transition: background .15s, box-shadow .15s;
}
.field label { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.field.is-modified { background: var(--accent-soft); box-shadow: inset 0 0 0 1px #c4d8ff; }
.field.is-modified > label::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  display: inline-block; align-self: center; flex: none;
}
.tag-name { font-size: 10.5px; opacity: .6; font-family: ui-monospace, monospace; }
.orig-hint { font-size: 11.5px; color: #8a97ad; min-height: 15px; }
input, select, textarea {
  background: #fff; border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: 13.5px; font-family: inherit;
  outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, .13);
}
input::placeholder, textarea::placeholder { color: #a3aec2; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
.dt-row { display: flex; gap: 6px; }
.sec-input { width: 64px; flex: none; }
.shift-grid { display: grid; grid-template-columns: auto 70px auto 70px auto 70px; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.sub-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin: 8px 0 4px; display: flex; flex-direction: column; gap: 10px;
}
.sub-box .field { padding: 0; background: none; box-shadow: none; }
.span2 { grid-column: 1 / -1; }
.search-row { display: flex; gap: 6px; }
.search-results {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 8px 24px -10px rgba(23, 35, 61, .2);
}
.search-results div { padding: 8px 11px; font-size: 12.5px; cursor: pointer; border-bottom: 1px solid #eef2f8; }
.search-results div:last-child { border-bottom: none; }
.search-results div:hover { background: var(--accent-soft); }

/* 地图 */
.map { height: 320px; border-radius: 12px; border: 1px solid var(--line); margin-top: 10px; z-index: 1; }
.leaflet-container { background: #eef2f7; font: inherit; }
.row-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  background: #fff; color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 7px 15px; font-size: 13.5px; cursor: pointer; transition: .15s;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: #f7faff; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .5);
}
.btn.primary:hover { filter: brightness(1.07); color: #fff; }
.btn.ghost { background: transparent; }
.btn.dashed { border-style: dashed; color: var(--accent); border-color: #b9cffc; background: var(--accent-soft); }
.btn.dashed:hover { background: #e2edff; }
.btn.danger { color: var(--red); border-color: #f0c4c0; background: #fff; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.danger-label {
  color: #b42318; font-size: 13.5px; display: flex; gap: 8px; align-items: center;
  background: var(--red-soft); border: 1px solid #f6d5d1; border-radius: 10px; padding: 9px 12px; cursor: pointer;
}
.check-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.step-no {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}

/* 全部 EXIF 表 */
.all-exif { margin-top: 10px; }
.all-exif table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.all-exif td { padding: 5px 8px; border-bottom: 1px solid #eef2f8; vertical-align: top; }
.all-exif td:first-child { color: var(--muted); white-space: nowrap; font-family: ui-monospace, monospace; font-size: 11.5px; }
.all-exif td:last-child { word-break: break-all; }
.all-exif summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.all-exif summary:hover { color: var(--accent); }

/* 底部操作栏 */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 24px -18px rgba(23, 35, 61, .3);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px max(20px, calc((100vw - 1240px) / 2 + 20px)); flex-wrap: wrap;
}
.bar-info { font-size: 13.5px; color: var(--muted); }
.bar-info b { color: var(--amber); }
.bar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar-actions select { width: auto; padding: 6px 8px; }

/* 页脚 */
.site-footer { margin: 34px 0 10px; color: var(--muted); font-size: 12.5px; text-align: center; }
.site-footer p { margin: 4px 0; }

/* Toast */
.toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  background: #fff; color: var(--text); border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 11px 20px; font-size: 14px; z-index: 1000;
  box-shadow: 0 12px 40px -12px rgba(23, 35, 61, .35); max-width: 80vw;
}
.toast.err { border-left-color: var(--red); color: #b42318; }
.toast.ok { border-left-color: var(--green); color: var(--green); }

/* busy 遮罩 */
.busy {
  position: fixed; inset: 0; z-index: 900; background: rgba(248, 250, 253, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  font-size: 15px; color: var(--text);
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(47, 107, 255, .2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
