
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  background-color: #FBF9F5;
  color: #18181B;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.dark body {
  background-color: #18181A;
  color: #F4F1EB;
}

svg.lucide {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

img { max-width: 100%; display: block; }

::selection { background: rgba(157, 66, 37, 0.18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: rgba(24, 24, 27, 0.18);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.dark ::-webkit-scrollbar-thumb {
  background-color: rgba(244, 241, 235, 0.22);
  border: 2px solid transparent;
  background-clip: content-box;
}

.border-l-3 { border-left-width: 3px; }
.backdrop-blur-xs { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

.paper-texture::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: radial-gradient(rgba(24,24,27,0.5) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.article-body.is-large { font-size: 1.15rem; line-height: 1.9; }
.article-body.is-large p { margin-top: 0.25rem; }

.post-p { margin: 0 0 1.1rem; }
.article-body .post-p { margin: 0; }

.post-h2 {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #18181B;
  margin: 1.75rem 0 0.75rem;
}
.post-h3 {
  font-family: "Newsreader", ui-serif, Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #18181B;
  margin: 1.4rem 0 0.6rem;
}
.article-body .post-h2 { margin: 0.5rem 0 0; }
.article-body .post-h3 { margin: 0.25rem 0 0; }
.dark .post-h2, .dark .post-h3 { color: #F4F1EB; }
@media (min-width: 640px) {
  .post-h2 { font-size: 1.65rem; }
  .post-h3 { font-size: 1.28rem; }
}

.post-ul, .post-ol { padding-left: 1.35rem; margin: 0 0 1.1rem; }
.post-ul { list-style: disc; }
.post-ol { list-style: decimal; }
.post-li { margin: 0.3rem 0; }
.article-body .post-ul, .article-body .post-ol { margin: 0; }

.post-figure { margin: 0 0 1.25rem; }
.article-body .post-figure { margin: 0; }
.post-img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(24, 24, 27, 0.08);
}
.dark .post-img { border-color: rgba(255, 255, 255, 0.12); }
.post-figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #71717A;
}
.dark .post-figcaption { color: #8E8D93; }

.post-quote {
  margin: 0 0 1.25rem;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid #9d4225;
  color: #47464B;
}
.article-body .post-quote { margin: 0; }
.dark .post-quote { color: #C8C5CB; border-left-color: #DE795B; }

.post-code {
  display: block;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.625rem;
  background: #F1EFE8;
  color: #27272A;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre;
}
.article-body .post-code { margin: 0; }
.dark .post-code { background: #202024; color: #E4E1DA; }

.post-inline-code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(24, 24, 27, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}
.dark .post-inline-code { background: rgba(255, 255, 255, 0.1); }

.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.post-table th, .post-table td {
  border: 1px solid rgba(24, 24, 27, 0.12);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.post-table th { background: rgba(24, 24, 27, 0.03); font-weight: 600; }
.dark .post-table th, .dark .post-table td { border-color: rgba(255, 255, 255, 0.14); }
.dark .post-table th { background: rgba(255, 255, 255, 0.04); }

.post-a {
  color: #9d4225;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-a:hover { color: #7a331c; }
.dark .post-a { color: #DE795B; }

.post-callout {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.625rem;
  background: rgba(157, 66, 37, 0.07);
  border: 1px solid rgba(157, 66, 37, 0.18);
  font-size: 0.9375rem;
}
.article-body .post-callout { margin: 0; }
.dark .post-callout {
  background: rgba(222, 121, 91, 0.12);
  border-color: rgba(222, 121, 91, 0.25);
}

.post-hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid rgba(24, 24, 27, 0.12);
}
.dark .post-hr { border-top-color: rgba(255, 255, 255, 0.14); }

.post-reading {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.article-body > .post-p,
.article-body > .post-h2,
.article-body > .post-h3,
.article-body > .post-h4,
.article-body > .post-ul,
.article-body > .post-ol,
.article-body > .post-quote,
.article-body > .post-hr {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* 配图与表格：与正文同宽居中。
   原来这里是 max-width:none（满宽），会让图和表撑破 720px 的正文列宽，
   整段看起来「鼓」出来一块（2026-10-15 修）。 */
.article-body > .post-figure,
.article-body > .post-table-wrap,
.article-body > table.post-table {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* 代码块保持满宽：代码行本来就长，收窄会频繁触发横向滚动 */
.article-body > pre.post-code {
  max-width: none;
}

.post-img { cursor: zoom-in; transition: filter 140ms ease; }
.post-figure:hover .post-img { filter: brightness(0.97); }

/* 正文内联视频：与 .post-img 同款圆角卡片，占满正文列宽 */
.post-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(24, 24, 27, 0.08);
  background: #000;
}
.dark .post-video { border-color: rgba(255, 255, 255, 0.12); }
.article-body > .post-figure > .post-video {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(15, 15, 17, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-fade 160ms ease-out;
}
.lb-overlay.lb-hidden { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: lb-pop 200ms ease-out;
}
@keyframes lb-pop { from { transform: scale(0.96); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }

.lb-img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
  cursor: default;
}
.lb-caption {
  color: #d4d2cf;
  font-size: 0.8125rem;
  text-align: center;
  max-width: 80vw;
  line-height: 1.5;
}
.lb-caption.lb-hidden { display: none; }

.lb-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 140ms ease;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-close { top: 1.25rem; right: 1.25rem; }
.lb-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #d4d2cf;
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

main.bg-surface input[type="search"],
main.bg-surface input[type="search"]::-webkit-search-decoration,
main.bg-surface input[type="search"]::-webkit-search-cancel-button,
main.bg-surface input[type="search"]::-webkit-search-results-button,
main.bg-surface input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

main.bg-surface [aria-labelledby="what-is"] > p,
main.bg-surface [aria-labelledby="how-to-choose"] li > span:last-child {
  max-width: 720px;
}

main.bg-surface [aria-labelledby="what-is"] {
  padding-top: 3rem;
}
main.bg-surface [aria-labelledby="what-is"] > h2 {
  margin-top: 0;
}

main.bg-surface section[aria-labelledby="tool-index-title"] > div p a {
  white-space: nowrap;
}

main.bg-surface > div > ul.grid > li {
  display: flex;
  flex-direction: column;
}
main.bg-surface > div > ul.grid > li > p:last-child {
  margin-top: auto;
}

main.bg-surface > div > ul.grid > li > p:first-child {
  word-spacing: -0.22em;
}

@media (min-width: 640px) and (max-width: 1023px) {
  main.bg-surface > div > ul.grid > li {
    padding: 1rem;
  }
}

@media (max-width: 639px) {
  .page-lead {
    font-size: 1rem;
    line-height: 1.75;
  }
}

main.bg-surface {
  --it-border: rgba(142, 141, 147, 0.26);
  --it-fill: #EDEAE4;
  --it-sep: #8E8D93;
}
html.dark main.bg-surface {
  --it-border: rgba(255, 255, 255, 0.1);
  --it-fill: #2B2A30;
  --it-sep: #71717A;
}

main.bg-surface .tool-item > a {
  border-color: var(--it-border);
}
main.bg-surface .tool-item > a:hover {
  border-color: rgba(157, 66, 37, 0.5);
}
main.bg-surface .tool-item > a > span:first-child {
  background-color: var(--it-fill);
}
main.bg-surface .tool-item > a > span:last-child > span {
  background-color: var(--it-fill);
  border-color: var(--it-border);
}
main.bg-surface .tool-group > div,
main.bg-surface [aria-labelledby="what-is"],
main.bg-surface #tool-filter,
main.bg-surface > div > aside.bg-surface-container-low {
  border-color: var(--it-border);
}
main.bg-surface #tool-filter:focus {
  border-color: var(--color-primary);
}
main.bg-surface > div > aside.bg-surface-container-low {
  background-color: var(--it-fill);
}
html.dark main.bg-surface .tool-item > a:hover {
  border-color: rgba(222, 121, 91, 0.45);
}

main.bg-surface .tool-item > a > span:first-child svg,
main.bg-surface [aria-labelledby="how-to-choose"] li > span:first-child svg {
  stroke-width: 1.8;
}

main.bg-surface nav[aria-label="路径导航"] > span:not(:last-child),
main.bg-surface [class*="text-outline-variant"] {
  color: var(--it-sep);
}

main.bg-surface #canvas-wrap > img {
  max-width: none;
}

/* ============================================================
   图片工具工作台 · 处理中的加载反馈（配合 template/home/imgtools/detail.html）
   为什么需要：多张图片是服务端「按顺序逐张」处理的，10 张 4MP 的图动辄几十秒。
   等待期间如果页面只有一句静态文字，用户的判断只会是"卡死了，刷新"——
   刷新会丢掉正在跑的任务，比等下去更糟。所以这里给三处动效 + 一个计时器。
   ⚠️ 本文件是手写 CSS（不是 Tailwind 产物，也没有 @apply），改这里不需要 build:css。
   ============================================================ */
@keyframes iw-spin { to { transform: rotate(360deg); } }

@keyframes iw-bar-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(263%); }
}

@keyframes iw-shimmer {
  0%, 100% { opacity: .5; }
  50%      { opacity: 1; }
}

/* 环形 spinner：用 currentColor，浅色/深色主题都不用额外配色，也不依赖图标资源 */
.iw-spinner {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: iw-spin .8s linear infinite;
}

/* 进度条改为「不确定态」循环扫过：服务端不回报单张进度，不能假装知道百分比 */
#progress-bar.is-indeterminate {
  width: 38%;
  animation: iw-bar-sweep 1.5s cubic-bezier(.45, 0, .35, 1) infinite;
}

/* 提交按钮：文案由 JS 换成「处理中…」，这里只补一个内联转圈 */
#btn-run.iw-btn-busy::before {
  content: "";
  display: inline-block;
  width: .875rem;
  height: .875rem;
  margin-right: .375rem;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: iw-spin .8s linear infinite;
}

/* 骨架行：三条灰条整体呼吸，暗示"结果马上出来" */
.iw-skeleton {
  animation: iw-shimmer 1.4s ease-in-out infinite;
}
.iw-skeleton + .iw-skeleton {
  margin-top: .625rem;
}
.iw-skeleton-line {
  height: .75rem;
  border-radius: .25rem;
  background-color: var(--it-fill, #EDEAE4);
}
.iw-skeleton-line.is-title { width: 42%; }
.iw-skeleton-line.is-meta  { width: 64%; margin-top: .5rem; }

/* 尊重系统「减少动态效果」：保留状态提示，但不再动 */
@media (prefers-reduced-motion: reduce) {
  .iw-spinner,
  #progress-bar.is-indeterminate,
  #btn-run.iw-btn-busy::before,
  .iw-skeleton {
    animation: none;
  }
  .iw-spinner,
  #btn-run.iw-btn-busy::before {
    border-top-color: currentColor;
    opacity: .55;
  }
  #progress-bar.is-indeterminate {
    width: 100%;
    opacity: .45;
  }
}

/* ============================================================
   图片对比滑块（正文用）
   正文里写：<div class="post-compare" data-before="…" data-after="…"><img …></div>
   里面那张静态拼合图是无 JS / 搜索引擎看到的版本；
   site.js 的 initCompare() 会把它升级成可拖动的对比。
   ============================================================ */
.post-compare {
  position: relative;
  --pc-pos: 50%;
}
.post-compare .pc-stage {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  line-height: 0;
}
.post-compare .pc-img {
  display: block;
  width: 100%;
  height: auto;
}
.post-compare .pc-img-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 裁掉左半边：让「处理后」出现在分隔线**右侧**（左侧留给底层的「处理前」） */
  clip-path: inset(0 0 0 var(--pc-pos));
}
.post-compare .pc-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pc-pos);
  width: 3px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 10px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.post-compare .pc-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .32);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-compare .pc-knob::before,
.post-compare .pc-knob::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.post-compare .pc-knob::before { border-right: 8px solid #2F7FE0; margin-right: 3px; }
.post-compare .pc-knob::after  { border-left: 8px solid #2F7FE0; margin-left: 3px; }
.post-compare .pc-tag {
  position: absolute;
  top: 14px;
  font-size: 13px;
  line-height: 1;
  padding: 6px 11px;
  border-radius: 7px;
  background: rgba(17, 24, 39, .62);
  color: #fff;
  letter-spacing: .03em;
  pointer-events: none;
}
.post-compare .pc-tag-b { left: 14px; }
.post-compare .pc-tag-a { right: 14px; }
.post-compare.is-dragging .pc-stage { cursor: grabbing; }
.post-compare:focus-visible { outline: 2px solid #9d4225; outline-offset: 3px; }
