/* tool.sixone.top — paper / ink style, matches x2.fosare.com */
:root {
  --paper: #f5f1e8;
  --ink: #1f1d1a;
  --soft: #6b655b;
  --rule: #d9d2c3;
  --red: #b8432f;
  --green: #3d7a4a;
  --field: #fbf9f4;

  /* aliases used by admin.css */
  --bg: var(--paper);
  --card: var(--field);
  --border: var(--rule);
  --text: var(--ink);
  --text-sub: var(--soft);
  --primary: var(--red);
  --primary-hover: #9e3726;
  --accent: var(--red);
  --success: var(--green);
  --error: var(--red);
  --radius: 3px;
  --shadow: none;

  --serif: "Songti SC","STSong","Noto Serif CJK SC","Source Han Serif SC","SimSun",Georgia,serif;
  --sans: -apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  --mono: "SF Mono",Menlo,Consolas,"Courier New",monospace;
}
[data-theme="dark"] {
  --paper: #1b1a17;
  --ink: #e9e4d8;
  --soft: #9a9385;
  --rule: #3a362f;
  --red: #d0644f;
  --green: #6fae7c;
  --field: #23211d;
  --primary-hover: #e07a66;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.85 var(--serif);
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
.mono { font-family: var(--mono); font-size: .86em; }
.sans { font-family: var(--sans); }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--red); }
button, input, select { font: inherit; color: inherit; }

.page { max-width: 640px; margin: 0 auto; padding: 56px 22px 40px; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 28px; }
.kicker-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kicker { font-size: 13px; color: var(--soft); letter-spacing: 1px; }
.masthead h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.25; margin: 6px 0 4px; font-weight: 700; word-break: break-word; }
.masthead h1 small { font-size: .42em; color: var(--red); font-weight: 400; vertical-align: middle; margin-left: 8px; white-space: nowrap; }
.sub { color: var(--soft); }
.header-actions { display: flex; gap: 14px; }

.link-btn {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  color: var(--soft); font-size: 13px;
  border-bottom: 1px solid transparent;
}
.link-btn:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- notice ---------- */
.notice-bar {
  border-left: 3px solid var(--red);
  padding: 2px 0 2px 14px;
  margin-bottom: 26px;
  color: var(--ink);
  font-size: 15px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  padding: 7px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--red); color: var(--red); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { border-color: var(--rule); color: var(--soft); }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- drop zone ---------- */
.drop-zone {
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius);
  padding: 30px 20px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--red); background: var(--field); }
.drop-zone.happy { border-color: var(--green); border-style: solid; }
.drop-zone.error { border-color: var(--red); border-style: solid; }
.drop-zone.loading { border-color: var(--red); }
.drop-zone.loading .arrow { animation: nudge .9s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }

.drop-art { width: 100%; max-width: 260px; height: auto; color: var(--ink); display: block; margin: 0 auto 10px; }
.drop-art .arrow { stroke: var(--red); }
.drop-zone h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; }
.drop-sub { color: var(--soft); font-size: 14px; margin-bottom: 16px; }

/* ---------- section heading (like x2) ---------- */
.sec { font-size: 1.1rem; margin: 40px 0 6px; display: flex; align-items: baseline; gap: 10px; }
.sec .no { color: var(--red); font-size: .85em; }
.sec .rule { flex: 1; border-bottom: 1px solid var(--rule); min-width: 20px; }
.sec-meta { font-size: 13px; color: var(--soft); font-weight: 400; white-space: nowrap; }

ul.queue-list, ul.result-list { list-style: none; }

/* ---------- queue ---------- */
.queue-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
}
.queue-file-icon {
  font-family: var(--mono); font-size: 11px; color: var(--red);
  border: 1px solid var(--red); border-radius: 2px;
  padding: 0 5px; line-height: 18px; height: 20px; margin-top: 4px;
}
.queue-file-info { min-width: 0; }
.queue-file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; margin-bottom: 8px; }
.queue-item-actions {
  grid-column: 2;
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
}
.btn-convert {
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 14px; padding: 6px 18px;
  border-radius: var(--radius); cursor: pointer; white-space: nowrap;
}
.btn-convert:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-convert:disabled { opacity: .5; cursor: default; }
.btn-remove {
  background: none; border: 0; cursor: pointer; color: var(--soft);
  font-family: var(--sans); font-size: 13px; padding: 4px 2px;
}
.btn-remove:hover { color: var(--red); }

.target-select {
  -webkit-appearance: none; appearance: none;
  width: 100%; max-width: 320px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--field);
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding: 7px 32px 7px 10px;
  font-family: var(--sans); font-size: 14px; line-height: 1.4;
  color: var(--ink);
  text-overflow: ellipsis;
  cursor: pointer;
}
.target-select:focus, .compress-mb:focus { outline: none; border-color: var(--red); }

/* image compression */
.compress-opts {
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 8px; row-gap: 4px;
  margin-top: 10px;
  font-family: var(--sans); font-size: 14px;
}
.compress-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.compress-mb {
  width: 6.5em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--field);
  padding: 6px 8px;
  font-family: var(--mono); font-size: 15px;
  color: var(--ink);
}
.compress-hint { color: var(--soft); font-size: 13px; white-space: nowrap; }

/* ---------- results ---------- */
.result-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
}
.result-status { font-family: var(--mono); font-size: 13px; }
.result-status.success { color: var(--green); }
.result-status.failed { color: var(--red); }
.result-file-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta {
  grid-column: 2 / 4; grid-row: 2;
  font-family: var(--sans); font-size: 13px; color: var(--soft);
  word-break: break-word;
}
.result-item.failed .result-meta { color: var(--red); }
.result-actions { grid-column: 3; grid-row: 1; }
.btn-download {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--red);
  text-underline-offset: 3px; text-decoration-thickness: 1.5px; white-space: nowrap;
}
.btn-download:hover { color: var(--red); }

/* ---------- footer ---------- */
.foot {
  margin-top: 56px; padding-top: 18px;
  border-top: 2px solid var(--ink);
  font-size: 14px; color: var(--soft);
  display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
}

/* ---------- toast ---------- */
.toast-container {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  padding: 10px 16px; border-radius: var(--radius);
  border-left: 3px solid var(--green);
  max-width: 360px; word-break: break-word;
  transition: opacity .3s, transform .3s;
}
.toast.error { border-left-color: var(--red); }

/* ---------- admin page top bar (admin.html) ---------- */
.header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.header-inner { max-width: 1000px; margin: 0 auto; padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.logo { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo-icon { display: none; }
.logo-en { color: var(--red); font-family: var(--sans); font-size: .6em; font-weight: 400; }

@media (max-width: 520px) {
  .page { padding: 34px 16px 32px; }
  .masthead h1 small { display: block; margin: 2px 0 0; }
  .drop-zone { padding: 22px 14px 26px; }
  .target-select { max-width: none; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
  .foot { flex-direction: column; }
}
