* { box-sizing: border-box; }
body {
  margin: 0; padding: 26px 18px 60px;
  background: #0f1115; color: #e6e9ef;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.shell { max-width: 980px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 6px; }
.sub { color: #8b93a7; font-size: 14px; margin: 0 0 22px; }
.sub b { color: #35c46b; }

/* ---------- 顶栏:语言选择 ---------- */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 14px; }
.langbar {
  display: inline-flex; background: #171a21;
  border: 1px solid #262b36; border-radius: 9px; overflow: hidden;
}
.langbar .lang-label {
  display: inline-flex; align-items: center;
  padding: 0 4px 0 12px; font-size: 12px; color: #5d6577;
}
.langbar a.lang-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; font-size: 13px;
  color: #8b93a7; text-decoration: none; transition: .15s;
}
.langbar a.lang-link + a.lang-link { border-left: 1px solid #262b36; }
.langbar a.lang-link:hover { color: #e6e9ef; background: #1c2230; }
.langbar a.lang-link.on { background: #232a38; color: #e6e9ef; font-weight: 600; }

/* ---------- 正文内容 ----------
   这部分不只是给用户看的,更是给搜索引擎看的:
   爬虫抓走这一页,得能读到"这是什么、怎么用、能解决什么问题",
   否则它只能看到一堆按钮标签,被判定为"内容单薄"
   (Bing 指南原话:内容单薄的网站排名通常不好)。 */
.doc {
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid #262b36;
  color: #b8c0d0; font-size: 14.5px; line-height: 1.8;
}
.doc h2 { font-size: 17px; color: #e6e9ef; margin: 28px 0 10px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 14.5px; color: #e6e9ef; margin: 18px 0 6px; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc b, .doc strong { color: #e6e9ef; }
.doc .faq {
  background: #171a21; border: 1px solid #262b36;
  border-radius: 12px; padding: 2px 18px; margin-top: 14px;
}
.doc .faq h3 { margin-top: 17px; }
.doc .faq h3 + p { margin-bottom: 17px; }

/* ---------- 左右布局 ---------- */
.layout { display: grid; grid-template-columns: 186px 1fr; gap: 18px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 22px; }
.nav {
  text-align: left; width: 100%;
  background: #171a21; border: 1px solid #262b36;
  color: #8b93a7; border-radius: 10px; padding: 11px 14px;
  font: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.nav:hover:not(:disabled) { color: #e6e9ef; }
.nav.active { background: #1c2637; border-color: #4f8cff; color: #e6e9ef; }
.nav:disabled { opacity: .4; cursor: not-allowed; }
.nav .tip { display: block; font-weight: 400; font-size: 11.5px; color: #6b7488; margin-top: 2px; }
.nav.active .tip { color: #8b93a7; }

/* ---------- 卡片 ---------- */
.card {
  background: #171a21; border: 1px solid #262b36;
  border-radius: 12px; padding: 18px; margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.cardhint {
  font-size: 12.5px; color: #6b7488; margin: 12px 0 0;
  padding-top: 11px; border-top: 1px solid #262b36;
}
.cardhint b { color: #8b93a7; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-size: 13px; color: #8b93a7; margin-bottom: 7px; }

input[type=file] {
  width: 100%; color: #e6e9ef; font: inherit;
  background: #0d1017; border: 1px solid #262b36; border-radius: 8px; padding: 10px;
}
input[type=number], select {
  width: 100%; font: inherit; padding: 10px;
  background: #0d1017; color: #e6e9ef;
  border: 1px solid #262b36; border-radius: 8px;
}
input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline { display: flex; gap: 8px; }
.inline input[type=number] { flex: 1; min-width: 0; }
.inline select { width: auto; flex: 0 0 auto; }

/* ---------- 输出尺寸 ---------- */
.dims { margin-top: 16px; padding-top: 15px; border-top: 1px solid #262b36; }
/* 单独成卡时不需要那道上分隔线 */
.dims.standalone { margin-top: 0; padding-top: 0; border-top: 0; }
.dims-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap;
}
.dims-title { font-size: 13px; color: #8b93a7; }
.dims-note { font-size: 12px; color: #6b7488; font-variant-numeric: tabular-nums; }
.dims-slider { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.dims-slider input[type=range] { flex: 1; min-width: 0; accent-color: #4f8cff; }
.dims-slider .val {
  color: #e6e9ef; font-variant-numeric: tabular-nums; font-weight: 600;
  min-width: 3.4em; text-align: right;
}
.dims-nums { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.dims-nums label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12.5px; color: #8b93a7;
}
.dims-nums input[type=number] {
  width: 104px; padding: 7px 9px; font-size: 13px;
  text-align: right; font-variant-numeric: tabular-nums;
}
.dims-nums .times { color: #6b7488; padding-bottom: 9px; }
button.tiny { width: auto; padding: 7px 12px; font-size: 12px; font-weight: 500; }
.check {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  font-size: 12.5px; color: #8b93a7; cursor: pointer;
}
.check input { width: 15px; height: 15px; accent-color: #4f8cff; }
.check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.dims-hint {
  font-size: 12px; color: #6b7488; margin: 14px 0 0; line-height: 1.65;
}
.dims-hint b { color: #8b93a7; }

button {
  width: 100%; font: inherit; font-weight: 600; cursor: pointer;
  background: #4f8cff; color: #fff; border: 0;
  border-radius: 9px; padding: 12px;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: #232a38; color: #e6e9ef; }
button.mini {
  width: auto; padding: 4px 11px; font-size: 12px; font-weight: 500;
  background: #232a38; color: #e6e9ef; border-radius: 6px;
}

/* ---------- 标准模式:图片信息面板 ---------- */
.info {
  margin: 4px 0 18px; padding: 13px 15px;
  background: #0d1017; border: 1px solid #262b36; border-radius: 10px;
  font-size: 13px;
}
.info .line { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; }
.info .k { color: #8b93a7; flex: 0 0 auto; }
.info .v {
  text-align: right; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.info .size-line { padding: 6px 0 8px; }
.info .size-v { color: #4f8cff; font-weight: 700; font-size: 18px; line-height: 1.3; }
.info .hint {
  margin-top: 8px; padding-top: 9px; border-top: 1px solid #262b36;
  color: #8b93a7; font-size: 12.5px;
}
.info .hint b { color: #e6e9ef; }

/* ---------- 批量 / 高级 ---------- */
.batch-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.batch-bar .sum {
  flex: 1; min-width: 170px;
  font-size: 12.5px; color: #8b93a7;
  font-variant-numeric: tabular-nums;
}
.batch-bar .sum b { color: #e6e9ef; }
.batch-bar button { width: auto; padding: 8px 14px; font-size: 13px; }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.batch { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.batch th {
  text-align: left; font-weight: 500; font-size: 11.5px;
  color: #6b7488; padding: 0 9px 7px; border-bottom: 1px solid #262b36;
  white-space: nowrap;
}
table.batch td { padding: 6px 9px; border-bottom: 1px solid #1e222b; white-space: nowrap; }
table.batch tr:last-child td { border-bottom: 0; }
td.fname { max-width: 170px; overflow: hidden; text-overflow: ellipsis; color: #e6e9ef; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: #8b93a7; }
tr.done td.num.new { color: #35c46b; font-weight: 700; }
tr.done td.num.new.warn { color: #e0a32e; }
td.res { font-size: 12px; color: #6b7488; }
td.res.ok { color: #35c46b; }
td.res.warn { color: #e0a32e; }
td.res.err { color: #ff6b6b; white-space: normal; }
tr.working td.res { color: #4f8cff; }
td.act { text-align: right; }
td.cfg { white-space: nowrap; }

/* 高级尺寸:一行里放两个输入框 + 下面一行原始尺寸 */
.cfg-line { display: flex; align-items: center; gap: 5px; }
.cfg-line .x { color: #6b7488; font-size: 11px; }
.cfg-sub {
  font-size: 11px; color: #5d6577; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
td.cfg input.mini-num { width: 62px; }

/* 行内的小控件(高级模式每张单独设定用) */
input.mini-num {
  width: 58px; padding: 3px 7px; font-size: 12px;
  background: #0d1017; border: 1px solid #2e3644; border-radius: 6px;
  color: #e6e9ef; text-align: right;
}
select.mini-sel {
  width: auto; padding: 3px 6px; font-size: 12px;
  background: #0d1017; border: 1px solid #2e3644; border-radius: 6px;
  color: #e6e9ef;
}
/* 单独设过的行给个左边框提示,一眼能看出哪些被改过 */
tr.customized td.cfg { box-shadow: inset 2px 0 0 #4f8cff; }

.empty { padding: 26px 10px; text-align: center; color: #6b7488; font-size: 13px; }
.msg { font-size: 12.5px; margin: 10px 0 0; }
.msg.err { color: #ff6b6b; }
.msg.dim { color: #8b93a7; }
.msg.ok { color: #35c46b; }

/* ---------- 结果 ---------- */
.stats { display: grid; gap: 8px; font-variant-numeric: tabular-nums; }
.stats div { display: flex; justify-content: space-between; gap: 12px; }
.stats .k { color: #8b93a7; }
.stats .v { text-align: right; }
.big { font-size: 17px; font-weight: 600; }
.ok { color: #35c46b; }
.warn { color: #e0a32e; }
.err { color: #ff6b6b; }

img.preview {
  max-width: 100%; max-height: 260px; display: block;
  margin: 16px auto 0; border-radius: 8px; background: #0d1017;
}
a.dl {
  display: block; text-align: center; margin-top: 16px;
  background: #232a38; color: #e6e9ef; text-decoration: none;
  border-radius: 9px; padding: 12px; font-weight: 600;
}

@media (max-width: 680px) {
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .sidebar { flex-direction: row; position: static; flex-wrap: wrap; }
  .nav { padding: 9px 10px; font-size: 13px; flex: 1 1 auto; }
  .nav .tip { display: none; }
  .row2 { grid-template-columns: 1fr; }
}
