/* A compact desktop tool: cool paper, quiet chrome, one blue action. */
:root {
  color-scheme: light;
  --page: #f3f5f8;
  --surface: #ffffff;
  --soft: #f8f9fc;
  --ink: #202c3e;
  --muted: #637189;
  --line: #e4e9f1;
  --accent: #2465da;
  --accent-hover: #194fb3;
  --tint: #edf3ff;
  --on-accent: #ffffff;
  --error: #b63650;
  --error-bg: #fff0f3;
  --shadow: 0 3px 6px rgb(26 45 78 / 2%), 0 20px 50px -28px rgb(26 45 78 / 22%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #11161f;
  --surface: #1a2230;
  --soft: #171e2a;
  --ink: #e5ebf5;
  --muted: #9daac0;
  --line: #2d384a;
  --accent: #91b5ff;
  --accent-hover: #b6ceff;
  --tint: #24334e;
  --on-accent: #142139;
  --error: #ff9db1;
  --error-bg: #3c2330;
  --shadow: 0 20px 50px -28px rgb(0 0 0 / 50%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100dvh; display: flex; flex-direction: column; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { transition: background-color 140ms, border-color 140ms, color 140ms; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.site-header, main, footer { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.site-header { min-height: 80px; padding-inline: 8px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 700; letter-spacing: -.9px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 35px; color: white; background: #2465da; border-radius: 9px 9px 9px 3px; font: 700 24px Georgia, serif; transform: rotate(-6deg); box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%); }
.site-header nav { display: flex; align-items: center; gap: 26px; font-size: 12px; color: var(--muted); }
.site-header nav > a { padding-block: 12px; }
.site-header nav > a span { padding-left: 3px; }
.theme-switcher { display: flex; gap: 2px; padding: 3px; background: var(--line); border-radius: 10px; }
.theme-switcher button { display: grid; place-items: center; width: 33px; height: 31px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.theme-switcher svg { width: 16px; height: 16px; }
.theme-switcher button:hover { color: var(--ink); }
.theme-switcher button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgb(24 40 65 / 9%); }
.language-switcher { display: flex; gap: 2px; padding: 3px; background: var(--line); border-radius: 10px; }
.language-switcher a { display: grid; place-items: center; min-width: 33px; height: 31px; padding: 0 7px; border-radius: 7px; color: var(--muted); font-size: 11px; }
.language-switcher a:hover { color: var(--ink); }
.language-switcher a.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgb(24 40 65 / 9%); }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 25px 8px 30px; }
h1 { display: flex; align-items: center; gap: 15px; margin: 0; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.3; letter-spacing: -1.4px; font-weight: 650; }
.title-label { font-size: 11px; font-weight: 500; letter-spacing: .2px; color: var(--accent); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; white-space: nowrap; }
.intro-copy > p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.benefits { display: flex; align-items: center; gap: 30px; }
.benefits p, .benefits a { display: flex; flex-direction: column; margin: 0; gap: 7px; }
.benefits strong { font-size: 13px; font-weight: 600; }
.benefits strong span { font-size: 12px; color: var(--muted); }
.benefits > * > span { color: var(--muted); font-size: 11px; }
.tool { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.tool-bar { min-height: 51px; padding: 9px 28px; display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.tool-heading { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 13px; }
.tool-heading > svg { color: var(--accent); width: 17px; height: 17px; }
.file-count { font-size: 12px; font-weight: 400; color: var(--muted); }
.tool:not(:has(#startCard[hidden])) .file-count { display: none; }
.tool:has(#startCard[hidden]) .empty-heading { display: none; }
.local-note { margin-left: auto; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.local-note svg { width: 13px; height: 13px; }
.start-card { padding: 20px; }
.dropzone { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 294px; border: 1px dashed #ccd6e7; border-radius: 10px; background: var(--soft); padding: 26px; }
html[data-theme="dark"] .dropzone { border-color: #43516a; }
.dropzone.drag { border-color: var(--accent); background: var(--tint); }
.folder-symbol { width: 60px; height: 56px; display: grid; place-items: center; margin-bottom: 15px; color: var(--accent); }
.folder-symbol svg { width: 56px; height: 49px; stroke-width: 1.8; }
.folder-symbol svg > path:first-child { fill: var(--tint); }
.dropzone h2 { font-size: 23px; letter-spacing: -.6px; font-weight: 600; margin: 0; }
.dropzone p { font-size: 12px; color: var(--muted); margin: 8px 0 20px; text-align: center; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 43px; padding: 10px 20px; color: var(--on-accent); background: var(--accent); border: 1px solid transparent; border-radius: 8px; white-space: nowrap; font-size: 13px; font-weight: 600; box-shadow: 0 3px 7px rgb(30 75 150 / 12%); }
.primary-button svg { width: 17px; height: 17px; }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { color: var(--muted); background: var(--line); box-shadow: none; }
.drop-footnote { font-size: 11px; color: var(--muted); margin-top: 14px; }
.workspace { display: none; }
.tool:has(#startCard[hidden]) .workspace { display: block; }
.tool:has(#startCard[hidden]) #reselectBtn { margin-left: auto; }
.tool:has(#startCard[hidden]) .local-note { margin-left: 0; }
.rename-step { padding: 22px 28px 20px; border-bottom: 1px solid var(--line); }
.edit-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.edit-heading label { font-weight: 600; }
.edit-heading > span { font-size: 11px; color: var(--muted); }
#templateInput { width: 100%; min-height: 49px; padding: 12px 14px; background: var(--soft); color: var(--ink); border: 1px solid #b8c9e4; border-radius: 8px; font-family: "Cascadia Code", Consolas, "Microsoft YaHei", monospace; font-size: 14px; }
#templateInput:focus { outline: 3px solid var(--tint); border-color: var(--accent); }
html[data-theme="dark"] #templateInput { border-color: #4c6387; }
.template-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.quick-actions > span { color: var(--muted); font-size: 11px; margin-right: 3px; }
.quick-actions button { border: 1px solid var(--line); padding: 5px 11px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 11px; }
.quick-actions button:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 28px; }
.preview-heading > div { display: flex; align-items: baseline; gap: 14px; }
.preview-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.preview-hint { font-size: 11px; color: var(--muted); }
.table-wrap { overflow: auto; max-height: max(240px, calc(100dvh - 455px)); overscroll-behavior: contain; scrollbar-width: thin; border-block: 1px solid var(--line); }
table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.7; }
.check-col { width: 50px; }
.number-col { width: 48px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 16px; color: var(--muted); background: var(--soft); text-align: left; font-size: 11px; font-weight: 500; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
th:nth-child(1), td:nth-child(1) { text-align: center; padding-left: 16px; padding-right: 4px; }
th:nth-child(2), td:nth-child(2) { padding-inline: 6px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft); }
.col-old { color: var(--muted); }
.col-new { color: var(--ink); }
input[type="checkbox"] { width: 15px; height: 15px; margin: 3px 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.row-unchecked { opacity: .5; }
.diff-added { color: #174998; background: #dceaff; padding: 2px 1px; border-radius: 3px; }
.diff-removed { color: #9d3a52; background: #ffe4eb; padding: 2px 1px; border-radius: 3px; text-decoration: line-through; }
html[data-theme="dark"] .diff-added { color: #cee0ff; background: #304d79; }
html[data-theme="dark"] .diff-removed { color: #ffbfd0; background: #573042; }
.diff-legend { display: flex; align-items: center; gap: 15px; padding: 11px 28px; font-size: 10px; color: var(--muted); }
.diff-legend mark { padding: 2px 5px; }
.confirm-note { margin-left: auto; }
.tool-bottom { padding: 13px 28px; border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; background: var(--soft); display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: start; }
.advanced-options { font-size: 11px; }
.advanced-options summary { width: max-content; color: var(--muted); padding-block: 3px; }
.advanced-options summary:hover { color: var(--accent); }
.advanced-content { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; padding-top: 14px; }
.advanced-content label { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); }
select { min-height: 32px; border: 1px solid var(--line); padding: 4px 8px; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 11px; }
.tool-bottom:has(details[open]) { grid-template-columns: 1fr; }
.quiet-button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 11px; }
.quiet-button:hover { color: var(--accent); border-color: var(--accent); }
.status { margin: 0; padding-block: 3px; text-align: right; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.status.err { color: var(--error); font-weight: 600; }
.tool:not(:has(#startCard[hidden])) .status:not(.err) { display: none; }
.below-tool { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 19px 8px; font-size: 11px; color: var(--muted); }
.below-tool p { margin: 0; }
.separator { padding-inline: 12px; color: var(--line); }
.usage-stats { display: flex; gap: 24px; }
.usage-stats strong { color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin-inline: 3px; }
footer { margin-top: auto; display: flex; justify-content: space-between; gap: 15px; padding: 22px 8px 24px; color: var(--muted); font-size: 10px; }
footer > span:first-child { font-weight: 600; }
.banner { padding: 12px 18px; margin-bottom: 16px; color: var(--error); background: var(--error-bg); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.banner a { text-decoration: underline; }
.toast { position: fixed; z-index: 20; top: 84px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 14px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.toast.ok { color: var(--accent); border-color: var(--accent); }
.toast.err { color: var(--error); }
.modal { position: fixed; z-index: 30; inset: 0; padding: 24px; display: grid; place-items: center; background: rgb(15 24 40 / 45%); overscroll-behavior: contain; }
.modal-card { width: min(430px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 16px; font-size: 20px; }
.modal-card p { overflow-wrap: anywhere; }
.modal-hint { color: var(--muted); font-size: 13px; }
.modal-card button { margin-top: 12px; width: 100%; }
.drop-overlay { position: fixed; z-index: 25; inset: 12px; display: grid; place-items: center; pointer-events: none; border: 2px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--accent); }
.drop-overlay svg { width: 40px; height: 40px; }
.drop-overlay strong { font-size: 25px; font-weight: 600; }
.drop-overlay span { font-size: 13px; color: var(--muted); }
.skip-link { position: fixed; z-index: 40; top: 10px; left: 10px; transform: translateY(-160%); background: var(--surface); color: var(--accent); padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .tool:has(#startCard[hidden]) .workspace { animation: reveal-workspace 180ms ease-out; }
  @keyframes reveal-workspace { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 1000px) {
  .site-header, main, footer { width: calc(100% - 48px); }
  .benefits { gap: 18px; }
  .title-label { display: none; }
}
@media (max-width: 760px) {
  .site-header, main, footer { width: calc(100% - 28px); }
  .site-header { min-height: 70px; padding-inline: 3px; gap: 12px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 27px; height: 30px; font-size: 21px; }
  .site-header nav { gap: 6px; }
  .theme-switcher button, .language-switcher a { min-width: 27px; width: 27px; height: 29px; padding-inline: 3px; }
  .site-header nav > a:first-child { display: none; }
  .intro { padding: 16px 4px 24px; flex-direction: column; align-items: stretch; gap: 22px; }
  h1 { font-size: 29px; letter-spacing: -.8px; }
  .title-label { display: inline; }
  .intro-copy > p { font-size: 13px; margin-top: 8px; }
  .benefits { justify-content: space-between; gap: 10px; }
  .benefits strong { font-size: 12px; }
  .benefits > * > span { font-size: 10px; }
  .tool { border-radius: 13px; }
  .tool-bar { padding-inline: 16px; min-height: 53px; }
  .tool-heading { font-size: 12px; }
  .tool:has(#startCard[hidden]) .local-note { display: none; }
  .file-count { font-size: 11px; }
  .start-card { padding: 12px; }
  .dropzone { min-height: 280px; padding: 22px 12px; }
  .dropzone h2 { font-size: 21px; }
  .rename-step { padding: 18px 16px; }
  .edit-heading { gap: 10px; }
  .edit-heading label { font-size: 13px; }
  .edit-heading > span { display: none; }
  #templateInput { font-size: 16px; }
  .quick-actions button { min-height: 36px; }
  .preview-heading { padding: 14px 16px; }
  .preview-hint { display: none; }
  .preview-heading .primary-button { padding-inline: 13px; }
  .table-wrap { max-height: 460px; }
  .check-col { width: 31px; }
  .number-col { width: 30px; }
  th, td { padding: 10px 8px; font-size: 11px; }
  th:nth-child(1), td:nth-child(1) { padding-left: 8px; }
  .diff-legend { padding-inline: 16px; gap: 8px; flex-wrap: wrap; }
  .confirm-note { font-size: 9px; }
  .tool-bottom { padding: 10px 16px; grid-template-columns: 1fr; gap: 3px; border-radius: 0 0 13px 13px; }
  .advanced-options summary { padding-block: 8px; }
  .status { text-align: left; }
  .below-tool { flex-direction: column-reverse; gap: 13px; padding-block: 18px; }
  .usage-stats { justify-content: center; flex-wrap: wrap; gap: 8px 22px; }
  footer { padding-block: 12px 18px; }
}
@media (max-height: 800px) and (min-width: 761px) {
  .site-header { min-height: 64px; }
  .intro { padding-block: 16px 22px; }
  .intro-copy > p { margin-top: 8px; }
  .tool:has(#startCard[hidden]) .rename-step { padding-block: 16px; }
  body:has(#startCard[hidden]) .intro { padding-block: 8px 17px; }
  body:has(#startCard[hidden]) .intro h1 { font-size: 28px; }
  body:has(#startCard[hidden]) .intro-copy > p { display: none; }
}
