/* ============================================================
   guohome.us.ci — 全站统一视觉规范 · 清新浅色蓝 (Fresh Blue)
   明亮白底 + 天蓝点缀 + 柔和卡片，线性图标（跟随系统深色）
   ============================================================ */

/* ---------- 设计变量（唯一来源） ---------- */
:root {
  --primary: #3B82F6;          /* 主色：天蓝（清爽 SaaS 风） */
  --accent: #60A5FA;           /* 辅助亮蓝：hover / 高亮 */
  --primary-hover: #2563EB;
  --primary-soft: rgba(59, 130, 246, 0.10);
  --accent-soft: rgba(59, 130, 246, 0.10);

  /* 浅色主题：纯白 + 极浅蓝灰背景 */
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --surface-alt: #F0F5FB;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --grid-line: transparent;
  --hero-glow: rgba(59, 130, 246, 0.06);
  --shadow: 0 4px 18px rgba(30, 58, 95, 0.06);
  --shadow-hover: 0 12px 28px rgba(30, 58, 95, 0.12);

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1080px;
  --transition: 220ms cubic-bezier(.4, 0, .2, 1);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface-alt: #273449;
  --text: #E2E8F0;
  --text-muted: #94A3B8;
  --border: #334155;
  --grid-line: transparent;
  --hero-glow: rgba(96, 165, 250, 0.10);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
  --primary-soft: rgba(59, 130, 246, 0.18);
  --accent-soft: rgba(96, 165, 250, 0.16);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 70% 48% at 50% -12%, var(--hero-glow), transparent 70%);
  background-attachment: fixed;
  line-height: 1.7; -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
}
::selection { background: var(--primary); color: #04121C; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: 6px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(var(--container), calc(100% - 2.5rem)); margin-inline: auto; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.18em; flex: 0 0 auto; stroke-width: 1.9; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));

}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.05rem; letter-spacing: .1px; flex: 0 0 auto; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  display: grid; place-items: center; color: #04121C; font-size: .92rem; font-weight: 800;
  
}
.nav-links { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.nav-links a {
  padding: .45rem .8rem; border-radius: 8px; color: var(--text-muted);
  font-size: .92rem; font-weight: 600; white-space: nowrap; flex: 0 0 auto;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-soft); }
.nav-links a.active { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; background: transparent;  }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 1rem;
  display: grid; place-items: center; flex: 0 0 auto;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.icon-btn:hover { color: var(--primary); border-color: var(--accent);  }
.theme-toggle .ico { width: 1.1rem; height: 1.1rem; }
.theme-toggle:hover .ico { transform: rotate(-12deg); }

/* ---------- Hero ---------- */
.hero { padding: 4.6rem 0 3.8rem; text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 60% at 50% 30%, var(--hero-glow), transparent 75%);
}
.hero-badge {
  display: inline-block; padding: .3rem .9rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);
  color: var(--text); font-size: .78rem; font-weight: 700; letter-spacing: .12em; margin-bottom: 1.2rem;
  
}
.hero h1 { margin: 0 0 .9rem; font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.25; letter-spacing: -.5px; font-weight: 800; }
.hero-highlight { color: var(--primary);  }
.hero p { margin: 0 auto; max-width: 680px; color: var(--text-muted); font-size: 1.02rem; }
.hero-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-compact { padding: 5rem 0 4rem; }
.hero-greeting { color: var(--primary); font-weight: 650; font-size: .9rem; margin: -.4rem 0 1rem; letter-spacing: .3px; font-family: var(--mono); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .68rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
.btn-primary { background: var(--primary); color: #04121C;  }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); }
.btn-ghost:hover { border-color: var(--accent); color: var(--primary); transform: translateY(-2px);  }

/* ---------- 区块 ---------- */
.section { padding: 2.6rem 0; }
.section-title { font-size: 1.6rem; margin: 0 0 .35rem; letter-spacing: -.3px; }
.section-title::after { content: ""; display: block; width: 42px; height: 2px; margin-top: .55rem; background: linear-gradient(90deg, var(--accent), transparent);  }
.section-sub { color: var(--text-muted); margin: 0; }
.section-head { margin-bottom: 1.4rem; }

/* ---------- 门户卡片 ---------- */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.3rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .35rem; min-height: 0;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--accent); }

.card-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  display: grid; place-items: center; margin-bottom: .3rem; 
}
.card-icon .ico { width: 1.35rem; height: 1.35rem; }
.card h3 { margin: 0; font-size: 1.02rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .86rem; }
.card-placeholder { color: var(--text-muted); }
/* 整卡可点击：链接式卡片继承文本色、显示手型，去掉旧小字入口 */
a.card-linked { color: inherit; text-decoration: none; display: block; cursor: pointer; }
a.card-linked:hover, a.card-linked:focus-visible { text-decoration: none; color: inherit; border-color: var(--accent); }
a.card-linked::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
a.card-linked { position: relative; }

/* ---------- 关于区 ---------- */
.about-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.about-box h2 { margin-top: 0; }
.about-box h2::after { content: ""; display: block; width: 42px; height: 2px; margin-top: .55rem; background: linear-gradient(90deg, var(--accent), transparent); }
.about-box p { color: var(--text-muted); max-width: 760px; }

/* ---------- 页脚 / 返回顶部 ---------- */
.site-footer { border-top: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border)); padding: 1.8rem 0; text-align: center; color: var(--text-muted); font-size: .85rem; margin-top: 2.5rem; }
.to-top {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface); color: var(--primary); font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), box-shadow var(--transition);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0);  }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 550ms ease, transform 550ms ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 阅读进度 / 搜索 ---------- */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent));  z-index: 100; transition: width 80ms linear; }
.portal-search-wrap { position: relative; max-width: 620px; margin: 0 0 1.5rem; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.1rem; }
.portal-search {
  width: 100%; padding: .72rem 1rem .72rem 2.6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.portal-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px var(--accent-soft); }
.search-empty { color: var(--text-muted); }

/* ---------- 右上角装饰：时钟 / 天气 / 收藏 ---------- */
.header-utils { display: inline-flex; align-items: center; gap: .8rem; margin-right: .2rem; }
.header-util { font-size: .8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.header-util .ico { width: .95rem; height: .95rem; opacity: .85; color: var(--accent); }
.header-weather .weather-icon { font-size: .9rem; }
.weather-temp-compact { font-weight: 800; color: var(--primary); font-size: .82rem;  }
.bm-popover-wrap { position: relative; display: inline-flex; }
.bm-toggle[aria-expanded="true"] { color: var(--primary); border-color: var(--accent);  }
.bm-popover {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 60;
  display: flex; flex-direction: column; gap: .7rem; width: 280px; padding: 1rem;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: var(--radius); box-shadow: var(--shadow-hover);
}
.bm-popover[hidden] { display: none; }
.bm-popover-head { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.bm-popover .bookmark-list { margin-bottom: 0; max-height: 220px; overflow: auto; }
.bm-popover .bookmark-form input { font-size: .8rem; }
.bm-popover .bookmark-form .btn { font-size: .8rem; }

/* 收藏列表 / 表单 */
.bookmark-list { display: flex; flex-direction: column; gap: .45rem; }
.bookmark-item { display: flex; align-items: center; gap: .5rem; }
.bookmark-item a { flex: 1 1 auto; min-width: 0; padding: .42rem .7rem; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-item a:hover { border-color: var(--accent); color: var(--primary); }
.bookmark-del { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.bookmark-del:hover { border-color: #F43F5E; color: #F43F5E; }
.bookmark-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.bookmark-form input { flex: 1 1 120px; min-width: 0; padding: .5rem .65rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: .82rem; }
.bookmark-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bookmark-form .btn { padding: .45rem .8rem; font-size: .82rem; }

/* ---------- 设置页 ---------- */
.settings-section { padding-top: 3rem; }
.settings-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-top: 1.4rem; }
.setting-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.setting-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.1rem; }
.setting-head h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.setting-head p { margin: 0; color: var(--text-muted); font-size: .84rem; }
.setting-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); display: grid; place-items: center;  }
.setting-icon .ico { width: 1.2rem; height: 1.2rem; }
.choice-group { display: flex; gap: .55rem; flex-wrap: wrap; }
.choice-group[data-setting="theme"], .choice-group[data-setting="font"], .choice-group[data-setting="unit"] { flex-wrap: nowrap; }
.choice-group[data-setting="theme"] .choice, .choice-group[data-setting="font"] .choice, .choice-group[data-setting="unit"] .choice { flex: 1 1 0; min-width: 0; padding: .5rem .2rem; font-size: .82rem; white-space: nowrap; }
.choice { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; flex: 1 1 auto; min-height: 42px; padding: .5rem .85rem; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition); }
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice.selected { border-color: var(--accent); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-swatch { width: 17px; height: 17px; border-radius: 5px; border: 1px solid var(--border); }
.swatch-light { background: #fff; }
.swatch-dark { background: #070B14; }
.swatch-system { background: linear-gradient(135deg, #fff 50%, #070B14 50%); }
.swatches { gap: .5rem; flex-wrap: nowrap; }
.swatches .choice { min-height: 0; flex: 0 0 28px; }
.color-choice { width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); position: relative; }
.color-choice:hover { transform: scale(1.12); border-color: var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.color-choice.selected { box-shadow: 0 0 0 2px var(--accent); border-color: var(--surface); }
.color-choice.selected::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: .9rem; display: grid; place-items: center; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.color-choice[style*="60A5FA"].selected::after, .color-choice[style*="10B981"].selected::after, .color-choice[style*="F59E0B"].selected::after { color: #0F172A; text-shadow: none; }
.setting-note { color: var(--text-muted); font-size: .88rem; margin: 0; }
.setting-note b { color: var(--primary); }
.settings-grid .setting-card:last-child { grid-column: 1 / -1; }
.settings-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
.save-hint { color: var(--primary); font-size: .88rem; font-weight: 600; min-height: 1.2em; }
.field-label { display: block; color: var(--text-muted); font-size: .84rem; font-weight: 600; margin-bottom: .4rem; }
.weather-city-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.text-input { flex: 1 1 160px; padding: .6rem .8rem; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; }
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle-grid { display: flex; flex-direction: column; gap: .5rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .75rem; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); font-size: .9rem; cursor: pointer; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }

/* ---------- 字体大小偏好 ---------- */
[data-fontsize="small"] body { font-size: 14px; }
[data-fontsize="medium"] body { font-size: 16px; }
[data-fontsize="large"] body { font-size: 18px; }
body { font-size: 16px; }
body p, body .card p, body .setting-head p { font-size: .95em; }

/* ---------- 动效 / 模块开关 ---------- */
.mouse-glow { position: fixed; top: 0; left: 0; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; z-index: 1; opacity: .6; will-change: transform; }
.no-greeting .hero-greeting, .no-progress .reading-progress, .no-search .portal-search-wrap, .no-search .search-empty,
.no-clock .header-clock, .no-weather .header-weather, .no-bookmarks .bm-popover-wrap { display: none !important; }
.no-hoverglow .card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--border); }
.no-mouseglow .mouse-glow { display: none !important; }
.no-reveal .reveal { opacity: 1 !important; transform: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .hero { padding: 3.2rem 0 2.8rem; }
  .nav { height: auto; min-height: 58px; flex-wrap: wrap; gap: .3rem; padding: .5rem 0; }
  .nav-links { gap: .15rem; flex-wrap: wrap; }
  .nav-links a { padding: .35rem .5rem; font-size: .82rem; }
  .header-utils { gap: .5rem; }
  .header-util { font-size: .72rem; }
  .card-grid, .settings-grid { grid-template-columns: 1fr; }
  .bm-popover { position: fixed; top: 62px; left: 12px; right: 12px; width: auto; }
  .mouse-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
/* 小游戏分区占位容器 */
.game-section {
  min-height: 240px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 2rem; text-align: center;
}
.game-section .card-placeholder { margin: 0; }

/* ---------- 小游戏分类（益智 / 棋类） ---------- */
.game-category { margin-top: 2.2rem; }
.game-cat-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.game-cat-head .card-icon { margin: 0; flex: 0 0 auto; }
.game-cat-head h2 { margin: 0; font-size: 1.15rem; }
.game-cat-head p { margin: .1rem 0 0; font-size: .84rem; }
.game-grid { display: grid; gap: .9rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.game-tile { text-decoration: none; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 1.1rem 1rem; min-height: 98px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: .6rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.game-tile:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.game-tile-name { font-weight: 700; font-size: 1rem; }
.game-tile-status {
  align-self: flex-start; font-size: .72rem; color: var(--text-muted);
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: .15rem .6rem;
}
.game-note { margin-top: 2rem; color: var(--text-muted); font-size: .86rem; }
@media (max-width: 768px) { .game-grid { grid-template-columns: repeat(2, 1fr); } }
