/* ============================================================
   链接分发系统 · Gemini UI 风格版
   视觉层重做：浅色干净底 #f8f9ff + 蓝/紫/粉淡光晕，
   Gemini 渐变 #4285f4 → #9b72cb → #d96570 用于主按钮 /
   品牌字 / 重点数字；卡片大圆角 + 柔和阴影，胶囊按钮，
   输入框 16px 圆角带蓝色聚焦光圈，登录卡与侧边栏毛玻璃。
   仅样式变更：未改动任何功能、DOM 结构与 class 名。
   响应式为双端布局：PC（≥1024px）保持桌面形态；
   平板（721–1023px）窄侧边栏 + 表格卡内横滚防溢出；
   手机（≤720px）为 H5 形态：顶部紧凑栏、导航横滑、
   表格在卡片内横向滚动、表单全宽 16px、按钮 ≥44px。
   ============================================================ */
:root {
  color-scheme: light;
  /* Gemini 基础色 */
  --ink: #1f2430;
  --muted: #5f6368;
  --muted-2: #80868b;
  --bg: #f8f9ff;
  --surface: #ffffff;
  --surface-soft: #f0f4f9;
  --surface-softer: #f8fafd;
  --line: #e3e7ee;
  --line-strong: #d3dae6;
  /* Gemini 渐变：蓝 → 紫 → 粉 */
  --gemini: linear-gradient(90deg, #4285f4 0%, #9b72cb 55%, #d96570 110%);
  --gemini-wide: linear-gradient(74deg, #4285f4 0%, #9b72cb 22%, #d96570 48%, #1f2430 72%);
  --blue: #4285f4;
  --accent: #0b57d0;
  --accent-dark: #0842a0;
  --wash: #e8f0fe;
  --danger: #b3261e;
  --ok: #137333;
  --shadow-card: 0 1px 2px rgba(31, 31, 31, .04), 0 10px 34px rgba(66, 133, 244, .07);
  --shadow-pop: 0 24px 70px rgba(80, 60, 160, .16);
  font-family: "Google Sans", "Product Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scrollbar-color: #c4cdd9 transparent; }
body {
  margin: 0;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(217, 101, 112, .10), transparent 60%),
    radial-gradient(1000px 560px at -10% 0%, rgba(66, 133, 244, .10), transparent 55%),
    radial-gradient(800px 500px at 55% 110%, rgba(155, 114, 203, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
::selection { background: #d3e3fd; }
a { color: var(--accent); }
h2 { font-size: 1.3rem; font-weight: 650; letter-spacing: -.015em; margin: 0; }
h3 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(66, 133, 244, .55); outline-offset: 2px;
}
button, input, select, .radio-row label {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

/* ---------- 按钮（胶囊） ---------- */
button {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 10px 22px;
  background: var(--gemini);
  color: #fff;
  font-weight: 620;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(120, 90, 210, .25);
}
button:hover { filter: brightness(1.07); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
button.secondary:hover { background: var(--wash); filter: none; }
button.danger {
  background: #fce8e6;
  color: var(--danger);
  box-shadow: none;
}
button.danger:hover { background: #f9d7d3; filter: none; }
button:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }

/* ---------- 表单 ---------- */
input, select {
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-softer);
  color: var(--ink);
}
input::placeholder { color: var(--muted-2); }
input:hover, select:hover { border-color: #b6c2d4; }
input:focus, select:focus {
  background: #fff;
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, .16);
}
label { display: block; font-size: .93rem; font-weight: 550; color: #3c4043; margin: 16px 0 7px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  padding: 26px;
}

/* ---------- 登录 / 初始化（居中毛玻璃卡 + 品牌标题层级） ---------- */
.center-wrap { max-width: 420px; margin: 10vh auto; padding: 0 16px; }
.center-wrap .card {
  border-radius: 32px;
  border-color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-pop);
  padding: 32px 30px;
}
/* 主标：渐变特大字；下方渐变短线作分隔（参照 v7「主标 + 短线 + 副标」） */
.brand {
  font-size: clamp(2.2rem, 8vw, 2.75rem);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: .01em;
  padding-bottom: .06em;
  background: var(--gemini-wide);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.center-wrap .brand::after {
  content: "";
  display: block;
  width: 38px; height: 3px;
  border-radius: 999px;
  background: var(--gemini);
  margin-top: 14px;
}
/* 副标：实色灰 + 宽字距，层级让给主标 */
.center-wrap .card > .muted {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .18em;
  margin: 14px 0 4px;
}

/* ---------- 主框架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex: 0 0 220px;
  padding: 26px 16px 20px;
  background: rgba(240, 244, 249, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(227, 231, 238, .7);
}
/* 侧边栏品牌：同规则缩小版 */
.sidebar .brand { font-size: 1.4rem; letter-spacing: .02em; }
.sidebar .brand::after {
  content: "";
  display: block;
  width: 26px; height: 3px;
  border-radius: 999px;
  background: var(--gemini);
  margin-top: 9px;
}
.sidebar .muted b {
  background: var(--gemini);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav { margin-top: 26px; display: grid; gap: 5px; }
.nav button {
  background: transparent;
  color: #3c4043;
  text-align: left;
  border-radius: 999px;
  padding: 11px 16px;
  box-shadow: none;
  font-weight: 550;
}
.nav button:hover { background: rgba(66, 133, 244, .08); color: var(--ink); filter: none; transform: none; }
.nav button.active {
  background: linear-gradient(90deg, #d3e3fd, #e9defc);
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, .12);
}
.main { flex: 1; padding: 28px; max-width: 1080px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom: 1px solid rgba(227, 231, 238, .85);
}
.muted { color: var(--muted); }
.msg { margin: 12px 0; font-size: 14px; line-height: 1.55; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #444746; font-weight: 650; font-size: .85rem; letter-spacing: .03em; white-space: nowrap; }
td { line-height: 1.55; }
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover { background: var(--surface-softer); }
.link-text { word-break: break-all; }

/* ---------- 记录行操作 ---------- */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 220px; }
.row-actions button { padding: 6px 10px; min-height: 34px; font-size: 13px; }
td .sub { display: block; opacity: .62; font-size: 12px; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pager button { padding: 7px 16px; min-height: 36px; }
.pager .current { background: var(--gemini); color: #fff; }

/* ---------- 行内表单 ---------- */
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form > div { flex: 1; min-width: 140px; }

/* ---------- 重点数字（渐变） ---------- */
.credits-big {
  font-size: 30px;
  font-weight: 760;
  background: var(--gemini);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 学历单选卡 ---------- */
.radio-row { display: flex; gap: 10px; margin-top: 6px; }
.radio-row label {
  margin: 0;
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 550;
  text-align: center;
  background: var(--surface);
}
.radio-row label:hover { border-color: #b6c2d4; background: var(--surface-softer); }
.radio-row input { width: auto; min-height: 0; margin-right: 6px; padding: 0; border: 0; background: none; box-shadow: none; }
.radio-row label:has(input:checked) {
  border-color: var(--blue);
  background: linear-gradient(90deg, #e8f0fe, #f3e8fd);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, .14);
}

/* ---------- 响应式：平板（721–1023px，保证不溢出即可） ---------- */
@media (min-width: 721px) and (max-width: 1023px) {
  .sidebar { width: 190px; flex: 0 0 190px; padding: 22px 14px 18px; }
  .main { padding: 22px; }
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 540px; }
}

/* ---------- 响应式：手机 H5（≤720px） ---------- */
@media (max-width: 720px) {
  body { overflow-x: hidden; }
  .layout { flex-direction: column; }
  /* 侧边栏 → 顶部紧凑栏：品牌与用户信息紧凑排列，导航横排可横滑 */
  .sidebar { width: 100%; flex: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 14px 10px; }
  .sidebar .brand { font-size: 1.2rem; }
  .sidebar .brand::after { width: 22px; margin-top: 6px; }
  .sidebar .muted { margin: 8px 0 0; line-height: 1.5; }
  .nav {
    margin-top: 12px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { flex: 0 0 auto; white-space: nowrap; text-align: center; min-height: 44px; padding: 10px 15px; }
  /* 内容区与卡片收紧 */
  .main { padding: 16px 14px 24px; width: 100%; }
  h2 { font-size: 1.15rem; }
  .topbar { margin-bottom: 14px; padding-bottom: 10px; }
  .credits-big { font-size: 26px; }
  .card { padding: 18px 16px; border-radius: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 登录 / 初始化卡：全宽带边距 */
  .center-wrap { width: 100%; margin: 6vh auto; padding: 0 12px; }
  .center-wrap .card { padding: 26px 20px; overflow-x: visible; }
  .brand { font-size: clamp(2rem, 11vw, 2.4rem); }
  .center-wrap .card > .muted { letter-spacing: .12em; }
  /* 表格：在卡片内横向滚动，列不挤压，页面本身不横滚 */
  table { min-width: 560px; }
  th, td { padding: 11px 9px; }
  td.link-text { min-width: 180px; }
  /* 表单：输入全宽、字号 ≥16px 防 iOS 聚焦缩放、按钮触控高度 ≥44px */
  input, select { font-size: 16px; }
  button { min-height: 44px; }
  .pager { row-gap: 10px; }
  .pager button { min-height: 44px; padding: 9px 16px; }
  .inline-form { gap: 10px; }
  .inline-form > div { flex: 1 1 150px; min-width: 0; }
  td .inline-form > div { flex-basis: 120px; }
  #new-user > div { flex: 1 1 100%; }
  #new-user button { width: 100%; }
  .radio-row { flex-wrap: wrap; }
  .radio-row label { flex: 1 1 140px; min-height: 44px; padding: 12px 10px; display: flex; align-items: center; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  button, input, select, .radio-row label, tbody tr { transition: none; }
  button:hover { transform: none; }
}

/* ---------- 弹窗（生成表单） ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(31, 36, 48, .45); display: flex; align-items: flex-start; justify-content: center; padding: 28px 14px; z-index: 80; overflow-y: auto; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-pop); width: 100%; max-width: 560px; padding: 22px 22px 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { margin: 0; font-size: 19px; }

/* ---------- 表格防挤压与小按钮 ---------- */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 1040px; }
td.nowrap { white-space: nowrap; }
.link-text { min-width: 215px; }
button.mini { padding: 3px 10px; min-height: 28px; font-size: 12.5px; }

/* ---------- 表格质感 ---------- */
thead th { background: var(--surface-softer); }
tbody tr:hover { background: var(--surface-softer); }
td .sub { white-space: nowrap; }
.row-actions { min-width: 250px; }

/* ---------- 表格 v2：列合并后适配桌面宽度 ---------- */
.main { max-width: 1300px; }
.table-scroll table { min-width: 1080px; }
button.mini { white-space: nowrap; }
.row-actions button { white-space: nowrap; }

/* ---------- 行内编辑（备注）防挤压 ---------- */
.inline-edit { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-edit input { min-width: 120px; min-height: 38px; }
.inline-edit button { white-space: nowrap; flex: none; min-height: 38px; padding: 6px 12px; }
