/* ============================================
   牛排安逸的小屋 - 主样式
   雾玻璃 (Glassmorphism) 主题
   ============================================ */

:root {
  --bg-1: #dfeef0;
  --bg-2: #f3e8ee;
  --accent: #4fb8b5;
  --accent-2: #f0a6c0;
  --text: #3a4a4d;
  --text-light: #7a8a8d;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(79, 140, 160, 0.15);
  --radius: 18px;
}

[data-theme="dark"] {
  --bg-1: #1c2a30;
  --bg-2: #241f2e;
  --accent: #5fd0cc;
  --accent-2: #e58ab0;
  --text: #dbe7e8;
  --text-light: #8fa3a6;
  --glass-bg: rgba(40, 55, 62, 0.5);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 主题切换时的全局平滑过渡（由 JS 临时添加） */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color 0.8s ease, color 0.8s ease,
              border-color 0.8s ease, box-shadow 0.8s ease !important;
}

/* 语言切换时的文字淡出淡入（由 JS 临时添加） */
.lang-fade [data-i18n] {
  opacity: 0;
  transition: opacity 0.45s ease;
}
[data-i18n] { transition: opacity 0.45s ease; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  transition: background 0.5s, color 0.3s;
  overflow-x: hidden;
}

/* ---------- 背景漂浮光斑 ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  z-index: -1;
  animation: floatBlob 14s ease-in-out infinite alternate;
}
.blob-1 { width: 420px; height: 420px; background: #9fd8d6; top: -100px; left: -100px; }
.blob-2 { width: 360px; height: 360px; background: #f3c1d4; bottom: -80px; right: -60px; animation-delay: 3s; }
.blob-3 { width: 280px; height: 280px; background: #c9def0; top: 40%; left: 60%; animation-delay: 6s; }

@keyframes floatBlob {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, -40px) scale(1.15); }
}

/* ---------- 雾玻璃基础组件 (UIverse 风格) ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin: 16px auto 0;
  max-width: 1080px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.nav-logo img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); }

.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.3s, color 0.3s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--accent);
  color: #fff;
}

.theme-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: 8px;
  transition: transform 0.3s;
}
.theme-btn:hover { transform: rotate(30deg) scale(1.1); }

.lang-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  margin-left: 8px;
  transition: transform 0.3s;
}
.lang-btn:hover { transform: scale(1.15); }

/* ---------- 容器 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.hero {
  margin: 56px auto 40px;
  max-width: 1080px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  gap: 48px;
}
.hero-avatar {
  position: relative;
  flex-shrink: 0;
}
.hero-avatar img {
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(79, 140, 160, 0.3);
  animation: bounceInDown 1.2s both;
}
.hero-avatar .badge {
  position: absolute;
  bottom: 8px; right: 8px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(240, 166, 192, 0.5);
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-light); line-height: 1.8; margin-bottom: 24px; }

/* ---------- 按钮 (UIverse 风格 + Hover.css) ---------- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(79, 184, 181, 0.4); }
.btn-primary:hover { background: #3fa8a5; }
.btn-ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); margin-left: 12px; }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---------- 区块标题 ---------- */
.section-title {
  text-align: center;
  margin: 48px 0 28px;
  font-size: 1.5rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 48px; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  margin: 10px auto 0;
}

/* ---------- 文章卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 56px;
}
.card {
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.35s, box-shadow 0.35s;
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(79, 140, 160, 0.25);
}
.card .tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(79, 184, 181, 0.12);
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.7; margin-bottom: 16px; }
.card .meta { font-size: 0.8rem; color: var(--text-light); display: flex; justify-content: space-between; }

/* ---------- 置顶文章卡片 ---------- */
.card-pinned {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(79, 184, 181, 0.16), rgba(240, 166, 192, 0.16)), var(--glass-bg);
  border: 1px solid rgba(79, 184, 181, 0.4);
}
.tag-pin {
  color: #fff !important;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)) !important;
}
.card-pinned .meta span:last-child { color: var(--accent); font-weight: 600; }

/* ---------- 关于页 ---------- */
.about-hero {
  margin: 48px auto;
  padding: 40px;
  display: flex;
  gap: 36px;
  align-items: center;
  flex-wrap: wrap;
}
.about-hero img.cover {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}
.about-hero .info { flex: 1; min-width: 280px; }
.about-hero h2 { margin-bottom: 14px; }
.about-hero p { line-height: 1.9; color: var(--text-light); margin-bottom: 10px; }

.skill-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.skill {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

/* 进度条组件 (UIverse 风格) */
.progress-row { margin: 14px 0; }
.progress-row label { font-size: 0.85rem; color: var(--text-light); display: flex; justify-content: space-between; }
.progress-bar {
  height: 10px;
  background: rgba(125, 155, 160, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 文章页 ---------- */
.article {
  margin: 48px auto;
  padding: 48px 56px;
  max-width: 820px;
}
.article h1 { font-size: 1.8rem; margin-bottom: 8px; }
.article .meta { color: var(--text-light); font-size: 0.85rem; margin-bottom: 28px; }
.article img.cover { width: 100%; border-radius: var(--radius); margin-bottom: 28px; }
.article p { line-height: 2; margin-bottom: 16px; }
.article h2 { margin: 28px 0 14px; font-size: 1.25rem; border-left: 4px solid var(--accent); padding-left: 12px; }
.article blockquote {
  border-left: 4px solid var(--accent-2);
  background: rgba(240, 166, 192, 0.08);
  padding: 14px 20px;
  border-radius: 0 12px 12px 0;
  margin: 20px 0;
  color: var(--text-light);
}
.article pre {
  background: rgba(30, 45, 50, 0.85);
  color: #d8e8e8;
  padding: 18px 22px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  margin: 18px 0;
}

/* ---------- 页脚 ---------- */
footer {
  margin: 64px auto 24px;
  max-width: 1080px;
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}
/* ---------- Hover.css 兼容性修复 ----------
   1. 伪元素背景色跟随主题色（覆盖默认蓝色 #2c97de）
   2. 伪元素继承父元素圆角，避免出现方形叠加 */
[class*="hvr-"]::before,
[class*="hvr-"]::after {
  border-radius: inherit;
}

.hvr-bounce-to-right::before,
.hvr-bounce-to-left::before,
.hvr-shutter-in-horizontal::before,
.hvr-underline-from-center::before {
  background: var(--accent);
}

/* 移除鼠标点击后的默认蓝色 outline（保留键盘可访问性） */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 箴言横排框 ---------- */
.quote-box {
  margin: 8px auto 56px;
  padding: 36px 24px 40px;
  text-align: center;
}
.quote-title {
  font-size: 1.3rem;
  margin-bottom: 22px;
}
.quote-line {
  min-height: 2.2em;
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: var(--text);
  transition: opacity 0.6s ease;
}
.q-cursor {
  display: inline-block;
  width: 3px;
  height: 1.15em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--accent);
  border-radius: 2px;
  animation: qblink 1s steps(2, start) infinite;
}
.quote-copy-hint {
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
  opacity: 0.75;
  transition: opacity 0.3s, color 0.3s;
}
.quote-copy-hint:hover { opacity: 1; color: var(--accent); }
@keyframes qblink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------- 滚动入场动画辅助 ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .hero { flex-direction: column; text-align: center; padding: 40px 24px; }
  .article { padding: 32px 22px; }
  .navbar { flex-direction: column; gap: 10px; }
}
