/* ============================================================
   user-system v5 · Apple HIG 极简白
   · Apple 蓝 #2563EB + 纯白底 + 轻灰线条
   · 固定侧栏 + 内容区；无阴影硬边框，用线条分区
   · 圆角 8px，文字 Segoe UI
   ============================================================ */

:root {
  --blue:       #2563EB;
  --blue-tint:  #EBF5FF;
  --blue-dark:  #0066CC;
  --green:      #34C759;
  --bg:         #FFFFFF;
  --surface:    #FFFFFF;
  --text:       #1D1D1F;
  --muted:      #86868B;
  --border:     #D2D2D7;
  --border-soft:#E5E5EA;
  --border-bg:  #F5F5F7;
  --sidebar-w:  208px;
  --admin-sidebar-w: 216px;
  --topbar-h:   48px;
  --radius:     8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
}
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* 侧边栏内所有交互元素：禁用 tap 高亮 + outline（保留键盘 focus 样式） */
.sidebar *, .admin-sidebar *,
.sidebar, .admin-sidebar {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
}
.sidebar :focus:not(:focus-visible),
.admin-sidebar :focus:not(:focus-visible) {
  outline: none;
}
/* iOS Safari 上 :active 时强制无背景（部分版本会忽略 tap-highlight-color） */
.sidebar button:active, .sidebar a:active,
.admin-sidebar button:active, .admin-sidebar a:active,
input, select, textarea, .btn, .mobile-menu-btn {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
  user-select: none;
}
.sidebar button:active, .sidebar a:active,
.admin-sidebar button:active, .admin-sidebar a:active {
  background-color: transparent;
}
/* input/textarea 允许文本选择，但要关掉默认 tap 高亮（iOS 行为差异） */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}
a { color: var(--blue); text-decoration: none; }
a:hover { opacity: 0.8; }
img { max-width: 100%; }
.mono { font-family: "SF Mono", "Consolas", monospace; font-size: 12px; }
.muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.hidden { display: none !important; }

/* ============================================================
   滚动条（macOS 极简风格：透明轨道 + 淡灰细滑块）
   ============================================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }

/* 侧栏滚动条：完全隐藏（保留鼠标滚轮/触摸板滚动能力） */
.sidebar-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* ============================================================
   图标（inline SVG）
   ============================================================ */
.icon {
  display: inline-block;
  width: 17px; height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ============================================================
   整体布局
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}

/* ============================================================
   侧边栏 — Apple HIG 风格
   ============================================================ */
:root {
  --hig-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hig-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --hig-ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}
.sidebar {
  width: var(--sidebar-w);
  border-right: 1px solid var(--border-soft);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  background: var(--bg);
  flex-shrink: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  animation: sidebarEnter 0.55s var(--hig-ease-out) both;
}
@keyframes sidebarEnter {
  from { transform: translateX(-14px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* 品牌区：HIG 风格留白、logo 微动 */
.sidebar-brand {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-decoration: none;
  color: var(--text);
  transition: background 0.35s var(--hig-ease-out);
}
.sidebar-brand:hover { background: #F5F5F7; }
.brand-logo {
  width: 28px; height: 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: transform 0.5s var(--hig-ease);
}
.sidebar-brand:hover .brand-logo { transform: rotate(-10deg) scale(1.08); }
.sidebar-brand span:last-child {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sidebar-footer { flex-shrink: 0; margin-top: auto; }

/* 移动端侧栏遮罩 — 淡入淡出 */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  z-index: 95;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.35s var(--hig-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* 导航 — Apple HIG 风格 */
.sidebar-nav {
  padding: 12px 16px 16px 22px;
  flex: 1; min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-group { margin-bottom: 12px; }
.nav-group-label {
  font-size: 10px; font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase; letter-spacing: 1.4px;
  padding: 6px 10px 6px;
  display: flex; align-items: center; gap: 6px;
}
.nav-group-label::before {
  content: '';
  width: 3px; height: 3px;
  background: var(--blue);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.4s var(--hig-ease);
}
.nav-group:hover .nav-group-label::before { opacity: 1; transform: scale(1); }

/* ========= 导航项（带弹性动画的 HIG 风格） ========= */
.nav-item {
  display: flex; align-items: center; gap: 11px;
  margin: 3px 0;
  padding: 9px 12px 9px 20px;
  font-size: 13.5px; color: #5C5C60;
  text-decoration: none;
  border-radius: 8px;
  position: relative;
  overflow: visible;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.25s var(--hig-ease-out),
              color 0.25s var(--hig-ease-out),
              transform 0.15s var(--hig-ease-out),
              padding-left 0.3s var(--hig-ease-out),
              margin 0.3s var(--hig-ease-out);
}
/* 左侧 rail 指示器（HIG 风格，纵向 pill，移到导航项外部） */
.nav-item::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 0;
  background: var(--blue);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.35s var(--hig-ease),
              top 0.35s var(--hig-ease),
              box-shadow 0.3s;
}
/* hover：图标轻微缩放 */
.nav-item .icon,
.nav-toggle .icon {
  transition: transform 0.4s var(--hig-ease), stroke 0.25s ease;
}
.nav-item:hover .icon { transform: scale(1.18) rotate(-3deg); }
.nav-toggle:hover .icon { transform: scale(1.18); }
/* hover：文字轻微位移 */
.nav-item:hover .label,
.nav-toggle:hover .label,
.nav-child:hover .label { letter-spacing: 0.01em; }

.nav-item:hover { background: #F2F2F5; color: var(--text); }
@media (hover: none) {
  .nav-item:hover { background: transparent; color: var(--text); }
}
.nav-item.active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding-left: 20px;
  margin: 4px 0;
}
.nav-item.active::before {
  height: 60%;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.08);
}
.nav-item.active .icon { stroke: var(--blue); transform: scale(1.08); }

.icon-wrap { display: flex; align-items: center; width: 20px; flex-shrink: 0; }
.label { transition: letter-spacing 0.25s var(--hig-ease-out); }

/* ========= 可展开父级 ========= */
.nav-toggle {
  display: flex; align-items: center; gap: 11px;
  margin: 3px 0;
  padding: 9px 12px 9px 20px;
  font-size: 13.5px; color: #5C5C60;
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
  font-family: inherit;
  border-radius: 8px;
  position: relative;
  overflow: visible;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.25s var(--hig-ease-out),
              color 0.25s var(--hig-ease-out),
              transform 0.15s var(--hig-ease-out),
              padding-left 0.3s var(--hig-ease-out),
              margin 0.3s var(--hig-ease-out);
}
.nav-toggle::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 0;
  background: var(--blue);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.35s var(--hig-ease),
              top 0.35s var(--hig-ease),
              box-shadow 0.3s;
}
.nav-toggle:hover { background: #F2F2F5; }
@media (hover: none) {
  .nav-toggle:hover { background: transparent; }
}
.nav-toggle.open {
  color: var(--text);
  background: transparent;
  font-weight: 600;
  padding-left: 20px;
  margin: 4px 0;
}
.nav-toggle.open::before {
  height: 60%;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.08);
}
.nav-toggle.open .icon { stroke: var(--blue); transform: scale(1.08); }
.nav-toggle.open .chev { stroke: var(--blue); }

/* ========= 涟漪 ========= */
.nav-item .ripple,
.nav-toggle .ripple,
.nav-child .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);    /* 极淡中性灰，不再用蓝色 */
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  pointer-events: none;
  left: 50%;
  top: 50%;
  width: 6px; height: 6px;
  max-width: 100%;                    /* 限制不超过元素 */
  max-height: 100%;
  overflow: hidden;
  animation: ripple-expand 0.35s var(--hig-ease-out) forwards;
}
@keyframes ripple-expand {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2);  opacity: 0; }
}

/* ========= 按下反馈（用 hover:hover 限定，仅鼠标设备） ========= */
@media (hover: hover) {
  .nav-item:active,
  .nav-toggle:active,
  .nav-child:active {
    transform: scale(0.985);
    background: transparent !important;
    transition: transform 0.1s var(--hig-ease);
  }
}
/* 触屏设备：仅极轻缩小，并快速回弹，避免长按卡住 */
@media (hover: none) {
  .nav-item:active,
  .nav-toggle:active,
  .nav-child:active {
    transform: scale(0.99);
    background: transparent !important;
    transition: transform 0.08s ease-out;
  }
}
/* iOS WebKit 上按住时强制无任何背景色覆盖（包括系统蓝） */
.sidebar :active,
.admin-sidebar :active {
  background-color: transparent !important;
  background-image: none !important;
}

/* ========= 箭头（弹性旋转） ========= */
.chev {
  width: 13px; height: 13px; stroke: var(--muted);
  margin-left: auto;
  transition: transform 0.45s var(--hig-ease), stroke 0.2s ease;
}
.nav-toggle:hover .chev { stroke: #5C5C60; }
.nav-toggle.open .chev {
  transform: rotate(90deg);
  stroke: var(--blue);
}

/* ========= 子菜单（弹性展开） ========= */
.nav-children {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.45s var(--hig-ease-out),
              opacity 0.3s ease,
              padding 0.4s var(--hig-ease-out);
}
.nav-children.open {
  max-height: 500px;
  opacity: 1;
  padding-top: 3px;
  padding-bottom: 6px;
}

/* 子菜单逐条滑入 */
.nav-children.open .nav-child {
  animation: childSlideIn 0.5s var(--hig-ease-out) both;
}
.nav-children.open .nav-child:nth-child(1) { animation-delay: 0.04s; }
.nav-children.open .nav-child:nth-child(2) { animation-delay: 0.08s; }
.nav-children.open .nav-child:nth-child(3) { animation-delay: 0.12s; }
.nav-children.open .nav-child:nth-child(4) { animation-delay: 0.16s; }
.nav-children.open .nav-child:nth-child(5) { animation-delay: 0.20s; }
.nav-children.open .nav-child:nth-child(6) { animation-delay: 0.24s; }
.nav-children.open .nav-child:nth-child(n+7) { animation-delay: 0.28s; }
@keyframes childSlideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ========= 子项 ========= */
.nav-child {
  display: flex; align-items: center;
  margin: 2px 0;
  padding: 7px 12px 7px 30px;
  font-size: 13px; color: #6B6B6F;
  text-decoration: none;
  position: relative;
  border-radius: 7px;
  min-height: 32px;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.25s var(--hig-ease-out),
              color 0.25s var(--hig-ease-out),
              padding-left 0.3s var(--hig-ease-out),
              transform 0.15s var(--hig-ease-out),
              margin 0.3s var(--hig-ease-out);
}
/* 子项指示器：rail pill 移到外部 */
.nav-child::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 0;
  background: var(--blue);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.35s var(--hig-ease),
              top 0.35s var(--hig-ease),
              box-shadow 0.3s,
              background 0.25s ease;
}
.nav-child:hover {
  background: #F2F2F5;
  color: var(--text);
  padding-left: 30px;
}
@media (hover: none) {
  .nav-child:hover { background: transparent; color: var(--text); padding-left: 30px; }
}
.nav-child:hover::before {
  height: 50%;
  background: #A0A0A8;
}
.nav-child.active {
  color: var(--text);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.09) 0%, rgba(37, 99, 235, 0.02) 70%, transparent 100%);
  padding-left: 30px;
}
.nav-child.active::before {
  height: 60%;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.08);
}
.nav-child.active .icon { stroke: var(--blue); transform: scale(1.08); }
.nav-child.active .icon { stroke: var(--blue); transform: scale(1.08); }
.nav-child .icon { transition: transform 0.35s var(--hig-ease), stroke 0.25s ease; }
.nav-child:hover .icon { transform: scale(1.15); }

/* 侧栏底部用户信息 + 退出 */
.sidebar-footer {
  margin-top: 8px;
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.3s var(--hig-ease-out);
}
.sidebar-user:hover { background: #F2F2F5; }
.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--blue) 0%, #4DA3FF 100%);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  transition: transform 0.4s var(--hig-ease);
}
.sidebar-user:hover .sidebar-user-avatar { transform: scale(1.08) rotate(-4deg); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-vip { font-size: 10px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 7px;
  transition: background 0.25s var(--hig-ease-out),
              color 0.25s var(--hig-ease-out),
              transform 0.25s var(--hig-ease-out);
}
.sidebar-logout:hover {
  background: #FF3B301A;
  color: #FF3B30;
  transform: translateX(2px);
}
.sidebar-logout:active { transform: translateX(2px) scale(0.97); }
.sidebar-logout .icon {
  width: 13px; height: 13px;
  transition: transform 0.4s var(--hig-ease);
}
.sidebar-logout:hover .icon { transform: translateX(2px); }

/* ============================================================
   主内容区
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  overflow-x: hidden;
  min-width: 0;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   顶部栏
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center;
  padding: 0 32px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-brand {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.topbar-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #2563EB 0%, #5AC8FA 100%);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.topbar-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.topbar-divider { color: var(--muted); font-size: 12px; }
.topbar-nav { display: flex; align-items: center; gap: 16px; margin-left: 16px; min-width: 0; flex: 1; overflow: hidden; }
.topbar-nav a { font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.topbar-nav a:hover { color: var(--text); }
.topbar-nav a.active { color: var(--blue); font-weight: 600; min-width: 0; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.topbar-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* 移动端菜单按钮 — HIG 风格 */
.mobile-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.4s var(--hig-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
              background 0.25s var(--hig-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: #F2F2F5; }
.mobile-menu-btn:active { transform: scale(0.92); }
.mobile-menu-btn svg {
  width: 18px; height: 18px; stroke: var(--text);
  transition: stroke 0.2s ease;
}
.mobile-menu-btn.is-open { background: transparent; }
.mobile-menu-btn.is-open svg { stroke: var(--blue); }

/* ============================================================
   内容区
   ============================================================ */
.content {
  padding: 28px 32px 48px;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* ============================================================
   页面头部
   ============================================================ */
.page-meta {
  font-size: 10px; font-weight: 600;
  color: var(--blue); text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.page-meta .sep { color: var(--muted); font-weight: 400; }

.h-page {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--text);
  line-height: 1.15; margin-bottom: 8px;
}
.h-section {
  font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 14px;
  letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 8px;
}
.h-sub {
  font-size: 10px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.page-desc {
  font-size: 13px; color: var(--muted);
  line-height: 1.6; margin-bottom: 16px;
}

/* ============================================================
   区块与分隔
   ============================================================ */
.sec { margin-bottom: 28px; overflow: hidden; }
.divider { height: 1px; background: var(--border-soft); margin: 24px 0; }

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card-tight { padding: 14px 16px; }
.card-wide { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; padding: 7px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  color: var(--text); font-family: inherit;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-primary:active { background: #0055AA; }
.btn-primary:disabled { background: #A0C7FF; cursor: default; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--border-bg); }
.btn-link { color: var(--blue); padding: 0; border: none; background: none; }
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.checkbox { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }
.seg { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 34px; min-height: 34px; max-height: 34px; }
.seg-btn { flex: 1; height: 100%; min-height: 0; padding: 0 12px; font-size: 13px; color: var(--text-soft); background: var(--surface); border: none; cursor: pointer; transition: background 0.15s, color 0.15s; font-family: inherit; display: flex; align-items: center; justify-content: center; }
.seg-btn.active { background: var(--blue); color: #fff; font-weight: 600; }
.seg-btn:not(.active):hover { background: var(--border-bg); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.btn-lg { padding: 10px 18px; font-size: 13px; border-radius: 8px; }
.btn .icon { width: 15px; height: 15px; stroke-width: 2; }
.btn-lg .icon { width: 16px; height: 16px; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ============================================================
   表单
   ============================================================ */
.input {
  width: 100%; max-width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
select.input { cursor: pointer; }

label.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.4; }
.hint:not(:empty) { margin-top: 3px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-family: inherit; resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); outline: none; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   徽章
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-blue { background: rgba(0,122,255,0.1); color: var(--blue); }
.badge-green { background: rgba(52,199,89,0.12); color: #2A8E33; }
.badge-gray { background: var(--border-bg); color: var(--muted); }
.badge-info { background: rgba(0,122,255,0.1); color: var(--blue); }
.badge-success { background: rgba(52,199,89,0.12); color: #2A8E33; }
.badge-warning { background: rgba(255,149,0,0.12); color: #C77800; }
.badge-danger { background: rgba(255,59,48,0.12); color: #D70015; }
.badge-muted { background: var(--border-bg); color: var(--muted); }
.badge-red { background: #FFEBEE; color: #C62828; }

/* ============================================================
   K/V 信息
   ============================================================ */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); font-weight: 500; }
.kv-s { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.kv-s:last-child { border-bottom: none; }
.kv-s .k { color: var(--muted); }
.kv-s .v { font-weight: 600; color: var(--text); }

/* ============================================================
   列表
   ============================================================ */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-title { font-size: 13px; font-weight: 500; color: var(--text); }
.list-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   表单网格（任务页）
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field-full { grid-column: 1 / -1; }
.form-grid .field-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   表单上下排版（标签在左、输入在右）
   ============================================================ */
.form-stack { display: flex; flex-direction: column; }
.form-stack .row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.form-stack .row:first-child { border-top: none; padding-top: 4px; }
.form-stack .row-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding-top: 22px; /* 对齐第一个 label */
}
.form-stack .row-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-stack .row-fields .alert { margin: 0; }
.form-stack .row-fields .field > .btn { align-self: flex-start; }
@media (max-width: 768px) {
  .form-stack .row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .form-stack .row-label { padding-top: 0; }
}

/* ============================================================
   实时任务面板
   ============================================================ */
.live-task {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.live-task-meta { display: flex; align-items: center; gap: 8px; }
.live-task-progress { }
.live-task-nums { font-size: 12px; color: var(--muted); }

/* 进度条 */
.task-progress {
  height: 6px; background: var(--border-bg);
  border-radius: 3px; overflow: hidden;
  position: relative;
}
.task-progress-bar {
  height: 100%; background: var(--blue);
  border-radius: 3px; transition: width 0.4s ease;
  min-width: 0;
}
.task-progress.is-live .task-progress-bar {
  background: linear-gradient(90deg, var(--blue) 0%, #34AADC 100%);
  background-size: 200% 100%;
  animation: progress-shine 1.5s linear infinite;
}
@keyframes progress-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.task-progress-text { font-size: 11px; color: var(--muted); margin-top: 4px; }
.text-ok { color: #2E7D32; font-weight: 600; }
.text-fail { color: #C62828; font-weight: 600; }
.live-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: #34AADC;
  margin-right: 4px; vertical-align: middle;
  animation: dot-pulse 1s ease-in-out infinite;
}
.live-dot.off { animation: none; background: var(--muted); }
.green-dot {
  display: inline-block; width: 4px; height: 4px;
  border-radius: 50%; background: #34C759;
  vertical-align: middle;
  animation: green-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes green-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(52,199,89,0.4); }
  50% { opacity: 0.8; transform: scale(0.9); box-shadow: 0 0 0 4px rgba(52,199,89,0); }
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.flash-done { animation: flash-done 0.5s ease; }
@keyframes flash-done {
  0% { background: var(--surface); }
  50% { background: #E8F5E9; }
  100% { background: var(--surface); }
}

/* ============================================================
   网格
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ============================================================
   首页左右分栏（用户中心）
   ============================================================ */

/* Hero 区块（顶部 Today Overview） */
.home-hero {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 24px 14px;
  margin-bottom: 12px;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hero-progress { font-weight: 500; letter-spacing: 0.4px; }
.hero-title {
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px 0;
  color: var(--text);
}
.hero-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 14px 0;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-link {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.hero-link:hover { text-decoration: underline; }
.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.hero-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.home-layout { display: grid; grid-template-columns: 1fr 300px; gap: 12px; align-items: start; overflow: hidden; }
.home-left  { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }
.home-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }

/* 账号信息卡 */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

/* 头像 + 名字 横向布局 */
.account-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.account-name-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.account-name {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-account {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}
.account-vip-badge.is-vip { color: #34C759; }
.account-vip-badge .vip-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #34C759;
  flex-shrink: 0;
}

/* 三列统计 */
.account-stats {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 0;
  gap: 0;
}
.stat-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-value { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 10px; color: var(--muted); }
.stat-divider { width: 1px; background: var(--border-soft); margin: 0 4px; }

/* 卡片底部 */
.account-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.account-footer a {
  color: var(--blue); font-size: 12px;
  text-decoration: none; display: flex; align-items: center; gap: 2px;
}
.account-footer a:hover { opacity: 0.8; }

/* 快手账号 */
.ks-account-row { display: flex; align-items: center; gap: 10px; }
.ks-account-text { flex: 1; min-width: 0; }
.ks-account-text .text-strong { font-size: 13px; font-weight: 600; }
.ks-account-text .hint { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* VIP 套餐 */
.vip-packages { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; overflow: hidden; }
.vip-pkg-item {
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.vip-pkg-name { font-size: 13px; font-weight: 600; }
.vip-pkg-desc { font-size: 11px; color: var(--muted); }
.vip-pkg-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.vip-pkg-price { font-size: 13px; font-weight: 600; color: var(--blue); }

/* 签到卡 */
.sign-card { text-align: center; padding: 28px 20px; }
.sign-date { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.sign-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.sign-hint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* 公告 */
.ann-list { display: flex; flex-direction: column; }
.ann-item {
  padding: 16px 0;
  transition: background 0.15s;
  border-radius: 6px;
}
.ann-item + .ann-item { border-top: 1px solid var(--border-soft); }
.ann-item:hover { background: var(--border-bg); }
.ann-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ann-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text);
  letter-spacing: -0.1px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ann-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ann-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FF3B30;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1.4;
}
.ann-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.ann-cat-cat { background: var(--blue); }
.ann-cat-update { background: #FF9500; }
.ann-cat-event { background: #34C759; }
.ann-cat-fix { background: #FF3B30; }
.ann-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.ann-body {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ann-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.ann-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.ann-meta-item svg { width: 11px; height: 11px; opacity: 0.6; }
.ann-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.ann-link:hover { text-decoration: underline; }

/* 卡密兑换 */
.card-redeem-form { display: flex; gap: 8px; }
.card-redeem-form .input { flex: 1; }

/* 兑换记录 */
.redeem-list { display: flex; flex-direction: column; }
.redeem-item { padding: 10px 0; }
.redeem-name { font-size: 13px; font-weight: 500; }
.redeem-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }

/* ============================================================
   工具栏
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 240px; }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
th {
  padding: 9px 14px; text-align: left; font-weight: 600;
  color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
  background: var(--border-bg); border-bottom: 1px solid var(--border-soft);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFA; }
.table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }

/* 任务列表加载更多 */
.task-more { margin-top: 18px; text-align: center; }
.task-more .btn-more {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 22px;
  background: var(--border-bg); color: var(--text);
  border: none; border-radius: 20px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.task-more .btn-more:hover { background: var(--border); }
.task-more .btn-more:disabled { opacity: 0.5; cursor: not-allowed; }
.task-more .btn-more svg { width: 14px; height: 14px; }
.task-more .loader {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin-loader 0.7s linear infinite;
  margin-right: 4px; vertical-align: -2px;
}
@keyframes spin-loader { to { transform: rotate(360deg); } }
.task-end {
  text-align: center;
  font-size: 12px; color: #AEAEB2;
  margin-top: 18px; padding: 14px 0;
}
.task-end .line {
  display: inline-block; width: 36px; height: 1px;
  background: var(--border-soft);
  vertical-align: middle; margin: 0 10px;
}
.list-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 头像 */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 40px; height: 40px; }

/* ============================================================
   分页
   ============================================================ */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 14px; justify-content: flex-end; }
.pagination button { padding: 5px 10px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); font-size: 11px; cursor: pointer; font-family: inherit; color: var(--text); }
.pagination button:hover { background: var(--border-bg); }
.pagination button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination button:disabled { opacity: 0.35; cursor: default; }

/* ============================================================
   警告提示
   ============================================================ */
.alert { padding: 9px 14px; border-radius: 6px; font-size: 12px; margin-bottom: 14px; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.alert-warning { background: #FFF8E1; color: #E65100; border: 1px solid #FFE0B2; }
.alert-danger  { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-info    { background: var(--blue-tint); color: var(--blue); border: 1px solid #BBDEFB; }

/* ============================================================
   Toast 通知（Apple HIG：右上角滑入，自动消失）
   ============================================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 32px);
}
.toast {
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.04);
  border: 0.55px solid rgba(0, 0, 0, 0.06);
  padding: 13px 14px 13px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  pointer-events: auto;
  min-width: 240px;
  line-height: 1.45;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  animation: toast-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.is-leaving {
  animation: toast-out 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes toast-in {
  from { transform: translateX(calc(100% + 24px)); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; max-height: 200px; margin-bottom: 0; }
  to   { transform: translateX(calc(100% + 24px)); opacity: 0; max-height: 0; margin-bottom: -10px; padding-top: 0; padding-bottom: 0; }
}
.toast-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff;
  margin-top: 1px;
}
.toast-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
.toast-success .toast-icon { background: #34C759; }
.toast-warning .toast-icon { background: #FF9500; }
.toast-danger  .toast-icon { background: #FF3B30; }
.toast-info    .toast-icon { background: var(--blue); }
.toast-msg {
  flex: 1;
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.4;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  margin-top: 1px;
  transition: opacity 0.15s, background 0.15s;
}
.toast-close:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.toast-close svg { width: 12px; height: 12px; }
@media (max-width: 480px) {
  .toast-container { top: 12px; right: 12px; left: 12px; width: auto; max-width: none; }
}

/* ============================================================
   弹窗
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.32); display: flex; align-items: center; justify-content: center; z-index: 999; padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.28s ease, visibility 0s linear 0.28s; }
.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.28s ease, visibility 0s linear 0s; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.12); width: 100%; max-width: 440px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: hidden; display: flex; flex-direction: column; margin: 40px auto; flex-shrink: 0; transform: scale(0.92); opacity: 0; transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-overlay.show .modal { transform: scale(1); opacity: 1; }
.modal-head { padding: 16px 20px; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.modal-body { padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; word-break: break-word; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.ks-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: #FFF9E6;
  border: 1px solid #FFE58A;
  border-radius: 8px;
  font-size: 12px;
  color: #7A5F00;
  line-height: 1.5;
  margin-bottom: 14px;
}
.ks-tip .icon { width: 14px; height: 14px; color: #E6A700; flex-shrink: 0; margin-top: 1px; }

/* 扫码弹窗 */
.ks-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ks-qr-img {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: block;
}
.ks-qr-status {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
}
.ks-qr-status.waiting { color: var(--muted); }
.ks-qr-status.scanned { color: var(--blue); font-weight: 600; }
.ks-qr-status.success { color: var(--green); font-weight: 600; }
.ks-qr-status.error { color: var(--c-danger, #FF3B30); font-weight: 600; }
.ks-qr-loading {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-bg);
}
.ks-saving-mask {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.ks-saving-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 24px 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ks-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ks-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes ks-spin { to { transform: rotate(360deg); } }

/* ============================================================
   进度条
   ============================================================ */
.progress-bar { height: 5px; background: var(--border-bg); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 3px; transition: width 0.3s; }

/* ============================================================
   任务相关
   ============================================================ */
.task-progress { margin-bottom: 10px; }
.task-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.task-status-done { color: var(--green); font-weight: 600; font-size: 11px; }
.task-status-pending { color: var(--blue); font-weight: 600; font-size: 11px; }

/* ============================================================
   登录页（前台登录也用侧栏单页布局）
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 32px 28px;
}
.auth-logo {
  width: 44px; height: 44px;
  background: var(--blue); color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  margin: 0 auto 16px;
}
.auth-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-sub { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 24px; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 12px; }
.auth-links a { color: var(--blue); }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 16px 32px;
  font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--border-soft);
}

/* ============================================================
   空状态
   ============================================================ */
.empty { color: var(--muted); text-align: center; padding: 32px 16px; font-size: 13px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  /* 侧边栏：抽屉式 + HIG 滑入动画 */
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.42s var(--hig-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
    padding-top: 0;
    border-right: 1px solid var(--border-soft);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 200;
    overflow: hidden;
    animation: none;
    touch-action: pan-y;          /* 禁止水平拖拽，只允许垂直滚动 */
    overscroll-behavior: contain;  /* 防止滚动链穿透到父元素 */
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  }
  /* 主区占满 */
  .main { margin-left: 0 !important; min-width: 0; padding-top: var(--topbar-h); }

  .content { padding: 20px 16px 40px; overflow-x: hidden; touch-action: pan-y; }

  /* 顶栏：固定顶部 + iOS 风格背景 */
  .topbar {
    padding: 0 16px;
    overflow-x: hidden;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 150;
    height: var(--topbar-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
  }
  .topbar.is-stuck {
    background: rgba(255,255,255,0.78);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: rgba(0,0,0,0.06);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  }

  /* 汉堡按钮 */
  .mobile-menu-btn {
    display: flex;
    transition: transform 0.4s var(--hig-ease, cubic-bezier(0.34, 1.56, 0.64, 1)),
                background 0.2s ease;
  }
  .mobile-menu-btn:hover { background: #F2F2F5; transform: scale(1.08); }
  .mobile-menu-btn:active { transform: scale(0.94); }
  .mobile-menu-btn.is-open { background: transparent; }
  .mobile-menu-btn.is-open svg { stroke: var(--blue); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .home-hero { padding: 16px 16px 14px; }
  .home-layout { grid-template-columns: 1fr; overflow: hidden; }
  .hero-title { font-size: 24px; }
  .h-page { font-size: 22px; }
  .input-group { flex-direction: column; }
  .input-group .input { max-width: 100% !important; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { overflow: hidden; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface);
  }
  .table-wrap tbody tr:last-child { border-bottom: none; }
  .table-wrap tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border: none;
    font-size: 13px;
  }
  .table-wrap tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    flex-shrink: 0;
  }
  .table-wrap .td-val { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .table-wrap .task-progress { width: 120px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-stack .row { grid-template-columns: 1fr; }
  .form-stack .row-label { display: none; }
  .modal { margin: 12px; }
  .card, .card-wide { overflow: hidden; }
  .sec { overflow: hidden; }
}

@media (max-width: 480px) {
  .content { padding: 16px 12px 40px; overflow-x: hidden; }
  .card, .card-wide { padding: 14px; overflow: hidden; }
  .h-section { font-size: 15px; }
}

/* ============================================================
   管理后台
   ============================================================ */
.admin-body { background: var(--bg); }

.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 — Apple HIG 风格 */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  border-right: 1px solid var(--border-soft);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 100;
  overflow: hidden;
  animation: sidebarEnter 0.55s var(--hig-ease-out) both;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
  flex-shrink: 0;
  transition: background 0.35s var(--hig-ease-out);
}
.admin-brand:hover { background: #F5F5F7; }
.admin-brand .logo {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.5s var(--hig-ease);
}
.admin-brand:hover .logo { transform: rotate(-8deg) scale(1.08); }
.admin-brand .logo svg { transition: transform 0.5s var(--hig-ease); }
.admin-brand:hover .logo svg { transform: rotate(8deg); }

.admin-nav {
  flex: 1;
  padding: 12px 12px 16px 22px;
  overflow-y: auto;
}
.admin-nav .nav-group { margin-bottom: 8px; }
.admin-nav .nav-group-label {
  font-size: 10px; font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase; letter-spacing: 1.4px;
  padding: 6px 12px 4px;
}

.admin-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 20px;
  margin: 3px 0;
  font-size: 13.5px;
  color: #5C5C60;
  text-decoration: none;
  border-radius: 8px;
  position: relative;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.25s var(--hig-ease-out),
              color 0.25s var(--hig-ease-out),
              transform 0.15s var(--hig-ease-out),
              padding-left 0.3s var(--hig-ease-out),
              margin 0.3s var(--hig-ease-out);
}
.admin-nav .nav-item::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 0;
  background: var(--blue);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.35s var(--hig-ease),
              top 0.35s var(--hig-ease),
              box-shadow 0.3s;
}
.admin-nav .nav-item .icon { transition: transform 0.4s var(--hig-ease), stroke 0.25s ease; }
.admin-nav .nav-item:hover .icon { transform: scale(1.18); }
/* admin 同样分设备的 active */
@media (hover: hover) {
  .admin-nav .nav-item:active { transform: scale(0.985); background: transparent !important; transition: transform 0.1s var(--hig-ease); }
}
@media (hover: none) {
  .admin-nav .nav-item:active { transform: scale(0.99); background: transparent !important; transition: transform 0.08s ease-out; }
}
.admin-nav .nav-item.active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding-left: 20px;
  margin: 4px 0;
}
.admin-nav .nav-item.active::before {
  height: 60%;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.08);
}
.admin-nav .nav-item.active .icon { stroke: var(--blue); transform: scale(1.08); }
/* admin 旧的:active 已被前面的 @media 块替代，此处不再重复 */

.admin-sidebar-foot {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg);
}

/* 主区 */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶栏 */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.admin-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.admin-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.3s var(--hig-ease-out);
}
.admin-user:hover { background: #F2F2F5; }

.admin-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--blue) 0%, #4DA3FF 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.4s var(--hig-ease);
}
.admin-user:hover .admin-avatar { transform: scale(1.08) rotate(-4deg); }

/* 内容区 */
.admin-content {
  padding: 28px 28px 48px;
  flex: 1;
  min-height: 0;
}

/* 后台底部版权 */
.admin-footer {
  padding: 16px 28px 24px;
  text-align: center;
  font-size: 12px;
  color: #86868B;
  border-top: 1px solid #E5E5EA;
}

/* 仪表盘特有 */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}
.metric-foot {
  font-size: 11px;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.panel-tight { padding: 16px 18px; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  margin-bottom: 10px;
}
.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 70px;
  width: 100%;
}
.bar {
  flex: 1;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.bar.gray { background: #D1D1D6; }
.bar-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
}
.legend-dot.b { background: #D1D1D6; }

/* 进度条 */
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.progress-name { color: var(--muted); width: 50px; flex-shrink: 0; }
.progress {
  flex: 1;
  height: 6px;
  background: var(--border-bg);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 3px;
  transition: width 0.4s;
  min-width: 0;
}
.progress-bar.b { background: #D1D1D6; }
.progress-val { color: var(--text); font-weight: 600; width: 40px; text-align: right; flex-shrink: 0; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFAFA; }

/* 警告 */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(52,199,89,0.1); color: #2A8E33; }
.alert-danger  { background: rgba(255,59,48,0.1); color: #C62828; }
.alert-warning { background: rgba(255,149,0,0.1); color: #C77800; }
.alert-info    { background: rgba(0,122,255,0.1); color: var(--blue); }

/* admin 响应式 — HIG 抽屉式 */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.42s var(--hig-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
    animation: none;
    touch-action: pan-y;          /* 禁止水平拖拽 */
    overscroll-behavior: contain;  /* 防止滚动链 */
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  }
  .admin-main { margin-left: 0 !important; padding-top: var(--topbar-h); }
  .admin-content { padding: 20px 16px 40px; overflow-x: hidden; touch-action: pan-y; }
  .dash-grid, .dash-grid-2, .dash-grid-3 { grid-template-columns: 1fr; }
  .admin-topbar {
    padding: 0 16px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 150;
    background: var(--bg);
    touch-action: pan-y;
  }
  .admin-topbar .admin-title { font-size: 14px; }
  .sidebar-overlay { z-index: 199; }
  /* 汉堡按钮的 active 状态 */
  .admin-topbar .mobile-menu-btn:hover { background: #F2F2F5; transform: scale(1.08); }
  .admin-topbar .mobile-menu-btn:active { transform: scale(0.94); }
  .admin-topbar .mobile-menu-btn.is-open { background: transparent; }
  .admin-topbar .mobile-menu-btn.is-open svg { stroke: var(--blue); }
}

/* ============================================================
   管理后台补充样式
   ============================================================ */

/* 工具栏按钮组 */
.toolbar-btns { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* 工具栏表单：用 flex 一行排开 */
.toolbar > form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.toolbar > form .input,
.toolbar > form .select,
.toolbar > form select.input {
  height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.toolbar > form .input { max-width: 240px; flex: 1; min-width: 140px; }
.toolbar > form .btn { flex-shrink: 0; }
.toolbar > form > .btn { height: 32px; padding: 0 14px; }

/* select 独立 class（admin 页面多用 class="select"） */
.select {
  width: auto;
  min-width: 120px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  height: 32px;
  flex-shrink: 0;
}
.select::-ms-expand { display: none; }
.select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* 主要徽章 */
.badge-primary { background: var(--blue); color: #fff; }
.badge-vip { background: rgba(52,199,89,0.12); color: #2A8E33; }
.badge-accent { background: rgba(0,122,255,0.1); color: var(--blue); }

/* 危险按钮 */
.btn-danger { background: #FF3B30; color: #fff; border-color: #FF3B30; }
.btn-danger:hover { background: #D70015; color: #fff; }

/* Switch 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 10px;
  transition: background 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* 弹窗标题 */
.modal-title {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

/* 表单行（两列） */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row .field { margin-bottom: 0; }
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* admin 内容区防溢出 */
.admin-content { overflow-x: hidden; }

/* admin 顶栏移动端菜单按钮 */
.admin-topbar .mobile-menu-btn { display: none; }
@media (max-width: 768px) {
  .admin-topbar .mobile-menu-btn { display: flex; }
}

/* admin 移动端工具栏 */
@media (max-width: 768px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar > form { width: 100%; }
  .toolbar > form .input,
  .toolbar > form .select,
  .toolbar > form select.input { max-width: 100%; flex: 1; min-width: 0; width: 100%; }
  .toolbar-btns { margin-left: 0; width: 100%; }
  .toolbar-btns .btn { flex: 1; }
}

/* ============================================================
   讨论区 Markdown 渲染
   ============================================================ */
.md-render { line-height: 1.75; font-size: 14px; }
.md-render h1, .md-render h2, .md-render h3,
.md-render h4, .md-render h5, .md-render h6 {
  font-weight: 600; margin: 1em 0 0.4em; line-height: 1.4;
}
.md-render h1 { font-size: 1.5em; }
.md-render h2 { font-size: 1.25em; }
.md-render h3 { font-size: 1.1em; }
.md-render p { margin: 0.5em 0; }
.md-render img {
  max-width: 100%; border-radius: 6px;
  margin: 10px 0; display: block;
  cursor: zoom-in;
}
.md-render a { color: var(--blue); }
.md-render a:hover { opacity: 0.8; }
.md-render strong { font-weight: 600; }
.md-render em { font-style: italic; }
.md-render del { text-decoration: line-through; color: var(--muted); }
.md-render code {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.88em;
  background: var(--border-bg);
  padding: 1px 5px; border-radius: 4px;
  word-break: break-all;
}
.md-render pre {
  background: var(--border-bg);
  border-radius: 8px; padding: 14px 16px;
  overflow-x: auto; font-size: 12px;
  font-family: "SF Mono", Consolas, monospace;
  margin: 10px 0; line-height: 1.6;
  border: 1px solid var(--border-soft);
}
.md-render pre code { background: none; padding: 0; font-size: 12px; }
.md-render blockquote {
  border-left: 3px solid var(--blue);
  padding: 4px 12px; margin: 8px 0;
  color: var(--muted); background: var(--blue-tint);
  border-radius: 0 4px 4px 0;
}
.md-render ul, .md-render ol {
  padding-left: 22px; margin: 6px 0;
}
.md-render li { margin: 3px 0; }
.md-render hr {
  border: none; border-top: 1px solid var(--border-soft);
  margin: 16px 0;
}
.md-render table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin: 10px 0;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-soft);
}
.md-render th, .md-render td {
  border: 1px solid var(--border-soft);
  padding: 7px 12px; text-align: left;
}
.md-render th { background: var(--border-bg); font-weight: 600; }
.md-render tr:nth-child(even) td { background: rgba(0,0,0,0.015); }

/* ============================================================
   讨论区通用
   ============================================================ */
.form-hint { padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.form-hint.ok { background: rgba(52,199,89,0.1); color: #2A8E33; border: 1px solid rgba(52,199,89,0.2); }
.form-hint.error { background: rgba(255,59,48,0.08); color: #FF3B30; border: 1px solid rgba(255,59,48,0.15); }

/* ============================================================
   VIP 拦截横幅（非会员访问任务页时显示）
   ============================================================ */
.vip-blocked-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; margin-bottom: 18px;
  background: linear-gradient(135deg, #FFF8E6 0%, #FFFCF0 100%);
  border: 1px solid #F2D88C; border-radius: 12px;
  color: #8B6914;
}
.vip-blocked-banner .vip-icon {
  flex-shrink: 0; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FFD43B 0%, #FFA500 100%);
  color: #fff; border-radius: 10px;
}
.vip-blocked-banner .vip-icon svg { width: 20px; height: 20px; }
.vip-blocked-banner .vip-text { flex: 1; min-width: 0; }
.vip-blocked-banner .vip-title { font-size: 14px; font-weight: 600; color: #6B4F0A; }
.vip-blocked-banner .vip-sub { font-size: 12px; color: #A37F2A; margin-top: 2px; }
.vip-blocked-banner .vip-cta {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  height: 36px; padding: 0 16px;
  background: linear-gradient(135deg, #FFB800 0%, #FF8C00 100%);
  color: #fff; font-size: 13px; font-weight: 600;
  border-radius: 8px; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.vip-blocked-banner .vip-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,184,0,0.35);
}
