/* 小敏笔记 - 极简专业财经风 UI */
:root, [data-theme="classic"] {
  --bg: #f8f9fb;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-muted: #64748b;
  --primary: #1e3a5f;
  --primary-light: #2d5a8e;
  --accent: #c9a227;
  --accent-soft: rgba(201,162,39,0.12);
  --border: #e2e8f0;
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 10px;
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Noto Serif SC', Georgia, serif;
  --layout-container-max: 1200px;
  --layout-padding-x: 20px;
  --layout-main-py: 32px;
  --layout-hero-py: 48px;
  --layout-hero-logo-h: 140px;
  --layout-header-logo-h: 44px;
  --layout-header-h: 64px;
  --layout-section-gap: 48px;
  --layout-grid-gap: 20px;
  --layout-card-padding: 24px;
  --layout-card-radius: 10px;
  --layout-font-base: 16px;
  --layout-line-height: 1.6;
  --layout-section-title: 1.4rem;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --text: #e8ecf1;
  --text-muted: #94a3b8;
  --primary: #60a5fa;
  --primary-light: #93c5fd;
  --accent: #fbbf24;
  --accent-soft: rgba(251,191,36,0.15);
  --border: #2d3748;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="minimal"] {
  --bg: #fefefe;
  --bg-card: #fefefe;
  --text: #111827;
  --text-muted: #9ca3af;
  --primary: #374151;
  --primary-light: #4b5563;
  --accent: #6b7280;
  --accent-soft: rgba(107,114,128,0.08);
  --border: #f3f4f6;
  --shadow: none;
  --radius: 4px;
}

/* 好运来模块：喜庆红调，与全站风格协调 */
body.theme-community {
  --primary: #991b1b;
  --primary-light: #b91c1c;
  --accent: #dc2626;
  --accent-soft: rgba(220, 38, 38, 0.12);
  --border: #fecaca;
}
body.theme-community .site-header {
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
  border-bottom-color: #fecaca;
}
body.theme-community .logo,
body.theme-community .logo-link {
  color: var(--primary);
}
body.theme-community .logo span {
  color: var(--accent);
}
body.theme-community .nav-main a:hover,
body.theme-community .nav-main a.active {
  color: var(--primary);
  background: var(--accent-soft);
}
body.theme-community .btn-primary {
  background: var(--primary);
}
body.theme-community .btn-primary:hover {
  background: var(--primary-light);
}
body.theme-community .section-title::after,
body.theme-community .section-title {
  border-color: var(--accent);
}
body.theme-community .tag {
  background: var(--accent-soft);
  color: var(--primary);
}
body.theme-community .community-entry-card:hover,
body.theme-community .pray-card:hover,
body.theme-community .pray-card.selected {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(185, 28, 28, 0.12);
}
body.theme-community .stat-card .num,
body.theme-community .community-entry-emoji {
  color: var(--primary);
}

/* 首页 / 全站：好运来导航与核心板块卡片红色强调 */
.nav-main a.nav-community {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid #fecaca;
  font-weight: 600;
}
.nav-main a.nav-community:hover,
.nav-main a.nav-community.active {
  color: #7f1d1d;
  background: rgba(220, 38, 38, 0.16);
  border-color: #fca5a5;
}
.card-link.card-community {
  border-color: #fecaca;
  background: linear-gradient(165deg, #fff5f5 0%, #ffffff 55%);
}
.card-link.card-community h3 {
  color: #991b1b;
}
.card-link.card-community p {
  color: #b45309;
}
.card-link.card-community:hover {
  border-color: #f87171;
  box-shadow: 0 8px 24px rgba(185, 28, 28, 0.12);
  transform: translateY(-2px);
  color: inherit;
}
.card-link.card-community:hover h3 {
  color: #7f1d1d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--layout-font-base);
  line-height: var(--layout-line-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

.container { max-width: var(--layout-container-max); margin: 0 auto; padding: 0 var(--layout-padding-x); }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  height: var(--layout-header-h);
  flex-wrap: wrap;
}
.logo-link { flex-shrink: 0; }
.nav-main { flex: 1; justify-content: center; min-width: 0; }
.header-actions { margin-left: auto; flex-shrink: 0; }

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.nav-main { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-main a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.nav-main a:hover, .nav-main a.active {
  color: var(--primary);
  background: var(--accent-soft);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.header-search {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.header-search input {
  width: 140px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
}
.header-search input:focus { outline: none; border-color: var(--primary); }
.header-search button {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.header-search button:hover { border-color: var(--primary); }

.header-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}
.header-profile-link:hover { color: var(--primary); }
.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.theme-switcher select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #1a2332; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

main { flex: 1; padding: var(--layout-main-py) 0; }

/* Hero */
/* Logo：PNG 白底与页面底色融合（mix-blend-mode） */
.brand-logo-wrap {
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
}
.brand-logo-img {
  display: block;
  object-fit: contain;
  /* 白底 PNG：白色与容器底色相乘后融入页面 */
  mix-blend-mode: multiply;
}
[data-theme="dark"] .brand-logo-img {
  /* 深色主题下同样用 multiply，白底融入深色背景 */
  mix-blend-mode: multiply;
  filter: brightness(1.08) contrast(1.02);
}
.hero-logo-wrap {
  background: var(--bg);
  margin: 0 0 -8px;
  padding: 0;
  line-height: 0;
}
.hero-logo {
  display: block;
  height: var(--layout-hero-logo-h);
  width: auto;
  max-width: min(420px, 90vw);
}
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-wrap {
  background: var(--bg-card);
  padding: 2px 6px;
}
.site-logo {
  height: var(--layout-header-logo-h);
  width: auto;
  max-width: 160px;
}

.hero {
  --hero-gap: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hero-gap);
  text-align: center;
  padding: 0 0 calc(var(--layout-hero-py) * 0.6);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0;
  line-height: 1.5;
}
.layout-block[data-block-id="hero"] .hero {
  width: 100%;
}
.layout-block .layout-block-inner.hero { padding: 0; margin: 0; }
.hero-actions {
  display: flex;
  gap: var(--hero-gap);
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
}
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { color: inherit; }
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
a.article-card {
  display: block;
  width: 100%;
  margin-bottom: 0;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
a.article-card:hover,
a.article-card:focus,
a.article-card:active {
  color: inherit;
  text-decoration: none;
}
a.article-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
/* Edge 等内核：块级标题/段落放在 <a> 内会被拆链，子元素统一 block 行内容器 */
a.article-card .article-card-tags,
a.article-card .article-card-title,
a.article-card .article-card-excerpt,
a.article-card .article-card-meta {
  display: block;
}
.article-card-tags {
  margin-bottom: 4px;
}
.article-card-tags .tag {
  margin-right: 4px;
  margin-bottom: 4px;
}
.article-read-mark {
  color: var(--primary);
  font-size: inherit;
  margin-left: 0.5em;
}
.article-card-title {
  margin: 8px 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
}
.article-card-excerpt {
  margin: 0 0 10px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.92rem;
}
.article-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.grid-2 > a.article-card { margin-bottom: 0; height: 100%; }
.article-list > a.article-card { align-self: stretch; }

.article-list-footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* 首页可视化排版（编辑模式） */
.layout-editor-mode { user-select: none; }
.layout-editor-mode .site-header,
.layout-editor-mode .site-footer { pointer-events: none; opacity: 0.85; }
.layout-editor-mode .layout-block-inner,
.layout-editor-mode .layout-block-inner a,
.layout-editor-mode .layout-block-inner button {
  pointer-events: none !important;
}
.layout-editor-mode .layout-block-toolbar,
.layout-editor-mode .layout-block-toolbar *,
.layout-editor-mode .layout-handle {
  pointer-events: auto !important;
}
.home-layout-editing { padding-bottom: 48px; }
.home-layout-editing .layout-block {
  position: relative;
  border-radius: 8px;
  outline: 2px dashed rgba(59, 130, 246, 0.25);
  min-height: 24px;
}
.home-layout-editing .layout-block-hidden { opacity: 0.45; outline-style: dotted; }
.home-layout-editing .layout-block-active {
  outline: 2px solid #3b82f6;
  z-index: 5;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}
.home-layout-editing .layout-block-sorting { opacity: 0.85; z-index: 10; }
.layout-block-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: -4px -4px 8px;
  background: linear-gradient(180deg, #dbeafe 0%, #e2e8f0 100%);
  border: 1px solid #93c5fd;
  border-radius: 6px 6px 0 0;
  font-size: 0.85rem;
  user-select: none;
  cursor: grab;
  touch-action: none;
  z-index: 15;
  position: relative;
}
.layout-block-toolbar:active { cursor: grabbing; }
.layout-block-drag { font-weight: 700; color: #1e40af; pointer-events: none; }
.layout-block-vis { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; cursor: pointer; }
.layout-handles { display: none; }
.home-layout-editing .layout-block-active .layout-handles { display: block; }
.layout-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #3b82f6;
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.layout-handle-t { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.layout-handle-b { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.layout-handle-l { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.layout-handle-r { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.layout-handle-x {
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ew-resize;
  background: #c9a227;
}
.visual-layout-admin { max-width: none; }
.visual-layout-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.visual-layout-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; }
.visual-layout-help { padding: 14px 20px; margin-bottom: 12px; font-size: 0.85rem; color: var(--text-muted); }
.visual-layout-help ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.visual-layout-frame-wrap { padding: 0; overflow: hidden; }
.visual-layout-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 280px);
  min-height: 640px;
  border: none;
  background: var(--bg);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-card .label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* Cards & Grid */
.section-title {
  font-family: var(--font-display);
  font-size: var(--layout-section-title);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--layout-grid-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--layout-grid-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--layout-grid-gap); }

.page-block { margin-bottom: var(--layout-section-gap); }

/* 首页最新更新：三列模块 + 各三篇文章 */
.home-latest-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--layout-grid-gap);
  align-items: stretch;
  text-align: left;
}
.home-latest-column {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.home-latest-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.06) 0%, transparent 100%);
  text-align: left;
}
.home-latest-module-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
}
.home-latest-module-title a {
  color: var(--primary);
  text-decoration: none;
}
.home-latest-module-title a:hover {
  color: var(--primary-light);
}
.home-latest-more {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.home-latest-more:hover {
  color: var(--primary);
}
.home-latest-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 12px;
  flex: 1;
}
.home-latest-item {
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.home-latest-item:last-child {
  border-bottom: none;
}
.home-latest-link {
  display: block;
  padding: 14px 22px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: background 0.18s ease;
}
.home-latest-link:hover {
  background: var(--accent-soft);
}
.home-latest-link:hover .home-latest-title {
  color: var(--primary);
}
.home-latest-title {
  display: -webkit-box;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--layout-card-radius);
  padding: var(--layout-card-padding);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
a.article-card:hover { transform: none; }
.article-card.card:hover { transform: none; }
a.card:hover { transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.9rem; }

/* Tags & Badges */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--primary);
}
.tag-new { background: #fef3c7; color: #92400e; }
.tag-vip { background: #ede9fe; color: #6d28d9; }
.tag-original { background: #d1fae5; color: #065f46; }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; }
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}
.tabs-sub {
  margin-top: -12px;
  margin-bottom: 24px;
  padding-left: 8px;
}
.tabs-sub .tab {
  font-size: 0.8125rem;
  padding: 6px 12px;
}
.tab:hover, .tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Search */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar-compact {
  margin-bottom: 16px;
  max-width: 480px;
}
.search-bar-compact input { padding: 8px 12px; font-size: 0.85rem; }

.search-highlight {
  background: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}
[data-theme="dark"] .search-highlight {
  background: rgba(250, 204, 21, 0.35);
  color: var(--text);
}

/* Profile */
.profile-page .profile-card h2 { color: var(--primary); }
.profile-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.profile-avatar-preview { flex-shrink: 0; }
.profile-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 600;
}
.profile-avatar-form input[type="file"] { font-size: 0.85rem; max-width: 100%; }
.profile-avatar-upload {
  cursor: pointer;
  margin: 0;
}
.profile-avatar-upload input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}
.profile-page .form-group { margin-bottom: 16px; }
.profile-page .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.875rem;
}
.profile-page .form-group input,
.profile-page .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}
.profile-page .form-group textarea { min-height: 88px; resize: vertical; }
.profile-page .form-group input:disabled {
  background: var(--accent-soft);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.data-table th {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--primary);
}
.data-table tr:hover td { background: var(--accent-soft); }

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
}
.pagination a, .pagination span {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Article */
.article-content { max-width: none; margin: 0; }
.article-page { max-width: 1200px; }
.article-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) 280px;
  gap: 36px;
  align-items: start;
  justify-content: center;
  margin-top: 20px;
}
.article-main .article-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 12px 0 16px;
}
.article-content h2 { font-size: 1.3rem; margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; line-height: 1.8; }
.article-body {
  line-height: 1.85;
  font-size: 1rem;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.article-body > *:first-child { margin-top: 0; }
.article-body > *:last-child { margin-bottom: 0; }
.article-body p { margin: 0 0 1em; }
.article-body p,
.article-body li,
.article-body span,
.article-body div,
.article-body strong,
.article-body em,
.article-body u,
.article-body s {
  font-size: inherit !important;
  color: inherit !important;
  background-color: transparent !important;
}
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: var(--font-display);
  margin: 1.6em 0 0.75em;
  line-height: 1.35;
}
.article-body h2 { font-size: 1.35rem !important; color: var(--text) !important; }
.article-body h3 { font-size: 1.15rem !important; color: var(--text) !important; }
.article-body ul,
.article-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
.article-body li { margin-bottom: 0.35em; }
.article-body blockquote {
  margin: 1em 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body img,
.article-body .rich-content-img {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  margin: 0.75em auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
  object-fit: contain;
}
.article-body .rich-img-block,
.article-body p.rich-img-block {
  max-width: 100%;
  margin: 0.35em 0;
}
.article-body .rich-img-block img,
.article-body .rich-img-block .rich-content-img {
  margin: 0 auto !important;
  box-shadow: var(--shadow);
}
.article-body .rich-img-block[data-vspace="none"],
.article-body .rich-img-row[data-vspace="none"] { margin: 0; }
.article-body .rich-img-block[data-vspace="tight"],
.article-body .rich-img-row[data-vspace="tight"] { margin: 0.35em 0; }
.article-body .rich-img-block[data-vspace="normal"],
.article-body .rich-img-row[data-vspace="normal"] { margin: 0.75em 0; }
.article-body .rich-img-block[data-vspace="loose"],
.article-body .rich-img-row[data-vspace="loose"] { margin: 1.25em 0; }
.article-body .rich-img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
  margin: 0.35em 0;
}
.article-body .rich-img-row img,
.article-body .rich-img-row .rich-content-img {
  flex: 1 1 calc(50% - 10px);
  min-width: 0;
  max-width: 100% !important;
  width: auto;
  margin: 0 !important;
  box-shadow: var(--shadow);
}
.article-body .rich-img-row img[style*="width"],
.article-body .rich-img-row .rich-content-img[style*="width"] {
  flex: 0 1 auto;
}
.article-body figure {
  margin: 1.25em 0;
  max-width: 100%;
}
.article-body figure img {
  margin: 0 auto;
}
.article-body iframe,
.article-body video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  margin: 1em 0;
  border: none;
}
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.article-body pre {
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1em 0;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5em 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}
.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}
.article-actions { display: flex; gap: 10px; margin-top: 24px; }

/* Community */
.page-lead {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.pray-page { max-width: 960px; text-align: center; }
.pray-login-card { padding: 48px 24px; text-align: center; }
.pray-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 16px; }
.pray-hint-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.back-link:hover { color: var(--primary); }

.community-hub-grid { margin-bottom: 32px; }
.community-my-stats { margin-bottom: 24px; }
.community-my-stats p { margin-top: 8px; color: var(--text-muted); }

.fortune-page { max-width: 640px; }
.fortune-login-card { text-align: center; padding: 40px 24px; }
.fortune-hero-img img { width: 140px; height: auto; border-radius: 16px; margin-bottom: 16px; }
.fortune-stage { text-align: center; padding: 32px 24px; margin-bottom: 32px; }
.fortune-tube-wrap { margin-bottom: 20px; transition: transform 0.3s; }
.fortune-tube-wrap.shake { animation: fortuneTubeShake 0.6s ease-in-out; }
.fortune-tube-img { width: min(200px, 50vw); height: auto; display: block; margin: 0 auto; }
@keyframes fortuneTubeShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-8deg) translateY(-4px); }
  40% { transform: rotate(8deg) translateY(-8px); }
  60% { transform: rotate(-6deg) translateY(-4px); }
  80% { transform: rotate(6deg); }
}
.fortune-shake-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; }
.fortune-result { text-align: left; margin: 24px 0 20px; padding: 20px; border-radius: var(--radius); border: 2px solid var(--border); animation: fortuneReveal 0.5s ease; }
@keyframes fortuneReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fortune-level-badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.fortune-tone-great .fortune-level-badge { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.fortune-tone-good .fortune-level-badge { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.fortune-tone-neutral .fortune-level-badge { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.fortune-tone-bad .fortune-level-badge { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.fortune-title { font-size: 1.35rem; margin-bottom: 16px; color: var(--primary); }
.fortune-block { margin-bottom: 16px; }
.fortune-block h4 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; }
.fortune-block p { font-size: 0.95rem; line-height: 1.7; }
.fortune-remedy {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}
.fortune-done-tip { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-top: 8px; }
.fortune-history { margin-top: 8px; }
.fortune-history-list { display: flex; flex-direction: column; gap: 8px; }
.fortune-history-item {
  display: grid;
  grid-template-columns: 100px 56px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}
.fortune-history-level { font-weight: 600; }
.fortune-history-title { color: var(--text-muted); }

.pray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.pray-grid-6 {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pray-card .pray-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}
.pray-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  font-family: inherit;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.pray-card:hover, .pray-card.selected, .pray-card.praying {
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.18);
  transform: translateY(-4px);
}
.pray-card.praying {
  animation: prayPulse 0.8s ease;
}
.pray-icon {
  width: 100%;
  max-width: 120px;
  margin: 0 auto 10px;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}
.pray-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pray-card h3 { font-size: 1rem; margin: 0; font-weight: 600; }
@keyframes prayPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,0.4); }
  50% { box-shadow: 0 0 24px 8px rgba(201,162,39,0.35); }
}

.community-entry-card {
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 32px 20px;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.community-entry-card:hover {
  transform: translateY(-3px);
  color: inherit;
}
.community-entry-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 16px;
  overflow: hidden;
}
.community-entry-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.community-entry-emoji {
  font-size: 2.75rem;
  line-height: 72px;
  overflow: visible;
}

/* 投资必备网站 */
.site-accordion-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.site-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.site-accordion-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
}
.site-accordion-head::-webkit-details-marker { display: none; }
.site-accordion-head::marker { content: ''; }
.site-accordion-head-main { flex: 1; min-width: 0; text-align: left; }
.site-accordion-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.site-accordion-desc {
  display: block;
  font-size: 0.82rem;
  opacity: 0.88;
  margin-top: 4px;
  line-height: 1.45;
}
.site-accordion-count {
  flex-shrink: 0;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.2);
  padding: 4px 10px;
  border-radius: 20px;
}
.site-accordion-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-left: 4px;
}
.site-accordion[open] .site-accordion-chevron { transform: rotate(-135deg); margin-top: 6px; }
.site-accordion-body {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* 财经通识等内容模块 — 课程分节 */
.course-module-page .course-module-intro {
  color: var(--text-muted);
  margin: 0 0 20px;
}
.course-chapter-tabs {
  margin-bottom: 20px;
}
.course-chapter-tabs .tab {
  min-width: 96px;
  text-align: center;
}
.course-chapters {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.course-chapter-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}
.course-section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-section-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.course-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--bg-card);
  transition: background 0.2s;
}
.course-section-head:hover {
  background: var(--bg);
}
.course-section-head::-webkit-details-marker { display: none; }
.course-section-head::marker { content: ''; }
.course-section-head-main {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.course-section-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.course-section-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.course-section-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
}
.course-section-chevron {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}
.course-section-accordion[open] .course-section-head {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.course-section-accordion[open] .course-section-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.course-section-body {
  padding: 12px 14px 16px;
}
.course-article-list {
  gap: 10px;
}
.course-article-list .article-card {
  border: 1px solid var(--border);
  box-shadow: none;
}
.course-section-empty {
  margin: 0;
  padding: 16px 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-section { margin-top: 36px; }
.section-title-sm { font-size: 1.25rem; margin-bottom: 8px; }
.site-cat-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.site-grid { gap: 16px; }
.site-link-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 20px 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.site-link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary-light);
  color: inherit;
}
.site-link-card h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--primary);
}
.site-link-card .site-desc,
.site-link-card .site-url {
  font-size: 0.88rem;
  line-height: 1.65;
  margin: 0;
}
.site-link-card .site-desc {
  color: var(--text-muted);
  margin-bottom: 8px;
}
.site-link-card .site-url {
  color: var(--primary-light);
  word-break: break-all;
}
.site-link-card:hover .site-url { text-decoration: underline; }

.site-card { transition: transform 0.2s, box-shadow 0.2s; }
.site-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }

.pray-effect-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pray-burst {
  position: relative; text-align: center; opacity: 0; z-index: 2;
  transform: scale(0.5) translateY(20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pray-burst.active { opacity: 1; transform: scale(1) translateY(0); }
.pray-burst-img {
  width: min(140px, 36vw);
  height: min(140px, 36vw);
  margin: 0 auto 14px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: burstImgPop 1.2s ease forwards;
}
.pray-burst-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes burstImgPop {
  0% { transform: scale(0.6) rotate(-8deg); }
  40% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
.pray-burst-text {
  font-size: 1.15rem; font-weight: 600; color: var(--primary);
  background: var(--bg-card); padding: 12px 22px; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15); border: 2px solid var(--accent);
}
.fx-red .pray-burst-img { box-shadow: 0 0 32px rgba(239,68,68,0.45); }
.fx-shield .pray-burst-img { box-shadow: 0 0 32px rgba(16,185,129,0.45); }
.fx-fish .pray-burst-img { box-shadow: 0 0 32px rgba(239,68,68,0.35); }
.fx-gold .pray-burst-img { box-shadow: 0 0 32px rgba(251,191,36,0.5); }
.fx-break .pray-burst-img { box-shadow: 0 0 32px rgba(249,115,22,0.45); }
.fx-hands .pray-burst-img { box-shadow: 0 0 32px rgba(96,165,250,0.45); }

.pray-particle {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  animation: particleFly 1.8s ease-out forwards;
}
.pray-particle-coin { width: 10px; height: 10px; border-radius: 50%; }
.pray-particle-shield { width: 8px; height: 10px; border-radius: 2px 2px 50% 50%; }
.pray-particle-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 12px solid currentColor; background: transparent !important; }
.pray-particle-confetti { width: 6px; height: 10px; border-radius: 1px; }
.pray-particle-ray { width: 3px; height: 14px; border-radius: 2px; }
.pray-particle-star { width: 8px; height: 8px; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
@keyframes particleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(180deg); }
}
@keyframes floatUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-30px); opacity: 0.8; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }


.mood-grid, .result-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}
.mood-btn, .result-btn {
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.mood-btn:hover, .result-btn:hover,
.mood-btn.selected, .result-btn.selected {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.quote-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: #fff;
  padding: 16px 28px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 90%;
  text-align: center;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 200;
}
.quote-popup.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.badge-list { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  padding: 6px 14px;
  background: var(--accent-soft);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-inner p { color: var(--text-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.875rem; }
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.module-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.module-check-item { margin: 0; }
.module-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.module-check-label:hover { border-color: var(--primary-light); }
.module-check-label span { flex: 1; }
.admin-logo-card { padding: 24px; }
.admin-logo-preview {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
  min-height: 56px;
}
.admin-logo-preview img { height: 48px; width: auto; max-width: 200px; object-fit: contain; }
.admin-logo-preview-new {
  height: 48px;
  border: 2px dashed var(--accent);
  padding: 4px;
  border-radius: 8px;
}
.admin-logo-empty { color: var(--text-muted); font-size: 0.9rem; }
.admin-logo-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-settings-flash {
  max-width: 720px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.admin-settings-flash.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.admin-settings-flash.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.category-edit-row-child {
  margin-left: 24px;
  border-left: 3px solid var(--primary);
}

.admin-toast-host {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.admin-toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.admin-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.admin-toast-ok {
  background: #047857;
  color: #fff;
}
.admin-toast-err {
  background: #b91c1c;
  color: #fff;
}

.admin-modules-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-modules-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.admin-modules-table { min-width: 920px; }
.admin-modules-table input[type="text"],
.admin-modules-table .admin-module-desc {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg-card);
}
.admin-module-desc { min-width: 180px; }
.admin-modules-table input.readonly {
  background: var(--bg);
  color: var(--text-muted);
}
.admin-module-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.admin-module-del input { margin: 0 4px 0 0; }
.admin-modules-add {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--bg);
}
.admin-modules-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.admin-module-sort-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-module-sort-btns .btn {
  padding: 2px 8px;
  min-width: 32px;
}
.admin-module-type {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--bg-card);
}
.admin-modules-foot { display: flex; gap: 12px; }
.admin-modules-reset { max-width: 960px; margin-bottom: 24px; }
@media (max-width: 640px) {
  .admin-modules-add-grid { grid-template-columns: 1fr; }
}

.sites-page { padding-bottom: 16px; }
.sites-page-title { margin-bottom: 8px; font-size: 1.5rem; }
.compliance-notice-compact {
  font-size: 0.72rem;
  padding: 6px 10px;
  margin: 0 0 12px;
  line-height: 1.45;
}
.sites-page .site-accordion-list { gap: 6px; margin-top: 0; }
.sites-page .site-accordion-head { padding: 10px 14px; }
.sites-page .site-accordion-title { font-size: 1rem; line-height: 1.3; }
.sites-page .site-accordion-desc {
  display: block;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 3px;
  line-height: 1.35;
}
.sites-page .site-accordion-count { font-size: 0.72rem; padding: 2px 8px; }
.sites-page .site-accordion-chevron { width: 8px; height: 8px; }
.sites-page .site-accordion-body { padding: 10px 12px 12px; }
.sites-page .site-link-card { padding: 12px 14px; }
.sites-page .site-link-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.sites-page .site-link-card .site-desc,
.sites-page .site-link-card .site-url { font-size: 0.8rem; line-height: 1.5; margin-bottom: 4px; }
.sites-page main,
body:has(.sites-page) main { padding-top: 20px; padding-bottom: 20px; }

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
}
.form-group textarea { min-height: 120px; resize: vertical; }

.compliance-notice {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 16px 0;
}

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--primary);
  color: #fff;
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 10px 24px;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-sidebar h2 { padding: 0 24px 20px; font-size: 1.1rem; }
.admin-content { flex: 1; padding: 32px; background: var(--bg); }
.admin-content h1 { font-size: 1.5rem; margin-bottom: 24px; }

.layout-editor-form { max-width: 900px; }
.layout-editor-section { margin-bottom: 20px; padding: 20px 24px; }
.layout-editor-section h3 { margin-bottom: 16px; font-size: 1.05rem; }
.layout-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px 24px;
}
.layout-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: 8px;
  font-weight: 500;
}
.layout-field label output {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.8rem;
}
.layout-field input[type="range"] { width: 100%; cursor: pointer; }
.layout-field input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.layout-css-textarea {
  width: 100%;
  min-height: 180px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}
.layout-editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}
.layout-reset-form { max-width: 900px; margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  main { padding: 24px 0; }
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    position: relative;
  }
  .logo-link { justify-self: auto; }
  .nav-main { display: none; justify-self: auto; }
  .nav-main.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-card);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .header-actions { margin-left: auto; }
  .header-search { order: 4; width: 100%; }
  .header-search input { flex: 1; width: auto; }
  .mobile-menu-btn { display: block; margin-left: auto; }
  .scroll-top-btn { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .grid-2, .grid-3, .home-latest-columns { grid-template-columns: 1fr; }
  .site-grid { grid-template-columns: 1fr; }
  .site-link-card { padding: 18px 16px; }
  .site-accordion-head { padding: 16px; flex-wrap: wrap; }
  .site-accordion-title { font-size: 1.05rem; }
  .site-accordion-count { order: 3; width: 100%; margin-top: 6px; text-align: left; }
  .site-section { margin-top: 28px; }
  .fortune-history-item { grid-template-columns: 1fr; gap: 4px; }
  .community-hub-grid { gap: 14px; }
  .section-title { font-size: 1.35rem; }
  .section-title-sm { font-size: 1.1rem; }
  .compliance-notice { font-size: 0.82rem; padding: 10px 14px; }
  .hero { padding-bottom: 24px; }
  .hero-logo { height: min(var(--layout-hero-logo-h), 108px); max-width: 85vw; }
  .hero p { font-size: 0.95rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 12px; }
  .pray-grid-6 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .pray-card { padding: 14px 12px 16px; }
  .pray-icon { max-width: 100px; }
  .pray-card h3 { font-size: 0.92rem; }
  .pray-card .pray-note { font-size: 0.72rem; }
  .community-entry-card { padding: 28px 16px; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { justify-content: center; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .mood-btn, .result-btn { padding: 10px 14px; font-size: 0.85rem; flex: 1 1 calc(50% - 6px); min-width: 0; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .pray-grid-6 { grid-template-columns: 1fr; max-width: 280px; margin-left: auto; margin-right: auto; }
  .pray-burst-text { font-size: 1rem; padding: 10px 16px; max-width: 90vw; }
  .page-lead { font-size: 0.88rem; margin-bottom: 20px; }
  .quote-popup { font-size: 0.9rem; padding: 14px 20px; bottom: 16px; width: calc(100% - 32px); max-width: none; }
}

/* Article highlights & favorites */
.article-reading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
}
.article-tools-guest {
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.article-pdf-action {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}
.article-tools-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-body mark.article-hl {
  padding: 0 2px;
  border-radius: 3px;
  color: inherit;
  cursor: pointer;
}
.article-body mark.hl-yellow { background: #fef08a; }
.article-body mark.hl-green { background: #bbf7d0; }
.article-body mark.hl-blue { background: #bfdbfe; }
.article-body mark.hl-pink { background: #fbcfe8; }
.article-body mark.hl-purple { background: #e9d5ff; }

.highlight-toolbar {
  position: fixed;
  z-index: 100;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.highlight-toolbar.is-active {
  display: flex;
}
.highlight-toolbar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 4px;
}
.highlight-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
  cursor: pointer;
  padding: 0;
}
.highlight-color-btn.hl-yellow { background: #fef08a; }
.highlight-color-btn.hl-green { background: #bbf7d0; }
.highlight-color-btn.hl-blue { background: #bfdbfe; }
.highlight-color-btn.hl-pink { background: #fbcfe8; }
.highlight-color-btn.hl-purple { background: #e9d5ff; }
.highlight-toolbar-close {
  margin-left: 4px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}
.highlight-toolbar-close:hover {
  background: var(--bg);
  color: var(--text);
}

.highlight-note-dialog,
.favorite-picker,
.app-confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.favorite-picker[hidden],
.app-confirm-dialog[hidden] { display: none !important; }
.app-confirm-dialog {
  z-index: 300;
}
.app-confirm-dialog-inner {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  text-align: center;
}
.app-confirm-dialog-message {
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}
.app-confirm-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Toast / feedback modal */
.app-toast-dialog {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-toast-dialog[hidden] { display: none !important; }
.app-toast-dialog-inner {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.app-toast-dialog-message {
  margin: 0 0 20px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}
.app-toast-dialog-message.is-success { color: var(--success, #059669); }
.app-toast-dialog-message.is-error { color: var(--danger, #dc2626); }

/* Scroll to top */
.scroll-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 90;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
}
.scroll-top-btn[hidden] { display: none !important; }
.scroll-top-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.favorite-picker-inner {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

/* Notes rail — right sidebar */
.article-notes-rail {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px;
  align-self: start;
}
.article-notes-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.highlight-note-compose {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.highlight-note-compose[hidden] { display: none; }
.highlight-note-title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.highlight-note-quote {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.55;
  word-break: break-word;
}
.highlight-note-field {
  margin: 0 0 10px;
}
.highlight-note-textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  box-sizing: border-box;
  resize: vertical;
  vertical-align: top;
}
.highlight-note-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.highlight-note-textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.highlight-note-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.favorite-folder-options {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.favorite-folder-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.95rem;
}
.favorite-folder-option:hover {
  border-color: var(--primary);
  background: var(--accent-soft);
}
.favorite-new-folder-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.favorite-new-folder-inline input { flex: 1; }

.article-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.article-notes-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.article-notes-item:first-child { padding-top: 0; }
.article-notes-item:last-child { border-bottom: none; padding-bottom: 0; }
.article-notes-item mark {
  display: inline;
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 1px 3px;
}
.article-notes-clear-all {
  border: none;
  background: none;
  color: var(--danger, #b91c1c);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.article-notes-clear-all:hover { text-decoration: underline; }
.article-notes-text {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}
.article-notes-delete {
  margin-top: 6px;
  border: none;
  background: none;
  color: var(--danger, #b91c1c);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.article-notes-delete:hover { text-decoration: underline; }
.article-notes-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.favorites-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
.favorites-sidebar { padding: 18px; }
.favorites-folder-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.favorites-folder-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}
.favorites-folder-link:hover,
.favorites-folder-link.active {
  background: var(--accent-soft);
  color: var(--primary);
}
.favorites-folder-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.favorites-new-folder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.favorites-folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.favorites-main { padding: 18px; min-height: 200px; }
.favorites-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.favorites-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.favorites-item:last-child { border-bottom: none; }
.favorites-item-title {
  display: block;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
}
.favorites-item-title:hover { color: var(--primary); }
.favorites-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
@media (max-width: 1080px) {
  .article-page-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .article-notes-rail {
    position: static;
    max-height: none;
    order: 2;
  }
}
@media (max-width: 768px) {
  .favorites-layout { grid-template-columns: 1fr; }
}
