/* ============================================================
   金半仙 · 主站样式 —— Apple / iOS 设计语言
   设计令牌（tokens）对齐 iOS 系统色板，子页面后续换肤按此对齐：
   · 背景  systemGroupedBackground  #f2f2f7 / #000000
   · 卡片  secondarySystemGroupedBackground  #ffffff / #1c1c1e
   · 主色  systemBlue  #007aff / #0a84ff
   · 字体  SF 系统栈（-apple-system 优先）+ PingFang SC
   ============================================================ */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --ink: #1c1c1e;
  --dim: #86868b;
  --hi: #007aff;
  --hi-soft: rgba(0, 122, 255, .12);
  --fill: rgba(120, 120, 128, .12);
  --line: rgba(60, 60, 67, .12);
  --chevron: rgba(60, 60, 67, .3);
  --danger: #ff3b30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --dim: #98989d;
    --hi: #0a84ff;
    --hi-soft: rgba(10, 132, 255, .18);
    --fill: rgba(120, 120, 128, .24);
    --line: rgba(84, 84, 88, .45);
    --chevron: rgba(235, 235, 245, .3);
    --danger: #ff453a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: max(44px, 7vh) 20px 44px;
  transition: background .25s ease, color .25s ease;
}

.wrap { width: 100%; max-width: 420px; }
.hidden { display: none !important; }

/* 可见焦点（键盘可达性，Apple 风格的蓝色光晕） */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hi-soft), 0 0 0 1.5px var(--hi);
  border-radius: 12px;
}

/* ---------- 头部 ---------- */

.hero { text-align: center; margin-bottom: 36px; }

.avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 24px;                       /* iOS 应用图标式圆角 */
  background: linear-gradient(180deg, #3ea2ff, #0064d2);
  color: #fff;
  font: 600 30px/76px -apple-system, "PingFang SC", sans-serif;
  letter-spacing: .02em;
  text-indent: .02em;
  user-select: none;
  box-shadow: 0 6px 18px rgba(0, 100, 210, .28);
}

h1 {
  margin: 0 0 6px;
  font: 700 28px/1.25 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  letter-spacing: -.015em;                   /* SF 大标题的紧字距 */
}

.tagline { margin: 0; color: var(--dim); font-size: 15px; }

.who {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--dim);
}
.who b, .who strong { color: var(--hi); font-weight: 500; }

.linklike {
  margin-top: 10px;
  background: none;
  border: 0;
  padding: 4px 8px;
  color: var(--hi);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
}
.linklike:hover { opacity: .72; }
.linklike:active { opacity: .5; }

/* ---------- 登录 / 注册卡片 ---------- */

.auth-box {
  margin: 24px auto 0;
  padding: 8px 16px 16px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* iOS 分段控件（Segmented Control） */
.tabs {
  display: flex;
  gap: 2px;
  margin: 12px 0 16px;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
}

.tabs button {
  flex: 1;
  padding: 7px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

.tabs button.active {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04);
}

.tabs button:not(.active):hover { opacity: .65; }

/* iOS 填充式输入框（无边框 + 灰底） */
.auth-box input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  font: inherit;
  font-size: 16px;              /* ≥16px，避免 iOS 自动放大 */
  color: var(--ink);
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-box input::placeholder { color: var(--dim); }
.auth-box input:focus {
  background: var(--card);
  border-color: var(--hi);
  box-shadow: 0 0 0 3px var(--hi-soft);
}

/* 主按钮 */
.auth-box .submit {
  width: 100%;
  padding: 12px 0;
  margin-top: 4px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  background: var(--hi);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, opacity .18s ease;
}
.auth-box .submit:hover { opacity: .9; }
.auth-box .submit:active { transform: scale(.98); }
.auth-box .submit:disabled { opacity: .5; cursor: default; transform: none; }

.auth-msg { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: var(--danger); }
.auth-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--dim); line-height: 1.6; }

/* ---------- 入口卡片（iOS 分组列表 / 设置样式） ---------- */

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1.2), box-shadow .18s ease, opacity .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 10px 28px rgba(0, 0, 0, .08);
}
.card:active { transform: scale(.98); }

.card.ghost {
  opacity: .45;
  pointer-events: none;
  box-shadow: none;
}

/* 图标：iOS 主屏图标式的彩色渐变圆角方块 */
.ci {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .15);
}
.ci-movie  { background: linear-gradient(180deg, #ff6482, #ff2d55); }
.ci-reader { background: linear-gradient(180deg, #ffb340, #ff9500); }
.ci-admin  { background: linear-gradient(180deg, #8e9aa8, #636366); }
.ci-life   { background: linear-gradient(180deg, #7d7aff, #5856d6); }
.ci-files  { background: linear-gradient(180deg, #64d2ff, #0a84ff); }

.cb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cb strong { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.cb em {
  font-style: normal;
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ca {
  flex: none;
  color: var(--chevron);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-1px);
}

.notice {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--dim);
  font-size: 14px;
  text-align: center;
  line-height: 1.7;
}

/* ---------- 关于 / 页脚 ---------- */

.about { padding-top: 24px; border-top: .5px solid var(--line); }
.about p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.7; }

footer { margin-top: 28px; color: var(--dim); font-size: 12.5px; text-align: center; opacity: .8; }

/* ---------- 用户管理页 ---------- */

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-head h1 { font-size: 26px; margin: 0; }
.admin-head .linklike { margin: 0; }

.user-row {
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.user-row .u-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.user-row .u-name { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; letter-spacing: -.01em; }

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 2.5px 9px;
  border-radius: 20px;
  background: var(--hi-soft);
  color: var(--hi);
}

.user-row .u-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.user-row .u-ops button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 13px;
  border: 0;
  border-radius: 9px;
  background: var(--fill);
  color: var(--ink);
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease;
}
.user-row .u-ops button:hover { opacity: .75; }
.user-row .u-ops button:active { transform: scale(.96); }
.user-row .u-ops button.danger { color: var(--danger); background: rgba(255, 59, 48, .12); }
@media (prefers-color-scheme: dark) {
  .user-row .u-ops button.danger { background: rgba(255, 69, 58, .18); }
}

.picker { display: flex; gap: 16px; flex-wrap: wrap; margin: 2px 0 0; }
.picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.picker input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--hi);
}
.picker label:has(input:disabled) { opacity: .45; cursor: default; }

.new-box {
  margin-top: 24px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.new-box h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.new-box input {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 10px;
  font: inherit;
  font-size: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.new-box input::placeholder { color: var(--dim); }
.new-box input:focus {
  background: var(--card);
  border-color: var(--hi);
  box-shadow: 0 0 0 3px var(--hi-soft);
}
.new-box .row { display: flex; gap: 8px; }
.new-box .row input { flex: 1; margin-bottom: 0; min-width: 0; }
.new-box .row button {
  flex: none;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  background: var(--hi);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, opacity .18s ease;
}
.new-box .row button:hover { opacity: .9; }
.new-box .row button:active { transform: scale(.97); }

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
