:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #ede9fe;
  --accent-text: #5b21b6;
  --danger: #dc2626;
  --warn-bg: #fef3c7;
  --warn-text: #b45309;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-muted: #0f172a;
  --border: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.16);
  --accent-text: #ddd6fe;
  --danger: #f87171;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --warn-text: #fcd34d;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 18px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 8px;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--surface);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.tabs-bar {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="dark"] .tab-btn.active {
  color: #0f172a;
}

.drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  outline: none;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-title {
  font-size: 15px;
  font-weight: 600;
}

.drop-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 14px;
}

.btn-primary {
  border: none;
  background: var(--accent);
  color: #ffffff;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

html[data-theme="dark"] .btn-primary {
  color: #0f172a;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
}

.count-badge {
  font-size: 12px;
  color: var(--text-muted);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.img-thumb-wrap {
  height: 160px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.img-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.img-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-info {
  font-size: 11px;
  color: var(--text-muted);
}

.img-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.action-btn {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.action-btn:hover {
  border-color: var(--accent);
}

.action-btn.danger {
  color: var(--danger);
}

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

.paste-row {
  margin-bottom: 10px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
}

.input:focus,
.textarea:focus {
  border-color: var(--accent);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.select {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
}

.paste-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ttl-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
}

.pastes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paste-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.paste-item-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.paste-link {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.burn-pill {
  display: inline-block;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.locked-box {
  text-align: center;
  padding: 24px 12px;
}

.paste-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.burn-notice {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.paste-pre {
  margin: 0;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.65;
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.modal-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 70;
}

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 10px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 80;
  pointer-events: none;
}

html[data-theme="dark"] .toast {
  background: #f1f5f9;
  color: #0f172a;
}
