﻿:root {
  --bg: #0f172a;
  --card: rgba(255, 255, 255, 0.92);
  --card-strong: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.10);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft: #eff6ff;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background: radial-gradient(circle at top left, #1e3a8a 0, #0f172a 44%, #020617 100%);
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.bg-orb { position: fixed; width: 320px; height: 320px; border-radius: 999px; filter: blur(40px); opacity: .45; pointer-events: none; }
.orb-a { background: #60a5fa; left: -120px; top: -90px; }
.orb-b { background: #22c55e; right: -160px; bottom: 10%; }

.shell { width: min(980px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; color: white; padding: 10px 2px 22px; }
.eyebrow { margin: 0 0 8px; color: #bfdbfe; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(30px, 7vw, 58px); line-height: 1.04; letter-spacing: -0.05em; }
.subtitle { margin: 12px 0 0; max-width: 620px; color: #cbd5e1; line-height: 1.7; }
.status-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.11); backdrop-filter: blur(16px); color: #e2e8f0; font-size: 14px; }
.status-pill span { width: 9px; height: 9px; border-radius: 999px; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.18); }
.status-pill.ok span { background: var(--ok); box-shadow: 0 0 0 4px rgba(22,163,74,.18); }
.status-pill.warn span { background: var(--warn); box-shadow: 0 0 0 4px rgba(217,119,6,.18); }

.card { background: var(--card); border: 1px solid rgba(255,255,255,.55); border-radius: 30px; padding: 24px; margin: 16px 0; box-shadow: var(--shadow); backdrop-filter: blur(22px); }
h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
p { margin: 6px 0 0; color: var(--muted); }
.toolbar, .card-title-row, .options-row, .quick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar { margin-bottom: 18px; }
.login-form { display: grid; gap: 14px; margin-top: 18px; }
label { color: #334155; font-weight: 650; }
input, textarea { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.86); color: var(--text); outline: none; transition: border .18s, box-shadow .18s, background .18s; }
input { height: 48px; padding: 0 15px; }
textarea { min-height: 190px; resize: vertical; padding: 15px; line-height: 1.55; word-break: break-all; }
input:focus, textarea:focus { border-color: rgba(37,99,235,.6); box-shadow: 0 0 0 4px rgba(37,99,235,.12); background: white; }
.input-label { display: block; margin-bottom: 8px; }

button { border: 0; border-radius: 16px; cursor: pointer; font-weight: 750; transition: transform .12s, box-shadow .12s, background .12s, opacity .12s; }
button:active { transform: scale(.98); }
button:disabled { cursor: not-allowed; opacity: .58; }
.primary { min-height: 48px; padding: 0 18px; color: white; background: linear-gradient(135deg, var(--primary), #4f46e5); box-shadow: 0 12px 26px rgba(37,99,235,.27); }
.primary:hover { background: linear-gradient(135deg, var(--primary-dark), #4338ca); }
.primary.small { min-height: 40px; padding: 0 14px; border-radius: 14px; }
.ghost, .soft { min-height: 40px; padding: 0 14px; color: #1d4ed8; background: var(--soft); }
.ghost:hover, .soft:hover { background: #dbeafe; }
.quick-row { justify-content: flex-start; flex-wrap: wrap; margin: 12px 0 16px; }
.options-row { align-items: center; margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 14px; }
.convert-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; }
.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid rgba(255,255,255,.55); border-top-color: white; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch { display: inline-flex; align-items: center; gap: 10px; user-select: none; }
.switch input { display: none; }
.switch span { width: 46px; height: 28px; border-radius: 999px; background: #cbd5e1; position: relative; margin-top: 0; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 999px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }

.notice { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: #fff7ed; color: #9a3412; line-height: 1.5; }
.error { color: var(--err); min-height: 20px; }
.results { display: grid; gap: 12px; }
.result-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--card-strong); }
.result-main { min-width: 0; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 750; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.err { background: #fee2e2; color: #991b1b; }
.input-url { color: #64748b; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.short-link { margin-top: 7px; font-size: 17px; font-weight: 800; color: #0f172a; word-break: break-all; }
.copy-btn { align-self: center; min-width: 78px; }
.rejected { margin-top: 14px; padding: 13px; border-radius: 18px; background: #fef2f2; color: #991b1b; font-size: 14px; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: rgba(15,23,42,.92); color: white; border-radius: 999px; padding: 11px 16px; box-shadow: 0 14px 36px rgba(0,0,0,.26); transition: opacity .18s, transform .18s; z-index: 10; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .shell { width: min(100% - 18px, 980px); padding-top: 18px; }
  .hero { display: block; }
  .status-pill { margin-top: 16px; }
  .card { border-radius: 24px; padding: 18px; }
  .toolbar { align-items: flex-start; }
  .toolbar, .options-row { flex-wrap: wrap; }
  textarea { min-height: 220px; font-size: 16px; }
  .quick-row { display: grid; grid-template-columns: repeat(3, 1fr); }
  .soft { padding: 0 8px; }
  .result-item { grid-template-columns: 1fr; }
  .copy-btn { width: 100%; }
  .primary.small { width: 100%; }
}
