:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --ink: #111827;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-soft: #eef4ff;
  --brand-ring: rgba(37, 99, 235, 0.18);
  --mint: #0f9f8f;
  --mint-soft: #e9fbf6;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 16px 42px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 28px 70px rgba(16, 24, 40, 0.1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 248, 251, 0.9) 45%, #f6f8fb 100%),
    radial-gradient(900px 500px at 50% -5%, rgba(37, 99, 235, 0.09), transparent 65%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  opacity: 0.55;
}

.ambient-one {
  width: 360px;
  height: 360px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15), transparent 68%);
}

.ambient-two {
  width: 420px;
  height: 420px;
  right: -180px;
  top: 280px;
  background: radial-gradient(circle, rgba(15, 159, 143, 0.1), transparent 68%);
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
}

.shell {
  width: min(100% - 40px, 980px);
  margin: 0 auto;
  padding-bottom: 44px;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.24);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.brand-en {
  margin-left: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.docs-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 720;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.07);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.docs-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.docs-link:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(15, 159, 143, 0.17);
  border-radius: 999px;
  background: rgba(233, 251, 246, 0.75);
  color: #087f73;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.hero {
  padding: 64px 0 30px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.18em;
  line-height: 1.4;
}

.hero h1 {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(38px, 7.3vw, 68px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.hero h1 span {
  position: relative;
  color: var(--brand);
  white-space: nowrap;
}

.hero h1 span::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 0;
  bottom: -5px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(15, 159, 143, 0.14));
  z-index: -1;
}

.hero-copy {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.8;
}

.card {
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}

.composer {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
}

.field-label {
  display: block;
  margin: 0 0 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.url-field {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  color: var(--muted-light);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

#url-input {
  width: 100%;
  min-height: 56px;
  padding: 15px 50px 15px 45px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

#url-input::placeholder {
  color: #98a2b3;
}

#url-input:hover {
  border-color: var(--line-strong);
}

#url-input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.clear-button {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.clear-button:hover {
  background: var(--line);
  color: var(--ink);
}

.clear-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.field-help {
  margin: 8px 2px 0;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.55;
}

.mode-fieldset {
  min-width: 0;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.mode-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  position: relative;
  display: block;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.mode-card:hover {
  border-color: #b9c6dd;
  transform: translateY(-1px);
}

.mode-card:has(input:checked),
.mode-card.is-active {
  border-color: var(--brand);
  background: #f8fbff;
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.mode-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-card:focus-within {
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.mode-content {
  display: block;
  padding: 14px 14px 15px;
}

.mode-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.mode-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.mode-check svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-card:has(input:checked) .mode-check,
.mode-card.is-active .mode-check {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.mode-title {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
}

.mode-sample {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--brand-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-sample b {
  font-weight: 700;
}

.mode-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.advanced {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.advanced summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 1px 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary .optional {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 600;
}

.advanced summary .chevron {
  width: 15px;
  height: 15px;
  margin-left: auto;
  color: var(--muted);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.advanced[open] summary .chevron {
  transform: rotate(180deg);
}

.advanced-body {
  padding-top: 11px;
}

.alias-field {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.alias-field:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.alias-prefix,
.alias-suffix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.alias-prefix {
  padding: 0 0 0 14px;
}

.alias-suffix {
  padding: 0 14px 0 0;
}

.alias-field input {
  min-width: 0;
  flex: 1;
  padding: 11px 14px 11px 2px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.alias-field input::placeholder {
  color: #a8b0bd;
}

.clipboard-helper {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  padding: 13px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #2e6df6 0%, var(--brand) 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0.03em;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: saturate(1.05);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}

.primary-button:disabled {
  opacity: 0.8;
  transform: none;
}

.button-arrow {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.primary-button:hover .button-arrow {
  transform: translateX(2px);
}

.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-spinner {
  display: inline-block;
}

.primary-button.is-loading .button-arrow {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.composer-note {
  margin: 13px 0 0;
  color: var(--muted-light);
  font-size: 11.5px;
  text-align: center;
}

.form-error {
  margin-top: 15px;
  padding: 11px 13px;
  border: 1px solid #fecdca;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.55;
}

.result {
  max-width: 720px;
  margin: 18px auto 0;
  padding: 24px 26px 21px;
  border: 1px solid rgba(15, 159, 143, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(233, 251, 246, 0.92), rgba(255, 255, 255, 0.98) 58%);
  box-shadow: 0 20px 45px rgba(15, 159, 143, 0.1);
  animation: rise 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 159, 143, 0.22);
}

.result-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-kicker {
  margin: 0 0 1px;
  color: #0b7a6f;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.result h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 710;
  letter-spacing: -0.02em;
}

.result-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 10px 10px 15px;
  border: 1px solid rgba(15, 159, 143, 0.18);
  border-radius: 13px;
  background: #fff;
}

.short-url {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #075e54;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(13px, 2.7vw, 17px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-url:hover {
  color: #064e45;
}

.result-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

.copy-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background 150ms ease, transform 150ms ease;
}

.copy-button {
  background: var(--brand);
  color: #fff;
}

.copy-button:hover {
  background: var(--brand-deep);
}

.copy-button:active,
.ghost-button:active {
  transform: scale(0.97);
}

.copy-button svg,
.ghost-button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-button.is-copied {
  background: var(--mint);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.ghost-button:hover {
  background: var(--surface-soft);
}

.result-meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.alt-line,
.target-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.alt-line a {
  color: var(--brand-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.target-line span {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.copy-feedback {
  min-height: 18px;
  margin: 7px 0 -4px;
  color: #087f73;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 150ms ease;
}

.copy-feedback.is-visible {
  opacity: 1;
}

.recent {
  max-width: 720px;
  margin: 30px auto 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover {
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recent-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.recent-button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.recent-short {
  display: block;
  overflow: hidden;
  color: var(--brand-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-target {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 650;
}

.recent-copy:hover {
  background: #dfeaff;
}

.how {
  max-width: 860px;
  margin: 72px auto 0;
}

.how .section-heading {
  display: block;
  margin-bottom: 20px;
}

.how .eyebrow {
  margin-bottom: 8px;
}

.how .section-heading h2 {
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.03em;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-grid li {
  min-height: 150px;
  padding: 18px 18px 19px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.66);
}

.how-number {
  color: var(--brand);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}

.how-grid h3 {
  margin: 13px 0 5px;
  font-size: 15px;
  font-weight: 700;
}

.how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.promise {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  max-width: 860px;
  margin: 20px auto 0;
  padding: 22px 23px;
  border: 1px solid rgba(37, 99, 235, 0.11);
  border-radius: 19px;
  background: linear-gradient(120deg, rgba(238, 244, 255, 0.88), rgba(255, 255, 255, 0.74));
}

.promise-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.promise-mark svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.promise h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 720;
}

.promise p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 11.5px;
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  color: var(--ink-soft);
  font-weight: 650;
}

.footer-links {
  display: flex;
  gap: 7px;
  align-items: center;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--brand-deep);
}

/* Admin */
.admin-page {
  min-height: 100vh;
}

.admin-shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding-bottom: 48px;
}

.admin-main {
  padding-top: 46px;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(29px, 4.2vw, 42px);
  font-weight: 770;
  letter-spacing: -0.04em;
}

.admin-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 720;
}

.login-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.token-field {
  display: flex;
  gap: 8px;
}

.token-field input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.token-field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.admin-button {
  min-height: 44px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.admin-button:hover {
  background: var(--brand-deep);
}

.admin-button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.admin-button.secondary:hover {
  background: var(--surface-soft);
}

.admin-button.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-button.danger:hover {
  background: #fee4e2;
}

.admin-view[hidden],
.login-card[hidden] {
  display: none !important;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  margin-bottom: 16px;
}

.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.stat-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 12px;
}

.stat-pill strong {
  color: var(--ink);
  font-size: 14px;
}

.admin-search {
  display: flex;
  gap: 7px;
}

.admin-search input {
  width: 220px;
  min-height: 39px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: #fff;
  font-size: 12.5px;
}

.admin-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f2f5;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: #fbfcfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fbfcff;
}

.admin-slug {
  color: var(--brand-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 650;
  white-space: nowrap;
}

.admin-target {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-mode {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 10.5px;
  white-space: nowrap;
}

.admin-date {
  color: var(--muted);
  white-space: nowrap;
}

.admin-clicks {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.admin-actions {
  white-space: nowrap;
}

.admin-empty {
  padding: 46px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.admin-pagination button {
  min-height: 34px;
  padding: 5px 10px;
}

.admin-error {
  margin: 0 0 13px;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}

.admin-footer {
  margin-top: 34px;
  color: var(--muted-light);
  font-size: 11.5px;
  text-align: center;
}

/* 404 */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.error-card {
  width: min(100%, 520px);
  padding: 38px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.error-code {
  margin: 0 0 8px;
  color: var(--brand);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.error-card h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 770;
  letter-spacing: -0.04em;
}

.error-card p {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.error-card .admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 28px, 980px);
    padding-bottom: 30px;
  }

  .site-header {
    padding-top: 17px;
  }

  .brand-en {
    display: none;
  }

  .badge {
    display: none;
  }

  .docs-link {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  .hero {
    padding: 47px 0 24px;
  }

  .hero h1 {
    font-size: clamp(36px, 11.2vw, 56px);
    letter-spacing: -0.05em;
  }

  .hero-copy {
    margin-top: 18px;
    font-size: 14.5px;
  }

  .composer {
    padding: 20px 17px;
    border-radius: 22px;
  }

  #url-input {
    min-height: 54px;
    padding-left: 41px;
    padding-right: 44px;
    font-size: 14px;
  }

  .field-icon {
    left: 13px;
    width: 18px;
    height: 18px;
  }

  .mode-group {
    grid-template-columns: 1fr;
  }

  .mode-content {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 11px;
    align-items: center;
    padding: 12px;
  }

  .mode-top {
    grid-row: 1 / span 3;
    display: block;
    margin: 0;
  }

  .mode-check {
    position: absolute;
    top: 11px;
    right: 11px;
  }

  .mode-icon {
    width: 34px;
    height: 34px;
  }

  .mode-title,
  .mode-sample,
  .mode-desc {
    grid-column: 2;
    padding-right: 20px;
  }

  .mode-desc {
    margin-top: 2px;
  }

  .result {
    padding: 19px 17px 16px;
    border-radius: 21px;
  }

  .result-main {
    display: block;
    padding: 12px;
  }

  .short-url {
    display: block;
    font-size: 15px;
    text-align: center;
  }

  .result-actions {
    justify-content: center;
    margin-top: 10px;
  }

  .copy-button,
  .ghost-button {
    flex: 1;
    max-width: 140px;
    min-height: 40px;
  }

  .alt-line,
  .target-line {
    font-size: 11.5px;
  }

  .how {
    margin-top: 50px;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .how-grid li {
    min-height: 0;
    padding: 15px 16px;
  }

  .promise {
    padding: 18px;
  }

  .site-footer {
    display: block;
    margin-top: 40px;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    margin-top: 5px;
  }

  .admin-shell {
    width: min(100% - 24px, 1120px);
  }

  .admin-main {
    padding-top: 30px;
  }

  .admin-toolbar {
    display: block;
  }

  .admin-search {
    margin-top: 12px;
  }

  .admin-search input {
    flex: 1;
    width: auto;
  }

  .login-card {
    padding: 21px 18px;
  }

  .token-field {
    display: block;
  }

  .token-field input {
    width: 100%;
  }

  .token-field .admin-button {
    width: 100%;
    margin-top: 8px;
  }

  .admin-pagination {
    justify-content: center;
  }

  .error-card {
    padding: 30px 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Shared page chrome (admin / 404) ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 6px 11px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 620;
  transition: background 150ms ease, border-color 150ms ease;
}

.nav-link:hover {
  border-color: var(--line-strong);
  background: #fff;
  text-decoration: none;
}

.nav-link svg {
  width: 16px;
  height: 16px;
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.footer-meta {
  color: var(--muted-light);
}

.admin-page > .site-header,
.admin-page > .site-footer,
.notfound-page > .site-header,
.notfound-page > .site-footer {
  width: min(100% - 40px, 1120px);
  margin-right: auto;
  margin-left: auto;
}

.admin-main,
.notfound-main {
  width: min(100% - 40px, 1120px);
  margin-right: auto;
  margin-left: auto;
}

/* ---------- Admin ---------- */
.admin-main {
  padding-top: 38px;
}

.admin-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-heading .eyebrow {
  margin-bottom: 6px;
}

.admin-heading h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 40px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.admin-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.admin-heading .ghost-button {
  flex: 0 0 auto;
  margin-top: 12px;
}

.admin-gate {
  max-width: 520px;
  margin: 8px auto 0;
  padding: 30px;
  border: 1px solid rgba(228, 231, 236, 0.92);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand);
}

.gate-icon svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-gate h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.admin-gate > p {
  margin: 8px auto 20px;
  max-width: 380px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.admin-gate code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
}

.gate-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gate-form input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.gate-form input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.gate-form .primary-button {
  width: auto;
  min-height: 48px;
  margin-top: 0;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 13px;
}

.gate-error {
  margin: 13px 0 0;
  padding: 9px 11px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  text-align: left;
}

.admin-toolbar {
  margin-bottom: 14px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 430px;
}

.search-field svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted-light);
  stroke: currentColor;
  stroke-linecap: round;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px 9px 37px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.toolbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.text-button {
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--danger);
}

.admin-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-item:hover {
  border-color: #cfd8e6;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.05);
}

.admin-item-main {
  min-width: 0;
  flex: 1;
}

.admin-item-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-short {
  overflow: hidden;
  color: var(--brand-deep);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.02em;
}

.mode-badge.is-path {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.mode-badge.is-subdomain {
  background: var(--mint-soft);
  color: #087f73;
}

.admin-item .admin-target {
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 11px;
}

.admin-item .admin-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  white-space: nowrap;
}

.mini-button {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 620;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.mini-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.mini-button.is-danger {
  border-color: #fecdca;
  color: var(--danger);
}

.mini-button.is-danger:hover {
  background: var(--danger-soft);
}

.mini-button:disabled {
  opacity: 0.6;
}

.admin-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 44px 20px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.admin-empty {
  padding: 42px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-icon svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-linecap: round;
}

.admin-empty p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 680;
}

.admin-empty .empty-hint {
  margin: 3px 0 15px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}

.admin-empty .ghost-button {
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 17px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 404 ---------- */
.notfound-main {
  padding: 58px 0 10px;
  text-align: center;
}

.notfound-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 12px);
  margin-bottom: 18px;
  color: var(--brand);
  user-select: none;
}

.art-code {
  color: #dbe6fb;
  font-size: clamp(86px, 17vw, 148px);
  font-weight: 820;
  letter-spacing: -0.08em;
  line-height: 0.82;
}

.art-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(64px, 12vw, 104px);
  height: clamp(64px, 12vw, 104px);
  border-radius: 28%;
  background: linear-gradient(145deg, #3d7bfa, var(--brand));
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
  color: #fff;
  transform: rotate(-9deg);
}

.art-link svg {
  width: 66%;
  height: 66%;
}

.notfound-main .eyebrow {
  margin-top: 18px;
}

.notfound-main h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.notfound-copy {
  max-width: 440px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.notfound-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.notfound-actions .primary-button {
  width: auto;
  min-height: 46px;
  margin-top: 0;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  text-decoration: none;
}

.notfound-actions .ghost-button {
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
}

@media (max-width: 680px) {
  .admin-page > .site-header,
  .admin-page > .site-footer,
  .notfound-page > .site-header,
  .notfound-page > .site-footer,
  .admin-main,
  .notfound-main {
    width: min(100% - 28px, 1120px);
  }

  .admin-main {
    padding-top: 26px;
  }

  .admin-heading {
    margin-bottom: 19px;
  }

  .admin-heading .ghost-button {
    min-height: 36px;
    margin-top: 8px;
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .admin-heading h1 {
    font-size: 30px;
  }

  .admin-gate {
    padding: 24px 18px;
  }

  .gate-form {
    display: block;
  }

  .gate-form input {
    width: 100%;
  }

  .gate-form .primary-button {
    width: 100%;
    margin-top: 8px;
  }

  .admin-toolbar {
    display: block;
  }

  .search-field {
    max-width: none;
  }

  .toolbar-meta {
    justify-content: space-between;
    margin-top: 10px;
  }

  .admin-item {
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
  }

  .admin-item .admin-target {
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .admin-item .admin-actions {
    justify-content: flex-end;
  }

  .mini-button {
    min-height: 34px;
    padding: 6px 13px;
  }

  .notfound-main {
    padding-top: 38px;
  }

  .notfound-art {
    margin-bottom: 8px;
  }

  .notfound-copy {
    font-size: 13.5px;
  }

  .notfound-actions {
    flex-direction: column;
  }

  .notfound-actions .primary-button,
  .notfound-actions .ghost-button {
    width: 100%;
    max-width: 260px;
  }

  .toast {
    bottom: 18px;
  }
}

/* ---------- v2: 有效期 ---------- */
.expiry-fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.expiry-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 1px;
}

.expiry-chip {
  position: relative;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.expiry-chip input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.expiry-chip span {
  position: relative;
  z-index: 1;
  display: block;
  pointer-events: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.expiry-chip:hover span {
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.expiry-chip.is-selected span,
.expiry-chip:has(input:checked) span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.expiry-chip:focus-within span {
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.expiry-custom {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.expiry-custom input,
.expiry-custom select {
  min-height: 42px;
  padding: 8px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.expiry-custom input {
  width: 120px;
}

.expiry-custom select {
  width: 96px;
}

.expiry-custom input:focus,
.expiry-custom select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.alias-status {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.alias-status.is-ok {
  color: #087f73;
}

.alias-status.is-bad {
  color: var(--danger);
}

.result-meta .expiry-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.result-meta .expiry-line.is-expired {
  color: var(--danger);
}

/* ---------- v2: 本地历史 ---------- */
.recent-item.is-expired {
  border-color: #f1d5d2;
  background: rgba(254, 243, 242, 0.55);
}

.recent-button {
  flex: 1 1 auto;
}

.recent-expiry {
  display: block;
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.45;
}

.recent-item.is-expired .recent-expiry {
  color: var(--danger);
}

.recent-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
}

.recent-delete {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 620;
}

.recent-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- v2: 管理后台 ---------- */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.65);
  width: fit-content;
}

.admin-tab {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.admin-tab:hover {
  color: var(--ink-soft);
}

.admin-tab.is-active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: var(--shadow-sm);
}

.admin-item.is-expired {
  border-color: #f1d5d2;
  background: rgba(254, 243, 242, 0.42);
}

.admin-item-top {
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.6;
}

.status-badge.is-active {
  background: var(--mint-soft);
  color: #087f73;
}

.status-badge.is-expired {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.5;
}

.admin-expiry.is-expired {
  color: var(--danger);
}

.blacklist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.blacklist-head h2 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.blacklist-head p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.blacklist-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.blacklist-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.blacklist-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  flex: 1;
  gap: 10px;
}

.blacklist-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.blacklist-fields label > span {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 650;
}

.blacklist-fields input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.blacklist-fields input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.blacklist-submit {
  flex: 0 0 auto;
  width: auto;
  min-width: 118px;
  min-height: 42px;
  margin: 0;
  padding: 8px 16px;
  font-size: 13px;
}

#blacklist-view .field-help {
  margin-bottom: 14px;
}

#blacklist-view .field-help code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
}

.blacklist-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blacklist-list.is-loading {
  opacity: 0.45;
}

.blacklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.blacklist-item-main {
  min-width: 0;
}

.blacklist-display {
  margin: 0;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.blacklist-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.blacklist-meta {
  margin: 3px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
}

/* ---------- v2: 文档 ---------- */
.docs-page > .site-header,
.docs-page > .site-footer {
  width: min(100% - 40px, 1120px);
  margin-right: auto;
  margin-left: auto;
}

.docs-main {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 54px;
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
  padding: 44px 0 20px;
}

.docs-toc {
  position: sticky;
  top: 22px;
  align-self: start;
  display: grid;
  gap: 2px;
  padding-top: 6px;
}

.docs-toc-title {
  margin: 0 0 8px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.docs-toc a {
  padding: 5px 9px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.docs-toc a:hover {
  border-left-color: var(--brand);
  background: rgba(37, 99, 235, 0.04);
  color: var(--brand-deep);
  text-decoration: none;
}

.docs-content {
  min-width: 0;
  max-width: 760px;
}

.docs-content h1 {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 44px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.docs-lead {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

.docs-content code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f4f9;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.docs-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(238, 244, 255, 0.9), rgba(233, 251, 246, 0.55));
  font-size: 12.5px;
}

.docs-callout strong {
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-callout code {
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 650;
}

.docs-callout span {
  flex-basis: 100%;
  color: var(--muted);
}

.docs-section {
  margin-top: 46px;
  scroll-margin-top: 24px;
}

.docs-section h2 {
  margin: 0 0 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.docs-section h3 {
  margin: 24px 0 9px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 720;
}

.docs-section p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

.docs-status {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--mint-soft);
  color: #087f73;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 2px;
}

.docs-table-wrap {
  margin: 14px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.docs-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.6;
}

.docs-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.docs-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f5;
  color: var(--muted);
  vertical-align: top;
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-table td:first-child {
  color: var(--ink-soft);
  white-space: nowrap;
}

.docs-table code {
  font-size: 11px;
}

.docs-note {
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  font-size: 12px !important;
}

.docs-list {
  margin: 12px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.docs-list li {
  margin-bottom: 5px;
}

.code-block {
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid #22304a;
  border-radius: 12px;
  background: #0f172a;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.code-copy {
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
}

.code-copy:hover,
.code-copy.is-copied {
  border-color: rgba(94, 234, 212, 0.5);
  color: #5eead4;
}

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.7;
  tab-size: 2;
}

.code-block pre code,
.ai-prompt code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

.ai-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.ai-heading .eyebrow {
  margin-bottom: 5px;
}

.ai-heading h2 {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}

.ai-copy {
  flex: 0 0 auto;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  font-size: 12.5px;
}

.ai-prompt {
  margin: 14px 0 0;
  padding: 20px;
  border: 1px solid #22304a;
  border-radius: 13px;
  background: #0f172a;
  color: #dbeafe;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.docs-foot {
  margin: 48px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-light) !important;
  font-size: 11.5px !important;
}

.expired-page .eyebrow {
  color: #b45309;
}

.expired-art {
  color: #d97706;
}

@media (max-width: 860px) {
  .docs-main {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 28px;
  }

  .docs-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
  }

  .docs-toc-title {
    flex-basis: 100%;
    margin-bottom: 2px;
  }

  .docs-toc a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 11.5px;
  }

  .docs-toc a:hover {
    border-color: var(--brand);
  }
}

@media (max-width: 680px) {
  .expiry-group {
    gap: 6px;
  }

  .expiry-chip span {
    padding: 6px 10px;
    font-size: 12px;
  }

  .recent-item {
    align-items: flex-start;
    gap: 8px;
    padding: 10px 11px;
  }

  .recent-actions {
    flex-direction: column;
    gap: 2px;
  }

  .recent-copy,
  .recent-delete {
    min-width: 44px;
    padding: 4px 5px;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tab {
    flex: 1;
  }

  .blacklist-head {
    display: block;
  }

  .blacklist-count {
    display: inline-block;
    margin-top: 8px;
  }

  .blacklist-form {
    display: block;
    padding: 13px;
  }

  .blacklist-fields {
    grid-template-columns: 1fr;
  }

  .blacklist-submit {
    width: 100%;
    margin-top: 10px;
  }

  .blacklist-item {
    align-items: flex-start;
    padding: 11px 12px;
  }

  .docs-page > .site-header,
  .docs-page > .site-footer,
  .docs-main {
    width: min(100% - 32px, 1120px);
  }

  .docs-content h1 {
    font-size: 32px;
  }

  .docs-section {
    margin-top: 38px;
  }

  .docs-section h2 {
    font-size: 20px;
  }

  .docs-lead {
    font-size: 13.5px;
  }

  .ai-heading {
    display: block;
  }

  .ai-copy {
    width: 100%;
    margin-top: 12px;
  }

  .ai-prompt {
    padding: 15px;
    font-size: 11px;
  }

  .docs-table {
    min-width: 520px;
  }

  .docs-table.overview-table {
    min-width: 0;
    font-size: 11px;
  }

  .docs-table.overview-table th,
  .docs-table.overview-table td {
    padding: 8px;
  }

  .docs-table.overview-table td:first-child {
    white-space: normal;
    word-break: break-all;
  }

  .docs-table.overview-table code {
    font-size: 10px;
  }

  .code-block pre {
    padding: 12px;
    font-size: 11px;
  }
}

/* ---------- v3: 管理控制台 ---------- */
.admin-page {
  background:
    radial-gradient(760px 420px at 50% -12%, rgba(37, 99, 235, 0.07), transparent 68%),
    var(--bg);
}

.admin-main {
  padding-top: 32px;
  padding-bottom: 26px;
}

.admin-heading {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 10px;
  letter-spacing: 0.17em;
}

.admin-heading h1 {
  font-size: clamp(32px, 4.6vw, 45px);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.admin-subtitle {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.admin-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

.admin-heading .ghost-button {
  margin-top: 0;
}

.admin-session {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 159, 143, 0.2);
  border-radius: 999px;
  background: rgba(233, 251, 246, 0.72);
  color: #087f73;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f9f8f;
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.14);
}

/* 登录卡 */
.admin-gate {
  position: relative;
  max-width: 478px;
  margin: 34px auto 0;
  padding: 38px 34px 28px;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 240, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 70px rgba(16, 24, 40, 0.1);
}

.admin-gate::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #60a5fa 52%, #0f9f8f);
}

.admin-gate::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -100px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 68%);
  pointer-events: none;
}

.gate-icon {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  margin-bottom: 15px;
  border: 1px solid #dbe7ff;
  border-radius: 18px;
  background: linear-gradient(145deg, #f5f8ff, #fff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.gate-icon svg {
  width: 27px;
  height: 27px;
}

.admin-gate > .gate-kicker {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted-light);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.admin-gate h2 {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 27px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.admin-gate > h2 + p {
  position: relative;
  z-index: 1;
  margin: 7px auto 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.gate-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.gate-field {
  position: relative;
  min-width: 0;
}

.gate-field > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--muted-light);
  pointer-events: none;
  transform: translateY(-50%);
}

.gate-form input {
  width: 100%;
  padding-left: 40px;
}

.gate-form .primary-button {
  min-width: 106px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.admin-gate > .gate-error {
  position: relative;
  z-index: 1;
}

.admin-gate > .gate-foot {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

/* 数据概览 */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 15px 16px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -38px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: 0.5;
  pointer-events: none;
}

.stat-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
}

.stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  font-size: 29px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-hint {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.stat-card-active .stat-icon {
  background: var(--mint-soft);
  color: #0f9f8f;
}

.stat-card-active::after {
  background: var(--mint-soft);
}

.stat-card-expired .stat-icon {
  background: #fff7ed;
  color: #c2410c;
}

.stat-card-expired::after {
  background: #fff7ed;
}

.stat-card-clicks .stat-icon {
  background: #f5f3ff;
  color: #7c3aed;
}

.stat-card-clicks::after {
  background: #f5f3ff;
}

/* 标签页 */
.admin-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f5f9;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
}

.admin-tab svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-tab.is-active {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(16, 24, 40, 0.02);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.1);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-tab.is-active .tab-count {
  background: var(--brand-soft);
  color: var(--brand);
}

/* 工具栏与列表 */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.search-field {
  max-width: none;
}

.search-field input {
  min-height: 44px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.toolbar-meta {
  gap: 14px;
}

.text-button {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

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

.admin-list {
  gap: 10px;
}

.admin-item {
  position: relative;
  padding: 17px 18px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.admin-item::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
  opacity: 0;
  transition: opacity 160ms ease;
}

.admin-item:hover::before {
  opacity: 0.6;
}

.admin-item.is-expired {
  background: rgba(255, 250, 249, 0.95);
}

.admin-item.is-expired::before {
  background: var(--danger);
  opacity: 0.55;
}

.admin-item-top {
  gap: 7px;
}

.admin-short {
  font-size: 14.5px;
}

.mode-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9.5px;
}

.status-badge {
  gap: 5px;
  padding: 3px 8px;
  font-size: 9.5px;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.admin-item .admin-target {
  margin-top: 5px;
  font-size: 12.5px;
}

.admin-domains {
  gap: 6px;
  margin-top: 8px;
}

.admin-domains span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #eef1f6;
  border-radius: 6px;
  background: #f8fafc;
  color: #7b8494;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-meta {
  gap: 4px 12px;
  margin-top: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 8px;
}

.admin-actions .mini-button:not(.is-danger) {
  border-color: #dbe7ff;
  background: #f7faff;
  color: var(--brand-deep);
}

.admin-actions .mini-button:not(.is-danger):hover {
  border-color: #bfd4ff;
  background: var(--brand-soft);
}

.admin-empty {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

/* 黑名单 */
.blacklist-head {
  margin-bottom: 18px;
}

.blacklist-head h2 {
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.blacklist-head p {
  max-width: 760px;
  line-height: 1.72;
}

.blacklist-count {
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.blacklist-form {
  gap: 12px;
  padding: 17px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.blacklist-fields input {
  min-height: 43px;
  background: #fff;
}

.blacklist-submit {
  border-radius: 10px;
}

.blacklist-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.blacklist-display {
  font-size: 13px;
}

@media (max-width: 860px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .admin-tab svg {
    display: none;
  }

  .admin-tab {
    gap: 4px;
    padding: 6px 4px;
  }
}

@media (max-width: 680px) {
  .admin-main {
    padding-top: 18px;
    padding-bottom: 20px;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
  }

  .admin-heading h1 {
    font-size: 32px;
  }

  .admin-subtitle {
    margin-top: 6px;
    font-size: 12.5px;
  }

  .admin-heading-actions {
    justify-content: space-between;
    padding-bottom: 0;
  }

  .admin-session {
    min-height: 33px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .admin-heading .ghost-button {
    min-height: 34px;
    margin: 0;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .admin-gate {
    margin-top: 12px;
    padding: 28px 17px 23px;
    border-radius: 20px;
  }

  .admin-gate h2 {
    font-size: 24px;
  }

  .gate-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 13px;
  }

  .gate-form {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .gate-form .primary-button {
    width: 100%;
    min-height: 48px;
    margin-top: 0;
  }

  .admin-gate > .gate-foot {
    margin-top: 14px;
  }

  .admin-stats {
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 12px 11px;
    border-radius: 14px;
  }

  .stat-head {
    font-size: 11px;
  }

  .stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .stat-icon svg {
    width: 14px;
    height: 14px;
  }

  .stat-value {
    margin-top: 6px;
    font-size: 24px;
  }

  .stat-hint {
    margin-top: 5px;
    font-size: 10px;
  }

  .admin-tabs {
    gap: 3px;
    margin-bottom: 14px;
    padding: 3px;
    border-radius: 11px;
  }

  .admin-tab {
    gap: 5px;
    min-height: 38px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .admin-tab svg {
    width: 14px;
    height: 14px;
  }

  .admin-tab {
    font-size: 12px;
    letter-spacing: -0.01em;
  }

  .tab-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 9.5px;
  }

  .admin-toolbar {
    display: block;
    margin-bottom: 12px;
  }

  .search-field input {
    min-height: 45px;
    font-size: 16px;
  }

  .toolbar-meta {
    justify-content: space-between;
    margin-top: 8px;
  }

  .text-button {
    padding: 6px 8px;
  }

  .admin-item {
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
  }

  .admin-item .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .admin-actions .mini-button {
    width: 100%;
    min-height: 39px;
    font-size: 12px;
  }

  .admin-short {
    max-width: 100%;
    font-size: 13.5px;
  }

  .admin-item .admin-target {
    font-size: 12px;
  }

  .admin-domains {
    gap: 5px;
  }

  .admin-domains span {
    font-size: 9.5px;
  }

  .admin-meta {
    font-size: 10.5px;
  }

  .blacklist-head h2 {
    font-size: 20px;
  }

  .blacklist-form {
    padding: 14px;
    border-radius: 14px;
  }

  .blacklist-item {
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
  }

  .blacklist-item .mini-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 10px;
  }
}

