/* ============================================================
   WindyStudio · WindyWebsite
   Bootstrap 5.3 之上的自定义主题（浅色默认 · 深色可切换）
   ============================================================ */

/* ---------- 浅色主题（默认） ---------- */
:root,
[data-theme="light"] {
  --ws-bg: #f6f8fc;
  --ws-bg-soft: #edf1f8;
  --ws-nav-bg: rgba(246, 248, 252, 0.82);
  --ws-card: #ffffff;
  --ws-border: rgba(15, 23, 42, 0.1);
  --ws-text: #1d2733;
  --ws-muted: #64748b;
  --ws-primary: #3f6df4;
  --ws-accent: #7c5cff;
  --ws-grad: linear-gradient(92deg, #3f6df4, #7c5cff);
  --ws-shadow: 0 14px 40px rgba(30, 60, 130, 0.12);
  --ws-code-bg: #f1f4f9;
  --ws-code-border: rgba(15, 23, 42, 0.08);
  --ws-chip-bg: rgba(15, 23, 42, 0.05);
  --ws-hover-border: rgba(63, 109, 244, 0.45);
  --ws-star: #f5b301;
  --ws-selection: rgba(63, 109, 244, 0.18);
}

/* ---------- 深色主题 ---------- */
[data-theme="dark"] {
  --ws-bg: #0b0f1a;
  --ws-bg-soft: #111827;
  --ws-nav-bg: rgba(11, 15, 26, 0.8);
  --ws-card: rgba(255, 255, 255, 0.045);
  --ws-border: rgba(255, 255, 255, 0.09);
  --ws-text: #e5e9f0;
  --ws-muted: #8b93a7;
  --ws-primary: #6d8dff;
  --ws-accent: #7c5cff;
  --ws-grad: linear-gradient(92deg, #6d8dff, #7c5cff);
  --ws-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --ws-code-bg: rgba(0, 0, 0, 0.35);
  --ws-code-border: rgba(255, 255, 255, 0.09);
  --ws-chip-bg: rgba(255, 255, 255, 0.07);
  --ws-hover-border: rgba(109, 141, 255, 0.5);
  --ws-star: #f5b301;
  --ws-selection: rgba(109, 141, 255, 0.35);
}

html { scroll-behavior: smooth; }

body {
  background: var(--ws-bg);
  color: var(--ws-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--ws-selection); }

/* ---------- 背景装饰 ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(124, 92, 255, 0.1), transparent 60%),
    radial-gradient(50rem 36rem at -10% 30%, rgba(63, 109, 244, 0.09), transparent 60%),
    radial-gradient(40rem 30rem at 50% 120%, rgba(40, 90, 240, 0.07), transparent 60%),
    var(--ws-bg);
  transition: background 0.25s ease;
}

/* ---------- 导航 ---------- */
.ws-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--ws-nav-bg);
  border-bottom: 1px solid var(--ws-border);
}
.ws-nav .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ws-text);
}
.ws-nav .navbar-brand:hover { color: var(--ws-text); }
.ws-nav .navbar-brand img { width: 30px; height: 30px; border-radius: 8px; }
.ws-nav .brand-grad {
  background: var(--ws-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ws-nav .nav-link {
  color: var(--ws-muted);
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  transition: color 0.15s;
}
.ws-nav .nav-link:hover,
.ws-nav .nav-link.active { color: var(--ws-text); }

/* 主题切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--ws-border);
  background: var(--ws-chip-bg);
  color: var(--ws-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.theme-toggle:hover { color: var(--ws-primary); border-color: var(--ws-hover-border); transform: translateY(-1px); }
.theme-toggle .fa-sun { display: none; }
.theme-toggle .fa-moon { display: inline-block; }

/* ---------- 通用 ---------- */
.grad-text {
  background: var(--ws-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace; }

.ws-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}
.ws-btn-primary {
  background: var(--ws-grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(63, 109, 244, 0.3);
}
.ws-btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124, 92, 255, 0.38); }
.ws-btn-ghost {
  border: 1px solid var(--ws-border);
  color: var(--ws-text);
  background: var(--ws-card);
}
.ws-btn-ghost:hover { color: var(--ws-text); border-color: var(--ws-hover-border); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.ws-hero {
  padding: 7rem 0 5rem;
  text-align: center;
}
.ws-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ws-primary);
  border: 1px solid var(--ws-border);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  background: var(--ws-card);
  margin-bottom: 1.5rem;
}
.ws-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.12;
  margin-bottom: 1.2rem;
}
.ws-hero p.lead {
  color: var(--ws-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}
.ws-hero .cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Section ---------- */
.ws-section { padding: 4.5rem 0; }
.ws-section-alt { background: var(--ws-bg-soft); }
.sec-head { max-width: 680px; margin-bottom: 2.5rem; }
.sec-head .kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ws-primary);
}
.sec-head h2 { font-weight: 700; margin: 0.35rem 0 0.5rem; }
.sec-head p { color: var(--ws-muted); margin: 0; }

/* ---------- 项目卡片 ---------- */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.1rem; }
.ws-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.3rem;
  border-radius: 14px;
  background: var(--ws-card);
  border: 1px solid var(--ws-border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.ws-card:hover {
  transform: translateY(-4px);
  border-color: var(--ws-hover-border);
  box-shadow: var(--ws-shadow);
  color: inherit;
}
.ws-card .card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.ws-card .card-top h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
.ws-card .card-top h3 i { color: var(--ws-primary); font-size: 1.05rem; }
.ws-card .stars { color: var(--ws-muted); font-size: 0.85rem; white-space: nowrap; }
.ws-card .stars i { color: var(--ws-star); margin-right: 0.15rem; }
.ws-card .card-desc {
  color: var(--ws-text);
  opacity: 0.85;
  font-size: 0.92rem;
  margin: 0;
  flex-grow: 1;
}
.ws-card .card-metas { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: var(--ws-chip-bg);
  color: var(--ws-muted);
  border: 1px solid var(--ws-border);
}
.ws-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #8b93a7; flex: none; }
.ws-chip.lang { color: var(--ws-text); }
.ws-card .card-links {
  display: flex;
  gap: 0.7rem;
  font-size: 0.8rem;
  color: var(--ws-muted);
  border-top: 1px solid var(--ws-border);
  padding-top: 0.7rem;
}
.ws-card .card-links i { color: var(--ws-primary); }

/* ---------- 特性卡片（博客 / Xe 入口） ---------- */
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.ws-feature {
  position: relative;
  overflow: hidden;
  padding: 1.6rem 1.5rem;
  border-radius: 14px;
  background: var(--ws-card);
  border: 1px solid var(--ws-border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s, border-color 0.16s;
}
.ws-feature:hover { transform: translateY(-4px); color: inherit; border-color: var(--ws-hover-border); }
.ws-feature .icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 1rem;
  background: var(--ws-grad);
  box-shadow: 0 8px 20px rgba(63, 109, 244, 0.3);
}
.ws-feature h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.ws-feature p { color: var(--ws-muted); font-size: 0.92rem; margin-bottom: 1rem; }
.ws-feature .go { color: var(--ws-primary); font-weight: 600; font-size: 0.9rem; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }
.about-logo {
  text-align: center;
  padding: 1.6rem;
  border-radius: 14px;
  border: 1px solid var(--ws-border);
  background: var(--ws-card);
}
.about-logo img { width: 92px; height: 92px; border-radius: 20px; margin-bottom: 0.8rem; }
.about-logo .org-name { font-weight: 800; font-size: 1.2rem; }
.about-logo .org-sub { color: var(--ws-muted); font-size: 0.8rem; font-family: ui-monospace, Consolas, monospace; }
.about-text p { color: var(--ws-text); opacity: 0.92; }

/* ---------- 成员 ---------- */
.member {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.3rem 1.5rem;
  max-width: 520px;
  border-radius: 14px;
  border: 1px solid var(--ws-border);
  background: var(--ws-card);
}
.member img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--ws-border); }
.member .m-name { font-weight: 700; font-size: 1.1rem; }
.member .owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--ws-grad);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  vertical-align: middle;
  margin-left: 0.3rem;
}
.member .m-role { color: var(--ws-muted); font-size: 0.88rem; }

/* ---------- 时间线 ---------- */
.ws-timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 720px; }
.ws-timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--ws-primary), var(--ws-accent));
  opacity: 0.45;
}
.ws-timeline li { position: relative; padding: 0 0 1.6rem 2.2rem; }
.ws-timeline li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ws-bg);
  border: 3px solid var(--ws-primary);
}
.ws-timeline .tl-time {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--ws-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.ws-timeline .tl-title { font-weight: 700; }
.ws-timeline .tl-desc { color: var(--ws-muted); font-size: 0.9rem; }

/* ---------- 博客 / 文章 ---------- */
.page-hero { padding: 4rem 0 1.5rem; }
.crumb { color: var(--ws-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.crumb a { color: var(--ws-muted); text-decoration: none; }
.crumb a:hover { color: var(--ws-primary); }
.page-hero h1 { font-weight: 800; }
.page-hero .lead { color: var(--ws-muted); }

.post-list { display: flex; flex-direction: column; gap: 0.9rem; max-width: 820px; }
.post-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  border: 1px solid var(--ws-border);
  background: var(--ws-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.post-row:hover { transform: translateX(4px); color: inherit; border-color: var(--ws-hover-border); }
.post-date {
  flex: none;
  width: 58px; height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--ws-grad);
  color: #fff;
  font-weight: 700;
  line-height: 1.15;
}
.post-date b { font-size: 1.25rem; }
.post-date span { font-size: 0.62rem; opacity: 0.85; }
.post-title { font-weight: 700; font-size: 1.05rem; }
.post-tags { display: flex; gap: 0.4rem; margin: 0.25rem 0; }
.post-excerpt { color: var(--ws-muted); font-size: 0.88rem; margin: 0; }
.post-arrow { margin-left: auto; color: var(--ws-muted); font-size: 1.1rem; flex: none; }
.post-row:hover .post-arrow { color: var(--ws-primary); }

/* ---------- 文章正文 ---------- */
.ws-article {
  max-width: 820px;
  padding: 2rem 2.2rem;
  border-radius: 14px;
  border: 1px solid var(--ws-border);
  background: var(--ws-card);
}
.ws-article h2 {
  font-weight: 700;
  margin: 2rem 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ws-border);
}
.ws-article h3 { font-weight: 700; margin: 1.6rem 0 0.7rem; }
.ws-article p { color: var(--ws-text); opacity: 0.9; }
.ws-article a { color: var(--ws-primary); }

.callout {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(63, 109, 244, 0.3);
  background: rgba(63, 109, 244, 0.08);
  margin: 1.2rem 0;
}
.callout.warn {
  border-color: rgba(245, 179, 1, 0.4);
  background: rgba(245, 179, 1, 0.09);
}
.callout .cico { color: var(--ws-primary); margin-top: 0.15rem; }
.callout.warn .cico { color: #f5b301; }

.codeblock {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
  background: var(--ws-code-bg);
  border: 1px solid var(--ws-code-border);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin: 1rem 0;
  overflow-x: auto;
  line-height: 1.7;
}
.codeblock .c { color: #6b7280; }
.codeblock .k { color: var(--ws-primary); }
.codeblock .s { color: #10b981; }

.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.ws-article figure { margin: 1.2rem 0; }
.ws-article figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--ws-border);
}
.ws-article figcaption {
  font-size: 0.8rem;
  color: var(--ws-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.art-foot {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ws-border);
  color: var(--ws-muted);
  font-size: 0.85rem;
}

/* ---------- 页脚 ---------- */
.ws-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--ws-border);
  background: var(--ws-bg-soft);
  padding: 2.5rem 0 2rem;
}
.ws-footer .f-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.ws-footer .f-brand img { width: 28px; height: 28px; border-radius: 7px; }
.ws-footer .f-links { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-footer .f-links a {
  color: var(--ws-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.ws-footer .f-links a:hover { color: var(--ws-text); }
.ws-footer .f-copy { color: var(--ws-muted); font-size: 0.82rem; }

/* ---------- 404 ---------- */
.ws-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.ws-404 .code {
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 800;
  line-height: 1;
  background: var(--ws-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ws-404 h1 { font-weight: 700; margin: 1rem 0 0.5rem; }
.ws-404 p { color: var(--ws-muted); max-width: 420px; margin: 0 auto 1.6rem; }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}