/* ============================
   群号表 · 渐变 + 卡片化
   ============================ */
:root {
  --bg: #f6f7fb;
  --bg-tint: #fef3ec;       /* 顶部暖色 */
  --border: #e5e7eb;        /* 通用描边色(修复前不存在) */
  --card: #ffffff;
  --ink: #1a1d24;
  --ink-soft: #5b6068;
  --ink-mute: #9aa0a6;
  --line: #ecedf1;
  --line-strong: #d8dade;
  --coin: #f59e0b;          /* 币圈 - 琥珀 */
  --coin-soft: #fef3c7;
  --coin-deep: #d97706;
  --stock: #10b981;         /* 美股 - 翡翠 */
  --stock-soft: #d1fae5;
  --stock-deep: #047857;
  --primary: var(--coin);
  --primary-deep: var(--coin-deep);
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.18);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---------- 背景渐变 blob ---------- */
.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}
.blob-1 {
  width: 420px; height: 420px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, #fbbf24, transparent 70%);
}
.blob-2 {
  width: 380px; height: 380px;
  top: -100px; right: -140px;
  background: radial-gradient(circle, #34d399, transparent 70%);
}

/* ---------- 容器 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

/* ---------- 顶部 hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 4px 18px;
}
.hero-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--coin), var(--stock));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
  letter-spacing: 1px;
}
.hero-text { flex: 1; }
.hero-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hero-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-mute);
}
.hero-add {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--coin), var(--coin-deep));
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  transition: transform .15s, box-shadow .15s;
}
.hero-add:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 10px 26px rgba(245, 158, 11, 0.55); }

/* 顶部右侧 actions 容器 */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 冷风 站点标识按钮(看起来像 logo / 水印) */
.brand-mark-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-mute);
  font-weight: 400;
  transition: color 0.18s;
  user-select: none;
  letter-spacing: 0.02em;
}
.brand-mark-btn:hover { color: var(--ink-soft); }
.brand-mark-btn .brand-icon {
  font-size: 14px;
  color: var(--primary);
  opacity: 0.85;
  font-weight: 600;
}
.brand-mark-btn .brand-label {
  font-size: 13px;
  font-weight: 500;
}
/* 已登录时颜色微妙变深,但仍像 logo */
.brand-mark-btn[data-state="unlocked"] {
  color: var(--ink-soft);
}
.brand-mark-btn[data-state="unlocked"] .brand-icon {
  color: #10b981;
}

/* 冷风登录弹窗 */
.admin-title {
  font-size: 18px;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-desc {
  font-size: 12.5px;
  color: var(--ink-mute);
  margin: 0 0 14px 0;
  line-height: 1.5;
}
.hero-add:active { transform: scale(0.94); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 5px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.tab {
  flex: 1;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.tab:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.tab-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.tab-dot-coin { background: var(--coin); box-shadow: 0 0 0 3px var(--coin-soft); }
.tab-dot-stock { background: var(--stock); box-shadow: 0 0 0 3px var(--stock-soft); }
.tab-count {
  background: rgba(0,0,0,0.06);
  color: var(--ink-mute);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.tab.active .tab-count { background: var(--bg); color: var(--ink-soft); }

/* ---------- 搜索 ---------- */
.search-row {
  position: relative;
  margin-bottom: 14px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.55;
}
#search {
  width: 100%;
  padding: 11px 38px 11px 38px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
#search:focus {
  border-color: var(--coin);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: none;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search-clear:hover { background: rgba(0,0,0,0.15); color: var(--ink); }

/* ---------- 列表卡片 ---------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  animation: cardIn .25s ease;
}
@keyframes cardIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card.cat-coin { border-left: 3px solid var(--coin); }
.card.cat-stock { border-left: 3px solid var(--stock); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--surface-2, #f6f7f9);
  display: block;
  object-fit: cover;
}
.card-body { flex: 1; min-width: 0; }
.card-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
}
.card-meta strong { color: var(--ink-soft); font-weight: 600; }
.card-meta .full { color: #ef4444; font-weight: 600; }
.qq-hint {
  margin-top: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2, #f6f7f9);
  color: var(--ink-soft);
  border-left: 3px solid var(--border);
}
.qq-hint.ok { border-left-color: #10b981; color: #065f46; background: #ecfdf5; }
.qq-hint.err { border-left-color: #ef4444; color: #991b1b; background: #fef2f2; }
.qq-hint.loading { border-left-color: var(--primary, #f59e0b); }
.card-name {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.4;
}
.card-num {
  margin: 8px 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow-x: auto;
}
.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-family: inherit;
  display: inline-flex;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn.danger:hover {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}
.icon-btn.copy:hover {
  background: var(--coin-soft);
  color: var(--coin-deep);
  border-color: #fde68a;
}
.icon-btn.join {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.icon-btn.join:hover {
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}
.icon-btn.join:active { transform: scale(0.96); }

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: 56px 20px 40px;
}
.empty-illu {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.empty-illu span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
  animation: dotPulse 1.4s infinite ease-in-out;
}
.empty-illu span:nth-child(1) { animation-delay: 0s; }
.empty-illu span:nth-child(2) { animation-delay: 0.15s; }
.empty-illu span:nth-child(3) { animation-delay: 0.3s; }
.empty-illu span:nth-child(4) { animation-delay: 0.45s; }
@keyframes dotPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.5; background: var(--line-strong); }
  50% { transform: scale(1.2); opacity: 1; background: var(--coin); }
}
.empty-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.empty-tip {
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}

/* ---------- 底部 ---------- */
.foot {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 5;
  background: rgba(246, 247, 251, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0) + 10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-mute);
}
.foot b { color: var(--ink); font-weight: 600; }
.foot-actions { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--bg); color: var(--ink); }
.chip-danger { color: var(--danger); border-color: #fecaca; }
.chip-danger:hover { background: #fef2f2; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 500;
}
.hint-inline {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
  margin-left: 4px;
  font-style: normal;
}
.hint-block {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 4px;
}
.btn-sm { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.link-input-row { display: flex; gap: 6px; align-items: stretch; }
.link-input-row input { flex: 1; min-width: 0; }

/* 类型 pill 选择器 */
.type-pills {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.type-pill {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  background: #fff;
  user-select: none;
  transition: all 0.15s;
}
.type-pill input { display: none; }
.type-pill:hover { border-color: var(--primary); color: var(--ink); }
.type-pill:has(input:checked) {
  background: linear-gradient(135deg, var(--primary-soft, #fff7ed), #fff);
  border-color: var(--primary);
  color: var(--primary-deep);
  font-weight: 600;
}

/* 卡片头部 type badge */
.type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.type-badge.type-qq {
  background: #bbf7d0;
  color: #065f46;
}
.type-badge.type-tg {
  background: #bfdbfe;
  color: #1e3a8a;
}
.type-badge.type-other {
  background: #f3f4f6;
  color: #6b7280;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-name {
  flex: 1;
  min-width: 0;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--coin);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.err {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 8px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.btn-primary, .btn-ghost, .btn-danger-solid {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s, background .15s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--coin), var(--coin-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45); }
.btn-primary:active { transform: scale(0.96); }
.btn-ghost {
  background: #f3f4f6;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: #e5e7eb; color: var(--ink); }
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn-danger-solid:hover { background: #dc2626; }
.btn-danger-solid:active { transform: scale(0.96); }

.confirm-msg { margin: 0 0 4px; color: var(--ink-soft); line-height: 1.55; }
.hint { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }
#importText {
  width: 100%;
  padding: 10px 12px;
  font-size: 12.5px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  resize: vertical;
  outline: none;
}
#importText:focus {
  border-color: var(--coin);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: toastIn .25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
@keyframes toastIn {
  from { transform: translate(-50%, calc(-50% + 10px)); opacity: 0; }
  to   { transform: translate(-50%, -50%); opacity: 1; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  .wrap { padding: 18px 14px 100px; }
  .hero-text h1 { font-size: 20px; }
  .hero-mark { width: 40px; height: 40px; font-size: 16px; }
  .hero-add { width: 40px; height: 40px; font-size: 22px; }
  .tab { padding: 8px 10px; font-size: 13px; gap: 6px; }
  .card { padding: 12px 12px 10px; }
  .card-name { font-size: 14.5px; }
  .card-num { font-size: 13px; }
  .icon-btn { padding: 5px 8px; font-size: 12px; }
  /* 移动端 footer:左信息下沉一行,chips 留白更足 */
  .foot {
    padding: 10px 14px calc(env(safe-area-inset-bottom, 0) + 10px);
    font-size: 11.5px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .foot > span { flex: 1 1 100%; text-align: center; order: 2; }
  .foot-actions { order: 1; width: 100%; justify-content: center; }
  .chip { padding: 6px 12px; font-size: 12px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-tint: #1a1d24;
    --card: #1a1d24;
    --ink: #e6e8eb;
    --ink-soft: #a4a8b0;
    --ink-mute: #6b7077;
    --line: #2a2d35;
    --line-strong: #3a3e48;
    --coin-soft: #422a0d;
    --stock-soft: #08332a;
  }
  body { color-scheme: dark; }
  .tabs, .foot { background: rgba(26, 29, 36, 0.7); }
  .icon-btn, #search, .chip, .field input, #importText { background: #0f1115; border-color: var(--line); color: var(--ink); }
  .icon-btn:hover { background: #2a2d35; }
  .tab.active { background: #2a2d35; }
  .card-num { color: var(--ink-soft); }
  .empty-illu span { background: var(--line-strong); }
}

/* 强制:hidden 属性 必须 display:none(覆盖上面的 inline-flex) */
.icon-btn[hidden] { display: none !important; }
.hero-add[hidden] { display: none !important; }
