/* ============================================================
   theme-dark.css  —  深色主题（默认）
   导航书签网站通用主题，供 index.html / viewer.html / generator.html 引用
   ============================================================ */

:root {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface2:     #263048;
  --border:       #334155;
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --accent:       #6366f1;
  --accent-hover: #818cf8;
  --green:        #10b981;
  --red:          #ef4444;
  --yellow:       #f59e0b;
  --card-shadow:  0 4px 24px rgba(0,0,0,.45);
  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    6px;

  /* 头部渐变 */
  --header-bg:    linear-gradient(135deg,#1e293b 0%,#0f172a 100%);
  /* 标题渐变文字 */
  --title-grad:   linear-gradient(90deg,#e2e8f0,#a5b4fc);
  /* logo 渐变 */
  --logo-grad:    linear-gradient(135deg,#6366f1,#8b5cf6);
}

/* ── 基础重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── 通用按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: .85rem; cursor: pointer;
  text-decoration: none; transition: all .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; background: #303e5c; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #059669; border-color: #059669; }
.btn.danger  { background: var(--red);   border-color: var(--red);   color: #fff; }
.btn.danger:hover  { background: #dc2626; border-color: #dc2626; }
.btn.sm { padding: 5px 11px; font-size: .78rem; }
.btn.lg { padding: 12px 28px; font-size: .95rem; }

/* ── 通用 Header ── */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; height: 72px;
}
.site-logo {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--logo-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; text-decoration: none;
  transition: opacity .2s;
}
.site-logo:hover { opacity: .85; }
.site-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.site-title {
  font-size: 1.3rem; font-weight: 700; flex: 1;
  background: var(--title-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.search-bar {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; gap: 8px; width: 260px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: .9rem; width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ── 通用 Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px; text-align: center;
}
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 5px; }
.footer-contact  { font-size: .875rem; color: var(--text-muted); }
.footer-copyright{ font-size: .8rem; color: #475569; }

/* ── 分组标签 ── */
.group-tabs {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  position: sticky; top: 72px; z-index: 50;
  background: var(--bg);
}
.group-tab {
  padding: 7px 20px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: .85rem; cursor: pointer;
  transition: all .2s;
}
.group-tab:hover { border-color: var(--accent); color: var(--text); }
.group-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── 分组区块 ── */
.group-section { margin-bottom: 48px; }
.group-section.hidden { display: none; }
.group-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.group-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.group-name  { font-size: 1.05rem; font-weight: 600; }
.group-count { font-size: .75rem; color: var(--text-muted); background: var(--surface2); border-radius: 999px; padding: 2px 10px; }
.group-line  { flex: 1; height: 1px; background: var(--border); }

/* ── 卡片网格 ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 18px; }

/* ── 书签卡片 ── */
.bookmark-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  position: relative; transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
}
.bookmark-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow); border-color: var(--accent); }
.bookmark-card.filtered-out { display: none; }
.card-stripe { height: 4px; width: 100%; }
.card-body   { padding: 18px 18px 14px; }
.card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--surface2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; overflow: hidden;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.card-title { font-size: .95rem; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc  { font-size: .82rem; color: var(--text-muted); line-height: 1.5; min-height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-qr-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.card-url { font-size: .72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.qr-btn {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; transition: all .2s;
  position: relative; z-index: 3;
}
.qr-btn:hover { border-color: var(--accent); background: var(--surface); }
.card-link { position: absolute; inset: 0; z-index: 2; }

/* ── 二维码模态框 ── */
.qr-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 999; align-items: center; justify-content: center; }
.qr-modal.open { display: flex; }
.qr-modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; max-width: 340px; width: 90%; text-align: center; }
.qr-modal-box h3 { font-size: 1rem; margin-bottom: 4px; }
.qr-modal-box canvas { border-radius: 8px; margin: 16px auto; display: block; }
.qr-modal-url { font-size: .78rem; color: var(--text-muted); word-break: break-all; margin-bottom: 16px; }
.qr-modal-foot { display: flex; gap: 10px; justify-content: center; }

/* ── 主题切换按钮 ── */
.theme-switcher { display: flex; align-items: center; gap: 6px; }
.theme-opt {
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: .78rem; cursor: pointer; transition: all .15s;
}
.theme-opt.active, .theme-opt:hover { border-color: var(--accent); color: #fff; background: var(--accent); }
