/* =========================================================================
   翊通行 (YPass) 设计系统
   风格：简约大气 · 圆角化 · 企业级 · 正式克制
   ========================================================================= */

:root {
  --primary: #4c6ef5;
  --primary-hover: #3b5bdb;
  --primary-soft: #edf2ff;

  --text-1: #1f2329;
  --text-2: #5f6672;
  --text-3: #9aa1ac;

  --bg: #f5f6fa;
  --card: #ffffff;
  --border: #e6e8ee;
  --border-strong: #d6dae2;

  --success: #16a34a;
  --success-soft: #e9f9ef;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --warn: #d97706;
  --warn-soft: #fdf3e3;
  --info: #4c6ef5;
  --info-soft: #edf2ff;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 6px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 兜底：任何元素意外超宽都不允许把整页撑出横向滚动条 */
  max-width: 100%;
  overflow-x: hidden;
}

img, video { max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- 通用容器 ---------- */
.yp-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary:hover, .btn:hover:not(.btn-ghost):not(.btn-danger-ghost):not(.btn-danger) {
  background: var(--primary-hover);
  color: #fff !important;
}

.btn-block { width: 100%; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 7px; }

.btn-ghost {
  background: #fff;
  color: var(--text-2) !important;
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text-1) !important;
  border-color: var(--text-3);
}

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { background: #fff; color: var(--danger) !important; border-color: #f1c4c4; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger) !important; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-1);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input:disabled { background: var(--bg); color: var(--text-3); }

.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

.select {
  height: 42px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-1);
  font-size: 14px;
  font-family: var(--font);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa1ac' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select-sm { height: 32px; font-size: 13px; padding: 0 28px 0 10px; border-radius: 7px; }

.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.form-hint.ok { color: var(--success); }
.form-hint.err { color: var(--danger); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 20px 22px; }

/* ---------- 弱化文本（全局） ---------- */
.muted { color: var(--text-3); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--bg); color: var(--text-3); }

/* 操作日志：中文标签下方的英文原始标识（小字、等宽、弱化） */
.op-code {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

/* ---------- 提示条 ---------- */
.alert {
  display: flex;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.6;
}
.alert .alert-icon { flex-shrink: 0; font-size: 16px; line-height: 1.5; }
.alert-info { background: var(--info-soft); color: #3147a8; border-color: #d7e0ff; }
.alert-warn { background: var(--warn-soft); color: #92500a; border-color: #f5dfb8; }
.alert-danger { background: var(--danger-soft); color: #a11d1d; border-color: #f5cccc; }
.alert-success { background: var(--success-soft); color: #12763a; border-color: #c8ecd4; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.table th { color: var(--text-3); font-weight: 500; white-space: nowrap; background: #fafbfc; }
.table tbody tr:hover { background: #fafbfe; }
.table .muted { color: var(--text-3); }
.table .nowrap { white-space: nowrap; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.pagination .page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
}
.pagination .page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn:disabled { opacity: .5; cursor: not-allowed; }
.pagination .page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 空态 / 加载态 ---------- */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Toast ---------- */
.yp-toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.yp-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text-1);
  animation: yp-toast-in .2s ease;
}
.yp-toast .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.yp-toast.success .dot { background: var(--success); }
.yp-toast.error .dot { background: var(--danger); }
.yp-toast.warn .dot { background: var(--warn); }
.yp-toast.info .dot { background: var(--info); }
@keyframes yp-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 全局加载遮罩 ---------- */
.yp-loading {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .18);
}
.yp-loading.show { display: flex; }
.yp-loading .box {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}
.yp-loading .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: yp-spin .7s linear infinite;
}
@keyframes yp-spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 ---------- */
.yp-modal-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .4);
  padding: 20px;
}
.yp-modal-mask.show { display: flex; }
.yp-modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: yp-modal-in .18s ease;
}
@keyframes yp-modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.yp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
  font-size: 16px;
  font-weight: 600;
}
.yp-modal-close { border: 0; background: none; font-size: 20px; color: var(--text-3); cursor: pointer; padding: 0 4px; line-height: 1; }
.yp-modal-body { padding: 16px 22px; color: var(--text-2); font-size: 14px; }
.yp-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
.yp-modal.mobile { max-width: 100%; }

/* ---------- 安全验证弹窗（标题居中，关闭按钮右上角） ---------- */
.yp-modal-captcha { max-width: 360px; }
.yp-modal-captcha .yp-modal-head {
  position: relative;
  justify-content: center;
  padding: 16px 18px 0;
  font-size: 15px;
}
.yp-modal-captcha .yp-modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.yp-modal-captcha .yp-modal-close:hover { background: var(--bg); }
.yp-modal-captcha .yp-modal-body { padding: 12px 18px 16px; }

/* ---------- 滑块验证码（滑条式） ---------- */
.ycap { width: 100%; user-select: none; }
.ycap-loading, .ycap-fatal { padding: 26px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.ycap-fatal { color: var(--danger, #f56c6c); }
.ycap-tip { font-size: 13px; color: var(--text-3); text-align: center; margin-bottom: 10px; }
.ycap-stage {
  position: relative;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f6;
}
.ycap-bg { display: block; }
.ycap-tile {
  position: absolute;
  cursor: default;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.35));
}
.ycap-stage-mask { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: transparent; pointer-events: none; }
.ycap.success .ycap-stage-mask { background: rgba(34, 197, 94, .12); }
.ycap.fail .ycap-stage-mask { background: rgba(239, 68, 68, .14); }

.ycap-track {
  position: relative;
  height: 40px;
  margin: 12px auto 0;
  background: #f0f2f5;
  border: 1px solid #e4e7ed;
  border-radius: 20px;
  overflow: hidden;
}
.ycap-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: #d9e2ff;
  transition: background .15s ease;
}
.ycap-track-text {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #909399;
  z-index: 1;
  pointer-events: none;
}
.ycap-handle {
  position: absolute;
  left: 0; top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6b7280;
  cursor: grab;
  z-index: 2;
  box-sizing: border-box;
}
.ycap-handle.dragging { cursor: grabbing; background: #fff; border-color: var(--primary); color: var(--primary); }
.ycap.success .ycap-progress { background: #b7ebc6; }
.ycap.success .ycap-handle { background: #22c55e; border-color: #22c55e; color: #fff; }
.ycap.success .ycap-track-text { color: #16a34a; }
.ycap.fail .ycap-progress { background: #fbcaca; }
.ycap.fail .ycap-handle { background: #ef4444; border-color: #ef4444; color: #fff; }
.ycap.fail .ycap-track-text { color: #dc2626; }

.ycap-bar { display: flex; justify-content: flex-start; margin-top: 10px; }
.ycap-refresh { font-size: 13px; color: var(--primary); text-decoration: none; }
.ycap-refresh:hover { text-decoration: underline; }

/* 窄屏（≤360px，如 iPhone SE）：收紧内边距，滑块整体由 JS 按容器宽度等比缩放 */
@media (max-width: 360px) {
  .yp-modal-captcha { max-width: 100%; }
  .yp-modal-captcha .yp-modal-body { padding: 12px 10px 14px; }
}

/* ---------- 认证页（登录 / 注册） ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 36px 28px;
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, #eef3ff, #dce7fb);
  border: 1px solid #e3ebfb;
  box-shadow: var(--shadow-sm);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 9px;
}
.auth-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.auth-title { font-size: 20px; font-weight: 600; color: var(--text-1); margin: 0 0 4px; }
.auth-sub { font-size: 13px; color: var(--text-3); margin: 0; }
.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 11px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }

/* ---------- 顶部导航（用户中心 / 后台共用） ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; color: #111827; letter-spacing: -0.2px; }
.topbar-brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef3ff, #dce7fb);
  border: 1px solid rgba(0,0,0,0.04);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  padding: 6px;
  box-shadow: 0 2px 8px rgba(76, 110, 245, 0.12);
}
.topbar-brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

/* ---------- 用户中心布局 ---------- */
.profile-page { max-width: 880px; margin: 24px auto 40px; padding: 0 16px; }
/* minmax(0,1fr) + 卡片 min-width:0：防止表格/长内容把 grid 轨道撑出视口 */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.profile-grid > .card { min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--bg); flex-shrink: 0; border: 1px solid var(--border); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-meta { min-width: 0; flex: 1 1 140px; }
.profile-meta .name { font-size: 17px; font-weight: 600; }
.profile-meta .phone { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.profile-head .spacer { flex: 1 1 0; min-width: 0; }

/* 窄屏（≤480px）：头像行允许换行，按钮独占一行；表单横排（输入框+按钮）改为纵向堆叠 */
@media (max-width: 480px) {
  .profile-head { gap: 10px 12px; }
  .profile-head .spacer { display: none; }
  .profile-head .btn { flex: 1 1 100%; }
  .input-row { flex-wrap: wrap; }
  .input-row .input { min-width: 0; flex: 1 1 100%; }
  .input-row .btn { flex: 1 1 100%; }
}

/* ---------- 管理员后台布局 ---------- */
.admin-shell { display: flex; min-height: calc(100vh - 64px); }
.admin-side {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.admin-nav { list-style: none; margin: 0; padding: 0; }
.admin-nav li { margin-bottom: 4px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.admin-nav a:hover { background: var(--bg); color: var(--text-1); }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.admin-main { flex: 1; min-width: 0; padding: 24px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.admin-toolbar .input { width: auto; flex: 1; min-width: 160px; max-width: 260px; }

/* 后台面板切换：默认隐藏，active 显示 */
.panel { display: none; }
.panel.active { display: block; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 18px 20px; }
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
  /* 数字优先使用拉丁字体栈，避免部分设备自定义/中文字体把 "1" 渲染成竖条 */
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum";
  font-feature-settings: "tnum";
}
.stat-card .stat-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* 用户控制台「安全概览」：固定 3 列居中，移动端窄屏也保持一行 */
.profile-page .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-page .stat-card { text-align: center; padding: 10px 4px; }
.profile-page .stat-card .stat-value { font-size: 26px; }
.profile-page .stat-card .stat-label { font-size: 12px; margin-top: 6px; }
@media (max-width: 420px) {
  .profile-page .stat-card .stat-value { font-size: 22px; }
  .profile-page .stat-card .stat-label { font-size: 11px; }
}
.stat-card .stat-value.accent { color: var(--primary); }
.stat-card .stat-value.warn { color: var(--warn); }
.stat-card .stat-value.danger { color: var(--danger); }

/* ---------- 看板图表（简易横向条形图，零依赖） ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { padding: 18px 20px; }
.chart-card .card-title { margin-bottom: 14px; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bar-item .bar-label { width: 96px; flex-shrink: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-item .bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }
.bar-item .bar-val { width: auto; min-width: 50px; white-space: nowrap; text-align: right; color: var(--text-3); flex-shrink: 0; }

/* ---------- 后台表单分组 ---------- */
.settings-group { margin-bottom: 20px; }
.settings-group > .group-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--primary); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.settings-grid .field { margin-bottom: 0; }
.settings-grid .field.full { grid-column: 1 / -1; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .topbar-brand { font-size: 15px; gap: 8px; flex-shrink: 1; min-width: 0; }
  .topbar-brand span:not(.logo) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .topbar-brand .logo { width: 28px; height: 28px; padding: 4px; border-radius: 8px; flex-shrink: 0; }
  .topbar-right { gap: 6px; flex-shrink: 0; }
  #admin_identity, .topbar-sep { display: none !important; }
  .topbar-link { display: none !important; }
  .topbar-right .btn { padding: 0 8px; font-size: 13px; margin-left: 0 !important; }

  .auth-card { padding: 28px 22px 22px; }
  .admin-side {
    position: fixed;
    left: 0;
    top: 58px;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .admin-side.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .admin-side-mask { position: fixed; top: 58px; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease; }
  .admin-side-mask.show { opacity: 1; visibility: visible; }
  .admin-main { padding: 16px; }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =========================================================================
   前台首页（落地页） - Premium Design
   ========================================================================= */
.home-page { min-height: 100vh; display: flex; flex-direction: column; background: #fff; }

.home-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.home-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-brand { display: flex; align-items: center; gap: 12px; }
.home-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef3ff, #dce7fb);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 6px;
  box-shadow: 0 2px 8px rgba(76, 110, 245, 0.12);
}
.home-brand-name { font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.2px; }
.home-nav-links { display: flex; align-items: center; gap: 24px; }
.home-nav-links a { font-size: 14.5px; color: #4b5563; font-weight: 500; transition: color 0.2s; }
.home-nav-links a:hover { color: var(--primary); }
.home-nav-links a.btn { color: #fff; padding: 0 18px; height: 36px; border-radius: 9px; box-shadow: 0 2px 6px rgba(76,110,245,0.2); }
.home-nav-links a.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(76,110,245,0.3); }

.home-hero {
  position: relative;
  background: radial-gradient(100% 100% at 50% 0%, #f4f7ff 0%, #ffffff 100%);
  padding: 110px 24px 90px;
  text-align: center;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%; width: 120%; height: 120%;
  background: radial-gradient(circle at 50% 0%, rgba(76,110,245,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.home-hero-inner { max-width: 860px; margin: 0 auto; position: relative; z-index: 1; }
.home-hero-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin: 0 auto 28px;
  display: block;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #f0f4ff);
  border: 1px solid rgba(76,110,245,0.15);
  box-shadow: 0 8px 32px rgba(76,110,245,0.12);
  padding: 16px;
}
.home-hero-title {
  font-size: 46px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 24px;
  line-height: 1.2;
  letter-spacing: -1px;
}
.home-hero-title span {
  background: linear-gradient(135deg, var(--primary), #88a4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-hero-desc {
  font-size: 18px;
  color: #4b5563;
  line-height: 1.8;
  margin: 0 auto 40px;
  max-width: 720px;
}
.home-hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.home-hero-actions .btn-lg {
  height: 48px;
  padding: 0 32px;
  font-size: 15px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 500;
  box-sizing: border-box;
}
.home-hero-actions .btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(76,110,245,0.3);
}
.home-hero-actions .btn-primary:hover {
  background: var(--primary-hover);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76,110,245,0.4);
}
.home-hero-actions .btn-ghost {
  background: #fff;
  border-color: #e5e7eb;
  color: #374151 !important;
}
.home-hero-actions .btn-ghost:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #111827 !important;
}

.home-section { padding: 90px 24px; background: #fff; }
.home-section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 16px;
  color: #111827;
  letter-spacing: -0.5px;
}
.home-section-sub {
  font-size: 16px;
  color: #6b7280;
  text-align: center;
  margin: 0 0 60px;
}
.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.home-feature {
  padding: 28px 24px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.home-feature-icon { margin-bottom: 16px; color: var(--text-2); }
.home-feature-name { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.home-feature-text { font-size: 13.5px; color: var(--text-2); line-height: 1.8; }

.home-cta {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
.home-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(76,110,245,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.home-cta-inner { max-width: 720px; margin: 0 auto; position: relative; z-index: 1; }
.home-cta-title { font-size: 32px; font-weight: 700; color: #fff; margin: 0 0 16px; letter-spacing: -0.5px; }
.home-cta-desc { font-size: 16px; color: #9ca3af; margin: 0 0 40px; }
.home-cta .btn-lg {
  height: 48px;
  padding: 0 32px;
  font-size: 15px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.home-cta .btn-primary { background: var(--primary); color: #fff !important; border: none; font-weight: 600; box-shadow: 0 4px 14px rgba(76,110,245,0.3); }
.home-cta .btn-primary:hover { background: var(--primary-hover); color: #fff !important; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76,110,245,0.4); }
.home-cta .btn-ghost { background: rgba(255,255,255,0.1); color: #fff !important; border: 1px solid rgba(255,255,255,0.4); }
.home-cta .btn-ghost:hover { background: rgba(255,255,255,0.2); border-color: #fff; transform: translateY(-2px); color: #fff !important; }

.home-footer { background: #0f172a; color: #94a3b8; padding: 24px; margin-top: -1px; }
.home-footer-copyright { font-size: 13.5px; color: #64748b; text-align: center; }

@media (max-width: 900px) {
  .home-feature-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero-title { font-size: 36px; }
  .home-section-title { font-size: 28px; }
}
@media (max-width: 600px) {
  .home-feature-grid { grid-template-columns: 1fr; }
  .home-hero { padding: 80px 20px 60px; }
  .home-hero-title { font-size: 32px; }
  .home-section { padding: 60px 20px; }
}

/* ---------- 顶部下拉菜单 ---------- */
.topbar-user-dropdown {
  position: relative;
  display: inline-block;
}
.topbar-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.topbar-user-trigger:hover {
  background: rgba(0,0,0,0.04);
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.topbar-username {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-chevron {
  color: var(--text-3);
  transition: transform 0.2s;
}
.topbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
}
.topbar-user-dropdown:hover .topbar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.topbar-user-dropdown:hover .topbar-chevron {
  transform: rotate(180deg);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
}
.dropdown-item svg {
  color: var(--text-3);
  transition: color 0.2s;
}
.dropdown-item:hover {
  background: var(--bg);
  color: var(--text-1);
}
.dropdown-item:hover svg {
  color: var(--text-2);
}
.dropdown-item.text-danger {
  color: var(--danger);
}
.dropdown-item.text-danger svg {
  color: var(--danger);
}
.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.08);
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .topbar-username, .topbar-chevron { display: none; }
  .topbar-user-trigger { padding: 2px; }
}
.topbar-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
