/* ============================================================
   奶龙奶蛙大学 · 鲜艳黄色主题
   把奶龙图片放进 static/img/ 即可替换对应占位符
   ============================================================ */

:root {
  --bg-top: #fff8cf;
  --bg-mid: #ffef8f;
  --card: #fffdf4;
  --ink: #4a3b00;
  --ink-soft: #7a6510;
  --yellow: #ffc800;
  --yellow-deep: #f0af00;
  --orange: #ff8a3d;
  --green: #2fb55b;
  --red: #ff5f5f;
  --line: rgba(74, 59, 0, 0.18);
  --shadow: 6px 6px 0 rgba(74, 59, 0, 0.14);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.55) 0 18px, transparent 19px),
    radial-gradient(circle at 88% 20%, rgba(255, 138, 61, 0.18) 0 26px, transparent 27px),
    radial-gradient(circle at 70% 82%, rgba(255, 255, 255, 0.4) 0 22px, transparent 23px),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 70%, #ffe15c);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

code {
  background: rgba(255, 200, 0, 0.22);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 0.92em;
  word-break: break-all;
}

a { color: var(--ink); }

.hidden { display: none !important; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 26px;
  background: rgba(255, 253, 244, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 20px;
}

.brand-tld {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.nav-auth { display: flex; align-items: center; gap: 10px; }

.nav-user {
  font-weight: 700;
  background: rgba(255, 200, 0, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-block;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  background: var(--card);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(74, 59, 0, 0.2);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s;
  user-select: none;
}

.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(74, 59, 0, 0.2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #ffd42e, var(--yellow));
  border-color: var(--ink);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost { background: transparent; box-shadow: none; border-color: var(--line); }

.btn-danger {
  background: #fff2f0;
  border-color: var(--red);
  color: #c93333;
  box-shadow: none;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------------- 首屏 ---------------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 26px 40px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 30px;
  align-items: center;
}

.badge {
  display: inline-block;
  background: var(--ink);
  color: #ffe98a;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero-title {
  margin: 18px 0 10px;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 4px 4px 0 rgba(255, 138, 61, 0.35);
}

.hero-sub {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
  max-width: 560px;
}

.hero-cta { display: flex; gap: 14px; margin: 26px 0 18px; flex-wrap: wrap; }

.hero-notes { margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13.5px; }
.hero-notes li::before { content: "· "; font-weight: 900; }

/* ---------------- 通用卡片 / 区块 ---------------- */

.section-title { text-align: center; font-size: 30px; font-weight: 900; margin: 0 0 8px; }
.section-sub { text-align: center; color: var(--ink-soft); margin: 0 0 26px; }

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

.card h3 { margin-top: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; font-size: 20px; }

/* ---------------- 奶龙占位 ---------------- */

.mascot-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed rgba(74, 59, 0, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.mascot-slot.filled { border-style: solid; border-color: var(--ink); background: transparent; }
.mascot-slot.filled img { width: 100%; height: 100%; object-fit: contain; }

.mascot-fallback {
  text-align: center;
  color: var(--ink-soft);
  padding: 10px;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.mascot-fallback span { font-size: 42px; }
.mascot-fallback small { font-size: 11.5px; max-width: 200px; line-height: 1.6; }

.mascot-hero { width: min(360px, 100%); aspect-ratio: 1; }
.mascot-mini { width: 38px; height: 38px; border-radius: 12px; border-width: 2px; flex: none; }
.mascot-mini .mascot-fallback span { font-size: 20px; }
.mascot-mini .mascot-fallback small { display: none; }
.mascot-footer { width: 72px; height: 72px; border-width: 2px; margin: 0 auto 8px; }
.mascot-footer .mascot-fallback span { font-size: 28px; }
.mascot-footer .mascot-fallback small { display: none; }
.mascot-side { width: 100%; aspect-ratio: 1; margin-bottom: 16px; }

/* ---------------- 三步走 ---------------- */

.flow { max-width: 1080px; margin: 0 auto; padding: 30px 26px 10px; }

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.step-card { position: relative; text-align: left; }
.step-num {
  position: absolute;
  top: -14px;
  left: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #ffe98a;
  border-radius: 50%;
  font-weight: 900;
}
.step-emoji { font-size: 34px; margin-bottom: 6px; }
.step-card p { color: var(--ink-soft); line-height: 1.8; font-size: 14.5px; }

/* ---------------- 注册 / 登录 ---------------- */

.auth-wrap { max-width: 920px; margin: 40px auto; padding: 0 20px; scroll-margin-top: 90px; }

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;  /* 注册 / 登录 两框等宽 */
  gap: 20px;
  align-items: start;
}
@media (max-width: 760px) {
  .auth-grid { grid-template-columns: 1fr; }
}

.auth-card { width: 100%; box-sizing: border-box; }
.auth-title { margin: 0 0 14px; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }

.tab {
  flex: 1;
  border: 2px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 9px 0;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink-soft);
}
.tab.active { background: var(--yellow); border-color: var(--ink); color: var(--ink); }

.auth-form { display: grid; gap: 14px; }

.auth-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }

input {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--yellow-deep); box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.25); }

.form-hint { color: var(--ink-soft); font-size: 13px; line-height: 1.7; margin: 4px 0 0; }

/* ---------------- 已认证大学 ---------------- */

.schools { max-width: 1080px; margin: 40px auto; padding: 0 26px; }

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.school-card h3 { margin: 0 0 6px; font-size: 18px; word-break: break-all; }
.school-card .since { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 12px; }

.prefix-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: linear-gradient(180deg, #ffd42e, var(--yellow));
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  word-break: break-all;
}
.chip:hover { filter: brightness(1.06); }

.empty-card { text-align: center; color: var(--ink-soft); grid-column: 1 / -1; }

/* ---------------- 规则 ---------------- */

.rules { max-width: 1080px; margin: 10px auto 50px; padding: 0 26px; }
.rule-card ul { line-height: 2.1; color: var(--ink-soft); padding-left: 20px; margin: 8px 0 0; }

/* ---------------- 控制台 ---------------- */

.dash-wrap {
  max-width: 1080px;
  margin: 30px auto 60px;
  padding: 0 26px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
}

.dash-main { display: grid; gap: 20px; }

.user-info { display: grid; gap: 8px; line-height: 1.8; }
.user-info .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  background: rgba(255, 200, 0, 0.3);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13.5px;
  font-weight: 700;
  word-break: break-all;
}

.verify-box { display: grid; gap: 12px; }
.verify-box ol { margin: 0; padding-left: 22px; line-height: 2; color: var(--ink-soft); }

.code-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8d6;
  border: 2px dashed var(--yellow-deep);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  word-break: break-all;
}

.copy-btn { flex: none; }

.verified-banner {
  background: linear-gradient(180deg, #e3ffe9, #d2f7dd);
  border: 2.5px solid var(--green);
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 800;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.attempts { margin-top: 6px; }
.attempts h4 { margin: 14px 0 6px; font-size: 14px; }
.attempt {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px dashed var(--line);
  padding: 6px 2px;
}
.attempt .ok { color: var(--green); font-weight: 800; }
.attempt .bad { color: var(--red); font-weight: 800; }
.attempt time { margin-left: auto; flex: none; font-size: 12px; }

/* ---------------- 前缀管理 ---------------- */

.quota {
  background: var(--ink);
  color: #ffe98a;
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 900;
  font-size: 14px;
}

.prefix-form { display: grid; gap: 8px; margin-bottom: 14px; }
.prefix-input-row { display: flex; gap: 10px; }
.prefix-input-row input { flex: 1; }

.prefix-preview { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0 0; }
.prefix-preview .arrow { margin: 0 6px; }

.prefix-list { display: grid; gap: 12px; }

.prefix-item {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  display: grid;
  gap: 6px;
  background: #fff;
}
.prefix-item .host { font-weight: 900; font-size: 15.5px; word-break: break-all; }
.prefix-item .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--ink-soft); align-items: center; }
.prefix-item .actions { display: flex; gap: 8px; }

.status-badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid currentcolor;
}
.status-active { color: var(--green); }
.status-local_only { color: var(--yellow-deep); }
.status-pending { color: var(--ink-soft); }
.status-unbound { color: var(--ink-soft); }
.status-error { color: var(--red); }

.err-text { color: #c93333; font-size: 12.5px; word-break: break-all; }

/* ---------------- 侧栏 ---------------- */

.tip-card ul { padding-left: 18px; margin: 6px 0 0; color: var(--ink-soft); line-height: 1.9; font-size: 13.5px; }

/* ---------------- 页脚 / 提示 ---------------- */

.footer { margin-top: auto; padding: 30px 26px 26px; text-align: center; color: var(--ink-soft); font-size: 14px; }
.footer-fine { font-size: 12px; opacity: 0.75; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #ffefad;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 99;
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7a1f1f; color: #ffd7d7; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-art { order: -1; }
  .mascot-hero { width: min(220px, 60%); }
  .flow-grid { grid-template-columns: 1fr; }
  .dash-wrap { grid-template-columns: 1fr; }
  .mascot-side { width: min(200px, 60%); margin: 0 auto 16px; }
  .topbar { padding: 10px 16px; }
}

/* ---------------- 密码提示（passwordtip.js / KKPasswordTip） ---------------- */

.password-tip { margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.password-tip.good { color: var(--green); font-weight: 700; }
.password-tip.bad { color: var(--red); font-weight: 700; }
input.bad { border-color: var(--red); }

/* ---------------- 首页学校卡片（子域 + 子子域） ---------------- */

.sub-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.sub-target { font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.sub-subline { padding-left: 22px; }
.chip-sub { background: #fff; font-weight: 700; }

/* ---------------- 图片占位文字（替代 emoji） ---------------- */

.mascot-fallback .ph-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}
.mascot-mini .mascot-fallback .ph-mark { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; border-width: 2px; }
.mascot-footer .mascot-fallback .ph-mark { width: 36px; height: 36px; }

/* ---------------- 子子域认领表单 / 管理表格 ---------------- */

select {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 14.5px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  max-width: 45%;
}
select:focus { border-color: var(--yellow-deep); box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.25); }

/* 校园子域目标方式选择（CNAME / 302） */
.mode-select { flex: none; max-width: 30%; }

.dot-sep { font-weight: 900; color: var(--ink-soft); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 18px; }
.admin-table th, .admin-table td { border-bottom: 1px dashed var(--line); padding: 7px 6px; text-align: left; word-break: break-all; vertical-align: middle; }
.admin-table th { color: var(--ink-soft); font-size: 12px; }
.admin-table td .btn { margin: 2px 4px 2px 0; }
#admin-body h4 { margin: 14px 0 6px; }
