:root {
  --bg: #eef1f7;
  --card: #fff;
  --text: #1f2430;
  --muted: #7b8296;
  --border: #e4e8f1;
  --accent: #4f6ef7;
  --accent-2: #7a5cf0;
  --danger: #d9363e;
  --success-bg: #eef9f3;
  --success-border: #c9ead8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 45, 80, .08);
  --shadow-lg: 0 18px 50px rgba(31, 45, 80, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 15% -10%, #dbe3ff 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 5%, #f0e2ff 0%, transparent 55%),
    linear-gradient(160deg, #eef1f7 0%, #e8ecf6 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 8px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 750;
}

.topbar .sub, .muted, .hint { color: var(--muted); }
.topbar .sub, .muted { font-size: 13px; }
.small, .hint { font-size: 12px; }
.hint { margin-top: 8px; line-height: 1.6; }

.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

.security-note {
  padding: 13px 16px;
  color: #38604b;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
}

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

.view { display: flex; flex-direction: column; gap: 20px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 { margin: 0; font-size: 16px; font-weight: 650; }

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 14px;
  color: var(--text);
  background: #f8f9fd;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  transition: border-color .2s, box-shadow .2s;
}

textarea:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .15);
}

.danger-text { color: var(--danger); font-weight: 650; }

.btn {
  padding: 8px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  transition: all .18s ease;
}

.btn:hover { background: #f5f7fb; border-color: #cdd3e2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: wait; opacity: .65; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(79, 110, 247, .28);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.big { padding: 12px 26px; font-size: 15px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fff1f1; border-color: var(--danger); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
  border: 2px dashed #cdd5e8;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
}

.dropzone:hover, .dropzone:focus, .dropzone.over {
  color: var(--accent);
  background: #f6f8ff;
  border-color: var(--accent);
  outline: none;
}
.dropzone svg { color: var(--accent); opacity: .85; }
.dz-text { color: var(--text); font-size: 14px; font-weight: 550; }

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.file-list .empty { padding: 14px 0; color: var(--muted); text-align: center; font-size: 13px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.file-item:hover { background: #f6f8ff; }
.thumb {
  display: flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: #eef1f8;
  border-radius: 10px;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.generic span { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.file-item .info { flex: 1; min-width: 0; }
.file-item .name {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
}
.file-item .name:hover { color: var(--accent); }
.file-item .meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.file-item .actions { display: flex; flex: 0 0 auto; gap: 6px; }

.create-bar { display: flex; gap: 10px; margin-top: 4px; }
.result-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.result-url {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  overflow-wrap: anywhere;
  color: var(--accent);
  background: #f6f8ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

pre#viewText {
  min-height: 180px;
  margin: 0;
  padding: 14px;
  color: var(--text);
  background: #f8f9fd;
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.expiry { color: var(--muted); text-align: center; font-size: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 44px 20px; text-align: center; }
.big-text { color: var(--muted); font-size: 16px; font-weight: 600; }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 30px;
  padding: 11px 20px;
  color: #fff;
  background: #2b3140;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
  transition: opacity .25s, transform .25s;
  font-size: 13px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

.footer {
  margin-top: 12px;
  padding: 16px 0 8px;
  color: #9198a7;
  text-align: center;
  border-top: 1px solid rgba(220, 224, 234, .8);
  font-size: 12px;
}
.footer a { color: #737c91; text-decoration: none; }
.footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .topbar { flex-direction: column; gap: 4px; padding-top: 24px; }
  .card { padding: 16px; }
  .card-head { flex-direction: column; align-items: flex-start; }
  .file-item { flex-wrap: wrap; }
  .file-item .actions { width: 100%; justify-content: flex-end; }
  .create-bar .btn { width: 100%; }
}
