/* 独立站「临时图床」：主色靛蓝 #3b5fd9（暗色按钮 #5b7cfa） */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --soft: #eef1f8;
  --text: #1c1e2a;
  --muted: #5c6170;
  --border: #e2e6ef;
  --accent: #3b5fd9;
  --accent-hover: #2e4fc7;
  --accent-ink: #2f4cb8;
  --accent-soft: #eef2ff;
  --ring: #3b5fd94d;
  --shadow: 0 1px 2px #1c244010, 0 12px 32px #1c244014;
  --glow: #d9e2ff;
  --ok: #19734a;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12141c;
  --surface: #1b1e29;
  --soft: #242836;
  --text: #eef0f6;
  --muted: #9aa0b2;
  --border: #2e3344;
  --accent: #5b7cfa;
  --accent-hover: #4c6eef;
  --accent-ink: #a8b8ff;
  --accent-soft: #222a4a;
  --ring: #5b7cfa59;
  --shadow: 0 1px 2px #0006, 0 12px 32px #0005;
  --glow: #1a2250;
  --ok: #7dcea0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -160px, var(--glow) 0%, transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
svg { flex-shrink: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-mark rect:first-child {
  fill: var(--accent);
  stroke: none;
}
.brand-name { white-space: nowrap; }

.top-controls { display: flex; align-items: center; gap: 8px; }
.lang-switch { position: relative; }
.lang-switch .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-switch svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.lang-switch .chev { width: 14px; height: 14px; color: var(--muted); }
.lang-current { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 148px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.lang-switch li button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.lang-switch button[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.theme-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.theme-switch svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
:root[data-theme="light"] .theme-switch button[data-theme-set="light"],
:root[data-theme="dark"] .theme-switch button[data-theme-set="dark"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.page {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.page-title {
  margin: 8px 0 10px;
  text-align: center;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 850;
  letter-spacing: .04em;
  line-height: 1.2;
}
.tool-head { display: flex; justify-content: center; margin: 0 0 16px; }
.quota {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
}

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 200px;
  padding: 28px 20px;
  border: 2px dashed color-mix(in srgb, var(--muted) 40%, var(--border));
  border-radius: 16px;
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  text-align: center;
}
.dropzone strong { color: var(--text); font-size: 16px; font-weight: 800; }
.dropzone .hint { font-size: 13px; font-weight: 650; }
.up-ico {
  width: 40px; height: 40px;
  fill: none; stroke: var(--accent-ink);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
}
.row-head { margin-top: 0; margin-bottom: 6px; }
.label { color: var(--text); font-size: 13px; font-weight: 750; }
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  gap: 2px;
}
.seg button {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.seg button[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 18px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 120px;
  padding: 10px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary:hover { background: var(--accent-hover); }
.actions .btn-primary { margin-left: auto; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.btn-secondary svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.result-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.result-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}
.thumb { width: 88px; height: 88px; border-radius: 12px; }
.result-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; align-items: flex-start; gap: 8px; }
.link-field {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.countdown {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.copy-btn { flex: none; }

.expired {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 48px 24px;
}
.expired-ico {
  width: 56px; height: 56px;
  fill: none; stroke: var(--accent-ink);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.expired h2 { margin: 0; font-size: 22px; font-weight: 850; }
.expired .btn-primary { min-width: 160px; margin-top: 6px; }

.legal {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .topbar { padding: 10px 14px; }
  .lang-current { display: none; }
  .page { padding: 16px 16px 40px; }
  .page-title { font-size: 28px; }
  .dropzone { min-height: 180px; }
  .actions .btn-primary { margin-left: 0; width: 100%; }
  .result-card { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px 10px; }
  .thumb { width: 72px; height: 72px; grid-column: 1; grid-row: 1; }
  .result-body, .link-row { display: contents; }
  .link-field { grid-column: 2 / -1; grid-row: 1; font-size: 12px; }
  .countdown { grid-column: 1 / 3; grid-row: 2; align-self: center; white-space: nowrap; }
  .copy-btn { grid-column: 3; grid-row: 2; justify-self: end; }
}

/* Functional controls retain the supplied layout and palette. */
#turnstile { min-height: 65px; width: 300px; max-width: 100%; }
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.thumb { object-fit: cover; background: var(--soft); }
textarea.link-field { width: 100%; height: auto; field-sizing: content; resize: none; font-family: inherit; }
#notice { color: var(--accent-ink); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  :root[lang="en"] .brand-name { font-size: 14px; letter-spacing: 0; }
}
#notice.is-full { max-width: 540px; margin: 0 auto; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #9a5b00; background: #fff6e5; border: 1px solid #f3d9a4; }
[data-theme="dark"] #notice.is-full { color: #f5c46b; background: rgba(245, 180, 60, .12); border-color: rgba(245, 180, 60, .35); }
