
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg: #071013;
  --bg2: #0b171d;
  --bg3: #102129;
  --red: #22d3ee;
  --orange: #6366f1;
  --green: #22c55e;
  --text: #e8fbff;
  --subtext: #8fb9c4;
  --muted: #557985;
  --border: rgba(34, 211, 238, 0.18);
  --border2: rgba(34, 211, 238, 0.42);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Nunito, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 10% 90%, rgba(34, 211, 238, 0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
}

.container {
  position: relative;
  z-index: 1;
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
}

header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.logo-icon {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.22);
  color: rgba(255, 255, 255, 0.92);
}

.logo-text {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.logo-text span {
  color: var(--red);
}

.offline-badge {
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  padding: 4px 12px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

main {
  position: relative;
  z-index: 1;
  padding: 40px 0 46px;
}

.hero {
  max-width: 620px;
  margin: 0 auto 30px;
  text-align: center;
}

.hero h1 {
  color: var(--text);
  font-size: clamp(28px, 4.8vw, 44px);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--red);
}

.hero p {
  max-width: 540px;
  margin: 12px auto 0;
  color: var(--subtext);
  font-size: 15px;
  line-height: 1.55;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg2);
  padding: 24px;
}

.shortener-card {
  margin-bottom: 18px;
}

.url-display,
.short-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg3);
  padding: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-display:focus-within,
.short-result:hover {
  border-color: var(--red);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.11);
}

input,
button,
a {
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  font-size: 17px;
  font-weight: 700;
}

input::placeholder {
  color: rgba(196, 144, 144, 0.56);
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.24);
  color: #fff;
  cursor: pointer;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.32);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
  color: var(--subtext);
}

.btn-ghost:hover {
  border-color: var(--border2);
  box-shadow: none;
  color: var(--red);
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.error {
  margin-top: 10px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 700;
}

.short-result {
  margin-top: 14px;
  padding: 16px 18px;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.short-result a:not(.icon-btn) {
  color: var(--text);
  font-size: clamp(15px, 2.4vw, 21px);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.pw-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-btn {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--red);
  background: rgba(34, 211, 238, 0.08);
  color: var(--red);
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(var(--red), var(--orange));
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item,
.history-header {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1.35fr) 92px 42px;
  gap: 10px;
  align-items: center;
}

.history-header {
  padding: 0 12px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-item {
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  transition: border-color 0.2s, background 0.2s;
}

.history-item:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.history-item a {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.history-item p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.visits {
  width: fit-content;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.copy-link {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 0;
}

.copy-link::before {
  content: "⧉";
  font-size: 15px;
}

.copy-link.copied::before {
  content: "✓";
}

.copy-link:hover {
  border-color: var(--red);
  color: var(--red);
}

.empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.page-meta strong {
  color: var(--subtext);
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 28px, 1000px);
  }

  main {
    padding: 30px 0 34px;
  }

  .url-display,
  .short-result,
  .section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .history-header {
    display: none;
  }

  .history-item {
    grid-template-columns: 1fr auto;
  }

  .history-item p,
  .visits {
    grid-column: 1 / -1;
  }

  .page-meta {
    justify-content: flex-start;
  }
}
