/* 视觉参考：现代玻璃拟态 + 深色渐变落地页（常见于优质短链/引导页模板） */
:root {
  --bg0: #0a0c14;
  --bg1: #12182a;
  --accent: #5b8cff;
  --accent2: #7c5cff;
  --text: #e8ecff;
  --muted: #9aa3c2;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, 0.25), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(124, 92, 255, 0.2), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
}

.page-landing {
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

.card.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.headline {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 12px;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.hint-box {
  background: rgba(91, 140, 255, 0.1);
  border: 1px solid rgba(91, 140, 255, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.hint-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.hint-box p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 32px rgba(91, 140, 255, 0.35);
  margin-bottom: 18px;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(91, 140, 255, 0.45);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fine {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.url-box {
  font-size: 0.78rem;
  word-break: break-all;
  color: #b8c2e8;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  line-height: 1.45;
}

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(154, 163, 194, 0.75);
  margin-top: 28px;
  line-height: 1.5;
}

.ckao3-card .headline {
  margin-top: 14px;
}

.ckao3-banner {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  display: block;
}

.ckao3-download {
  width: 100%;
  border-radius: 12px;
  margin: 10px 0 14px;
  display: block;
}

.ckao3-icons {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ckao3-icons img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* 后台与首页 */
.page-app {
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg0), var(--bg1));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.topbar a:hover {
  color: var(--text);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 12px;
}

.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.grid-2 {
  display: grid;
  gap: 22px;
}

@media (min-width: 800px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  backdrop-filter: blur(12px);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn.small {
  width: auto;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn.danger {
  background: rgba(255, 80, 80, 0.2);
  color: #ffb4b4;
  border: 1px solid rgba(255, 80, 80, 0.35);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}

.msg {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.msg.ok {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.35);
  color: #b8f5d0;
}

.msg.err {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #ffc4bc;
}

.color-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.color-picker input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.color-picker input[type="radio"]:checked + .color-dot {
  transform: scale(1.12);
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.6);
}

.color-picker.compact {
  margin-bottom: 0;
  gap: 6px;
  flex-wrap: nowrap;
}

.color-picker.compact .color-dot {
  width: 18px;
  height: 18px;
}

.domain-tools-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 0;
}

.domain-tools-row select,
.domain-tools-row input[type="text"] {
  min-width: 120px;
  flex: 1 1 180px;
  margin-bottom: 0;
}

.domain-tools-row .btn {
  margin-bottom: 0;
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.domain-table {
  table-layout: auto;
}

.domain-table th:first-child,
.domain-table td:first-child {
  width: 200px;
}

.domain-table th:last-child,
.domain-table td:last-child {
  width: 90px;
}

.domain-tools-cell {
  width: auto;
}

.domain-tools-row .color-picker.compact {
  flex: 0 0 auto;
  align-self: center;
}

.domain-tools-row .custom-code-field {
  flex-basis: 150px;
}

.domain-tools-row input[name="batch_targets"] {
  flex: 2 1 280px;
}

.domain-tools-row .scheme-select {
  flex-basis: 160px;
}

@media (max-width: 860px) {
  .domain-table th:first-child,
  .domain-table td:first-child {
    width: 150px;
  }

  .domain-tools-row select,
  .domain-tools-row input[type="text"] {
    flex: 1 1 100%;
  }

  .domain-tools-row .color-picker.compact,
  .domain-tools-row .btn.small {
    flex: 0 0 auto;
  }
}

.domain-tools-cell details {
  width: 100%;
}

.domain-tools-cell form {
  width: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #fff;
  opacity: 0;
  z-index: 1000;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.ok {
  background: linear-gradient(135deg, #10b981, #36d399);
}

.toast.err {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.login-box {
  max-width: 400px;
  margin: 80px auto;
  padding: 0 20px;
}

.login-box .panel {
  padding: 28px 24px;
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.login-box .sub {
  margin-bottom: 22px;
}
