:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #20242b;
  --muted: #687080;
  --line: #dfe3ea;
  --accent: #1f6feb;
  --accent-strong: #1557ba;
  --success: #147d3f;
  --danger: #c9372c;
  --warning: #8a5a00;
  --shadow: 0 12px 28px rgba(20, 28, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 980px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.14);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
  padding: 18px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.25;
}

.topbar p,
.panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #f8fafc;
}

.shell {
  width: min(1320px, calc(100% - 48px));
  margin: 24px auto 40px;
}

.workspace {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel.narrow {
  width: min(560px, 100%);
  margin: 72px auto 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.history-toolbar {
  align-items: flex-end;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar input {
  width: 260px;
}

.login-form {
  margin-top: 18px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 170px;
  border: 2px dashed #b9c2d0;
  border-radius: 8px;
  background: #fbfcfe;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone strong {
  font-size: 20px;
  line-height: 1.2;
}

.drop-zone span {
  color: var(--muted);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: #eef5ff;
}

.queue {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #ffffff;
}

.queue-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item span {
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item.success span {
  color: var(--success);
}

.queue-item.error span {
  color: var(--danger);
}

.image-list {
  display: grid;
  gap: 10px;
}

.image-row {
  display: grid;
  grid-template-columns: 76px minmax(220px, 1.1fr) minmax(320px, 1.6fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.thumb-link {
  display: block;
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f2f4f7;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta,
.file-original {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-field {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
}

.row-actions button {
  min-width: 56px;
  padding-inline: 12px;
}

.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: #b9c2d0;
  background: #f1f4f8;
}

.danger-button {
  border-color: #f0c3bf;
  background: #fff5f4;
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  background: #ffe9e7;
}

.message {
  min-height: 22px;
  color: var(--muted);
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

.message.warning {
  color: var(--warning);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfe;
}

.hidden,
[hidden] {
  display: none !important;
}

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