/* ==================== Design Tokens ==================== */
:root {
  /* 主色调：紫罗兰渐变 */
  --c-primary: #7c3aed;
  --c-primary-light: #a78bfa;
  --c-primary-dark: #5b21b6;
  --c-accent: #ec4899;

  /* 玻璃态 */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-bg-inset: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
  --glass-shadow-lg: 0 16px 48px rgba(31, 38, 135, 0.18);

  /* 文本 */
  --c-text: #1e1b4b;
  --c-text-soft: #475569;
  --c-text-muted: #94a3b8;

  /* 表面 */
  --c-bg: #f5f3ff;
  --c-surface: #ffffff;
  --c-line: rgba(124, 58, 237, 0.08);
  --c-line-soft: rgba(124, 58, 237, 0.04);

  /* 语义色 */
  --c-success: #10b981;
  --c-warn: #f59e0b;
  --c-danger: #ef4444;

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* 字体 */
  --f-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 动画 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==================== Reset ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ==================== Background ==================== */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 50%, #dbeafe 100%);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: #c4b5fd; top: -100px; left: -100px; }
.orb-2 { width: 350px; height: 350px; background: #f9a8d4; top: 30%; right: -80px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: #93c5fd; bottom: -50px; left: 30%; animation-delay: -14s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ==================== Page ==================== */
.page { min-height: 100vh; }
.page-auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px 16px;
}
.page-main {
  padding: 0;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ==================== Glass Card ==================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 14px;
  animation: cardIn 0.4s var(--ease-spring);
}
.glass-inset {
  background: var(--glass-bg-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ==================== Auth ==================== */
.auth-shell { width: 100%; max-width: 420px; }
.brand { text-align: center; margin-bottom: 28px; animation: cardIn 0.5s var(--ease-spring); }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 24px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; margin-bottom: 16px;
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.35);
}
.brand-logo svg { width: 36px; height: 36px; }
.brand-title { font-size: 26px; font-weight: 700; color: var(--c-text); margin-bottom: 6px; letter-spacing: -0.02em; }
.brand-sub { font-size: 14px; color: var(--c-text-soft); }

.auth-card { animation-delay: 0.1s; }

/* ==================== Segmented Control ==================== */
.segmented {
  display: flex; background: var(--glass-bg-inset);
  border-radius: var(--r-md); padding: 4px;
  margin-bottom: 20px; gap: 2px;
}
.segmented-sm { margin-bottom: 16px; }
.seg {
  flex: 1; padding: 10px 12px; border: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--c-text-soft);
  border-radius: 10px; transition: all 0.2s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented-sm .seg { padding: 8px 10px; font-size: 13px; }
.seg.active {
  background: var(--c-surface);
  color: var(--c-primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
  font-weight: 600;
}
.seg-icon { width: 16px; height: 16px; }
/* radio 风格的 segmented（用于群组隐私选择）：每个 label 是一段，内部是隐藏的 radio + 文本 */
.seg-radio { flex: 1; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; font-size: 13px; font-weight: 500;
  color: var(--c-text-soft); border-radius: 10px;
  transition: all 0.2s var(--ease);
  border: 1px solid transparent;
}
.seg-radio input:checked + span {
  background: var(--c-surface); color: var(--c-primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
  font-weight: 600;
  border-color: rgba(124, 58, 237, 0.25);
}
.seg-radio:hover span { color: var(--c-primary); }
.field-hint {
  display: block; margin-top: 6px;
  font-size: 11px; color: var(--c-text-muted); line-height: 1.4;
}
/* 群组卡片的"私有"徽标（与未读/已提醒等 tag 风格一致） */
.tag-private {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b; border-color: rgba(239, 68, 68, 0.3);
}
/* 邀请码显示框 */
.invite-code-box {
  background: var(--glass-bg-inset);
  border: 1px dashed rgba(124, 58, 237, 0.4);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px; word-break: break-all;
  color: var(--c-primary);
}

/* ==================== Form ==================== */
.form { display: flex; flex-direction: column; gap: 4px; }
.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block; font-size: 13px; font-weight: 500; color: var(--c-text-soft); margin-bottom: 6px;
}
.field-label small { color: var(--c-text-muted); font-weight: 400; margin-left: 4px; }
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 12px; width: 18px; height: 18px;
  color: var(--c-text-muted); pointer-events: none;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="datetime-local"], input:not([type]), textarea, select.input {
  width: 100%; padding: 12px 14px;
  font-size: 15px; color: var(--c-text);
  background: var(--glass-bg-inset);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-md); transition: all 0.2s var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
input::placeholder, textarea::placeholder { color: var(--c-text-muted); }

/* 必须在通用 input[type=*] 规则之后：否则 padding-left:40px 会被覆盖成 14px，图标与文字重叠 */
.input-wrap input {
  width: 100%; padding: 12px 14px 12px 40px;
  font-size: 15px; color: var(--c-text);
  background: var(--glass-bg-inset);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-md); transition: all 0.2s var(--ease);
}
.input-wrap input:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
.input-wrap input::placeholder { color: var(--c-text-muted); }
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.input-datetime {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.2s var(--ease); position: relative; overflow: hidden;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45); transform: translateY(-1px); }
.btn-ghost {
  background: var(--glass-bg-inset);
  color: var(--c-text-soft);
  border: 1px solid var(--glass-border);
}
.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.btn { white-space: nowrap; }   /* 全局兜底：按钮文字不换行（防止"理"被单独换行） */

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--c-text-soft); transition: all 0.2s var(--ease);
}
.btn-icon:hover { background: var(--c-surface); color: var(--c-primary); }
.btn-icon svg { width: 20px; height: 20px; }

.btn-fab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  transition: all 0.2s var(--ease);
}
.btn-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.5); }
.btn-fab:active { transform: scale(0.95); }
.btn-fab svg { width: 24px; height: 24px; }

.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--c-text-soft); font-size: 13px; margin-bottom: 16px;
  transition: color 0.2s;
}
.btn-back:hover { color: var(--c-primary); }
.btn-back svg { width: 16px; height: 16px; }

.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 80px; }

/* ==================== Form Error ==================== */
.form-error {
  color: var(--c-danger); font-size: 13px; min-height: 18px; margin-top: 8px;
  display: flex; align-items: center; gap: 4px;
}
.form-error:not(:empty)::before { content: "⚠"; }

/* ==================== Toggle Switch ==================== */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; cursor: pointer;
  border-top: 1px solid var(--c-line-soft);
}
.toggle-row:first-of-type { border-top: none; }
.toggle-label { font-weight: 500; font-size: 14px; color: var(--c-text); }
.toggle-hint { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; transition: 0.3s; border-radius: var(--r-full);
}
.switch-slider::before {
  position: absolute; content: ""; height: 22px; width: 22px;
  left: 3px; bottom: 3px; background: white;
  transition: 0.3s var(--ease-spring); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
}
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ==================== Topbar ==================== */
.topbar {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--c-line);
  padding-top: calc(14px + env(safe-area-inset-top));
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.topbar-icon svg { width: 22px; height: 22px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.topbar-sub { font-size: 12px; color: var(--c-text-muted); }

/* ==================== Content & Panels ==================== */
.content { padding: 20px 16px; max-width: 640px; margin: 0 auto; }
.tab-panel { animation: fadeIn 0.3s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
.page-header-center { flex: 1; text-align: center; }
.page-title {
  font-size: 28px; font-weight: 800; color: var(--c-text);
  letter-spacing: -0.02em; line-height: 1.2;
}
.page-title-sm { font-size: 17px; font-weight: 700; color: var(--c-text); }
.page-sub { font-size: 13px; color: var(--c-text-muted); margin-top: 2px; }

/* ==================== Card Headers ==================== */
.card-h {
  font-size: 16px; font-weight: 700; color: var(--c-text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

/* ==================== Avatar ==================== */
.avatar {
  width: 32px; height: 32px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* ==================== Memo Grid / List ==================== */
.memo-grid, .memo-list, .group-list { display: flex; flex-direction: column; gap: 12px; }

.memo-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(31, 38, 135, 0.04);
  position: relative;
  overflow: hidden;
}
.memo-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
  border-radius: 4px 0 0 4px;
  opacity: 0.8;
}
.memo-card:active { transform: scale(0.98); }
.memo-card.unread { background: linear-gradient(135deg, rgba(254, 243, 199, 0.85), rgba(253, 230, 138, 0.85)); }
.memo-card:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-lg); }

.memo-card-head {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
}
.memo-card-title {
  flex: 1; font-size: 15px; font-weight: 700; color: var(--c-text);
  line-height: 1.4; word-break: break-word;
}
/* 卡片右上角删除按钮（hover 才显示，触屏始终可见） */
.memo-card-delete {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(239, 68, 68, 0.12); color: #dc2626;
  border: none; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s var(--ease), background 0.2s;
  z-index: 2;
}
.memo-card:hover .memo-card-delete,
.memo-card-delete:focus { opacity: 1; }
.memo-card-delete:hover { background: rgba(239, 68, 68, 0.25); }
/* 触屏无 hover：长显示 */
@media (hover: none) { .memo-card-delete { opacity: 0.7; } }
/* 批量模式下：checkbox 一直可见、删除按钮隐藏（避免冲突） */
body.batch-mode .memo-card-delete { display: none; }
.memo-card-checkbox {
  position: absolute; top: 12px; left: 12px;
  width: 22px; height: 22px; z-index: 2;
  accent-color: var(--c-primary);
  display: none;
}
body.batch-mode .memo-card-checkbox { display: block; }
body.batch-mode .memo-card { padding-left: 42px; }
body.batch-mode .memo-card.selected { background: linear-gradient(135deg, rgba(124, 58, 237, 0.10), rgba(236, 72, 153, 0.10)); border-color: rgba(124, 58, 237, 0.4); }
body.batch-mode .memo-card { cursor: default; }
body.batch-mode .memo-card:active { transform: none; }
/* 底部悬浮操作条 */
#inbox-batch-bar, #memos-batch-bar {
  position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 460px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.18);
  padding: 12px; z-index: 50;
  animation: batchBarUp 0.2s var(--ease);
}
@keyframes batchBarUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.batch-bar-inner { display: flex; align-items: center; gap: 10px; }
.batch-check { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--c-text-soft); }
.batch-check input { accent-color: var(--c-primary); width: 18px; height: 18px; }
#inbox-batch-bar .btn-danger, #memos-batch-bar .btn-danger { margin-left: auto; }
.memo-card-preview {
  font-size: 13px; color: var(--c-text-soft); line-height: 1.5;
  margin: 8px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.memo-card-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--c-text-muted);
}
.memo-card-author { display: flex; align-items: center; gap: 6px; }

.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600;
  background: var(--glass-bg-inset); color: var(--c-text-soft);
  border: 1px solid var(--glass-border);
}
.tag-time { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: rgba(245, 158, 11, 0.3); }
.tag-mine { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; border-color: rgba(16, 185, 129, 0.3); }
.tag-unread { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #78350f; border-color: rgba(245, 158, 11, 0.3); }
/* 定时未触发：青色调，"等待中"，与已发到的 amber/unread 区分 */
.tag-pending { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #155e75; border-color: rgba(6, 182, 212, 0.3); }
/* 定时已触发：和 .tag-time 区分的浅紫，调子是"已完成的动作" */
.tag-dispatched { background: linear-gradient(135deg, #e9d5ff, #d8b4fe); color: #6b21a8; border-color: rgba(168, 85, 247, 0.3); }
/* 循环提醒：暖橙色，与"待触发/已触发"区分清楚表示"会自动再次触发" */
.tag-recurrence { background: linear-gradient(135deg, #fed7aa, #fdba74); color: #9a3412; border-color: rgba(251, 146, 60, 0.35); }

/* 通用下拉（循环频率选择器） */
.input-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  color: var(--c-text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  margin-top: 8px;
}
.input-select:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; }

/* ==================== Memo Detail ==================== */
.memo-detail-title {
  font-size: 22px; font-weight: 800; color: var(--c-text);
  letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 14px;
}
.memo-detail-author {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--c-line);
}
.memo-detail-author-name { font-size: 14px; font-weight: 600; color: var(--c-text); }
.memo-detail-time { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.memo-detail-content {
  font-size: 15px; line-height: 1.7; color: var(--c-text);
  white-space: pre-wrap; word-break: break-word;
  background: var(--glass-bg-inset);
  padding: 16px; border-radius: var(--r-md);
  margin-bottom: 16px;
}
.memo-detail-sub { font-size: 13px; color: var(--c-text-soft); margin-bottom: 14px; }
.memo-detail-recipients {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.recipient-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-full);
  background: var(--glass-bg-inset);
  font-size: 12px; color: var(--c-text-soft);
  border: 1px solid var(--glass-border);
}

/* ==================== Group ==================== */
.group-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(31, 38, 135, 0.04);
  display: flex; align-items: center; gap: 14px;
}
.group-card:active { transform: scale(0.98); }
.group-card:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-lg); }
.group-card-info { flex: 1; min-width: 0; }
.group-card-name {
  font-size: 15px; font-weight: 700; color: var(--c-text); margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
}
.group-card-desc { font-size: 12px; color: var(--c-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card-meta { font-size: 11px; color: var(--c-text-muted); display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.member-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; font-size: 14px;
  border-bottom: 1px solid var(--c-line-soft);
}
.member-row:last-child { border-bottom: none; }
.member-row .avatar { width: 32px; height: 32px; font-size: 12px; }
.member-name { flex: 1; font-weight: 500; color: var(--c-text); }

/* ==================== Recipients ==================== */
.recipient-box {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 260px; overflow-y: auto;
  margin-top: 6px;
}
.recipient-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; font-size: 14px; cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.15s;
}
.recipient-row:hover { background: rgba(124, 58, 237, 0.05); }
.recipient-row input { width: 18px; height: 18px; accent-color: var(--c-primary); cursor: pointer; }
.recipient-row.recipient-all {
  border-bottom: 1px dashed var(--c-line); padding-bottom: 10px; margin-bottom: 4px;
}
.recipient-avatar {
  width: 32px; height: 32px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-primary));
  font-size: 14px; flex-shrink: 0;
}
.avatar-all { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.recipient-name { flex: 1; font-weight: 500; color: var(--c-text); }

/* ==================== Profile ==================== */
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-name { font-size: 16px; font-weight: 700; color: var(--c-text); }
.profile-sub { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }

/* ==================== Empty State ==================== */
.empty {
  text-align: center; padding: 48px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px dashed var(--c-line);
  border-radius: var(--r-lg);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-text { font-size: 14px; color: var(--c-text-muted); }

/* ==================== Bottom Nav ==================== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex; border-top: 1px solid var(--c-line);
  z-index: 20; padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; padding: 10px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--c-text-muted); transition: color 0.2s var(--ease);
  position: relative;
}
.nav-item.active { color: var(--c-primary); }
.nav-item.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 0 0 3px 3px;
}
.nav-icon { width: 22px; height: 22px; }
.nav-label { font-size: 11px; font-weight: 500; }
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff; border-radius: var(--r-full);
  padding: 0 6px; font-size: 10px; min-width: 18px; text-align: center;
  line-height: 18px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* ==================== Toast ==================== */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: rgba(30, 27, 75, 0.95);
  color: #fff; padding: 12px 20px;
  border-radius: var(--r-full); font-size: 14px; font-weight: 500;
  z-index: 100; max-width: 90vw; text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.3s var(--ease-spring);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

[hidden] { display: none !important; }

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.25); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== Channel Section (Settings) ==================== */
.channel-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--c-line-soft);
}
.channel-section:last-of-type { border-bottom: none; }
.channel-section:first-of-type { padding-top: 0; }
.channel-head {
  display: flex; align-items: center; gap: 12px;
}
.channel-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--glass-bg-inset);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.channel-title { font-weight: 600; font-size: 14px; color: var(--c-text); }
.channel-hint { font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.channel-section .field { margin: 0; }
.channel-tip {
  display: flex; gap: 12px; margin-top: 8px;
  font-size: 12px;
}
.channel-tip a {
  color: var(--c-primary); text-decoration: none;
  padding: 2px 8px; background: var(--glass-bg-inset);
  border-radius: var(--r-full); transition: all 0.2s;
}
.channel-tip a:hover { background: var(--c-primary); color: #fff; }

/* 输入框 + 边按钮组合（用于微信 Key 的显示/隐藏） */
.input-with-btn {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
}
.input-with-btn input {
  flex: 1;
  margin: 0;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  letter-spacing: 0.5px;
}
.btn-eye {
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--glass-bg-inset);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
  color: var(--c-text);
}
.btn-eye:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-eye.is-shown { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* 不可用渠道（SMS 等暂时关闭的功能） */
.channel-section.is-disabled {
  opacity: 0.55;
  pointer-events: none;       /* 拦截点击 / hover，但保留视觉占位 */
  filter: saturate(0.4);      /* 进一步去色，强化"不可用"观感 */
}
.badge-disabled {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.15);   /* 琥珀色，与 muted 区分 */
  color: #d97706;
  vertical-align: 1px;
}

/* ==================== Mobile Refinements ==================== */
@media (max-width: 380px) {
  .page-title { font-size: 24px; }
  .brand-title { font-size: 22px; }
  .glass-card { padding: 16px; }
}
