/* ===== Apple-Style Blog - Global Styles ===== */

/* CSS Variables */
:root {
  --primary-blue: #e8f4fd;
  --deep-blue: #4a9eff;
  --accent-blue: #0071e3;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --bg-body: #f5f5f7;
  --border-color: rgba(0, 0, 0, 0.06);
  --nav-height: 52px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-body); color: var(--text-primary); line-height: 1.6; min-height: 100vh;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; }

/* ===== Navigation Bar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--nav-height);
  background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(24px, env(safe-area-inset-left)); transition: var(--transition);
}

/* 导航栏 Logo 头像 */
.navbar-brand {
  font-size: 17px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 8px;
}
.navbar-brand:hover { color: var(--accent-blue); }
.navbar-logo {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid rgba(0, 113, 227, 0.2);
  flex-shrink: 0;
}

.navbar-nav { display: flex; align-items: center; gap: 8px; list-style: none; }
.navbar-nav a {
  font-size: 14px; font-weight: 400; color: var(--text-primary);
  padding: 6px 14px; border-radius: 20px; transition: var(--transition);
}
.navbar-nav a:hover { background: rgba(0, 113, 227, 0.08); color: var(--accent-blue); }
.navbar-nav a.active { color: var(--accent-blue); background: rgba(0, 113, 227, 0.08); }

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(160deg, #dceefb 0%, #b8d9f8 40%, #c8e8ff 70%, #e8f4fd 100%);
  padding: calc(var(--nav-height) + 60px) 24px 80px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: -50%; left: -20%; width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 70%); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; top: 20%; right: -10%; width: 50%; height: 150%;
  background: radial-gradient(ellipse, rgba(74,158,255,0.15) 0%, transparent 70%); pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }

/* Hero 头像 - 主页大圆形头像 */
.hero-avatar-wrap {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.95); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin: 0 auto 24px; background: linear-gradient(135deg, #4a9eff, #0071e3);
  display: flex; align-items: center; justify-content: center;
}
.hero-avatar-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* 关于页面大圆形头像 */
.about-avatar-wrap {
  width: 140px; height: 140px; border-radius: 50%; overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.95); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin: 0 auto 24px; background: linear-gradient(135deg, #4a9eff, #0071e3);
  display: flex; align-items: center; justify-content: center;
}
.about-avatar-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ===== 英雄区励志名言滚动 ===== */
.hero-quote-wrap {
  height: 60px; overflow: hidden; position: relative;
  margin-bottom: 8px; width: 100%;
}
.quote-content {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
}
.quote-text {
  font-size: 17px; font-weight: 600; font-style: italic;
  color: #1a3a5c; letter-spacing: 0.3px; line-height: 1.4;
  text-align: center; transition: opacity 0.3s ease, transform 0.3s ease;
}
.quote-author {
  font-size: 13px; font-weight: 400; color: #5a8ab5;
  margin-top: 6px; transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-subtitle { font-size: 17px; color: #3a6a9a; font-weight: 400; line-height: 1.5; }

/* ===== Main Container ===== */
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ===== Section ===== */
.section-title { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.4px; margin-bottom: 20px; padding-top: 48px; }

/* ===== Glass Card ===== */
.glass-card {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow); overflow: hidden; transition: var(--transition);
}
.glass-card:hover { box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12); transform: translateY(-2px); }

/* ===== Article Card ===== */
.article-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 60px; }
.article-card {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow); padding: 28px 32px; cursor: pointer;
  transition: var(--transition); display: block; text-decoration: none; color: inherit;
}
.article-card:hover { box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12); transform: translateY(-3px); border-color: rgba(0, 113, 227, 0.2); }
.article-card-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.article-date { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.article-tag { font-size: 12px; color: var(--accent-blue); background: rgba(0, 113, 227, 0.08); padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.article-title { font-size: 19px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.3px; margin-bottom: 8px; line-height: 1.4; transition: var(--transition); }
.article-card:hover .article-title { color: var(--accent-blue); }
.article-excerpt { font-size: 15px; color: var(--text-secondary); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article-read-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-size: 14px; color: var(--accent-blue); font-weight: 500; }
.article-read-more svg { transition: transform 0.2s; }
.article-card:hover .article-read-more svg { transform: translateX(3px); }

/* ===== Article Detail Page ===== */
.article-page { padding-top: calc(var(--nav-height) + 40px); padding-bottom: 80px; }
.article-header {
  background: linear-gradient(160deg, #dceefb 0%, #b8d9f8 40%, #e8f4fd 100%);
  padding: calc(var(--nav-height) + 48px) 24px 56px; text-align: center;
}
.article-header-title { font-size: clamp(24px, 4vw, 36px); font-weight: 700; color: #1a3a5c; letter-spacing: -0.5px; max-width: 720px; margin: 0 auto 16px; line-height: 1.3; }
.article-header-meta { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; color: #3a6a9a; font-size: 14px; }
.article-body {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow); padding: 48px; margin-top: 32px;
  line-height: 1.8; font-size: 16px; color: var(--text-primary);
}
.article-body h2 { font-size: 22px; font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.3px; }
.article-body h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; }
.article-body p { margin-bottom: 18px; color: #3a3a3c; }
.article-body blockquote { border-left: 3px solid var(--accent-blue); padding: 12px 20px; margin: 24px 0; background: rgba(0, 113, 227, 0.04); border-radius: 0 8px 8px 0; color: var(--text-secondary); font-style: italic; }
.article-body code { background: rgba(0, 0, 0, 0.04); padding: 2px 7px; border-radius: 5px; font-family: "SF Mono", "Fira Code", monospace; font-size: 14px; }
.article-body pre { background: #1c1c1e; color: #e5e5ea; padding: 20px 24px; border-radius: var(--radius-md); overflow-x: auto; margin: 20px 0; font-size: 14px; line-height: 1.6; }
.article-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.article-body ul, .article-body ol { padding-left: 24px; color: #3a3a3c; line-height: 2; margin-bottom: 18px; }
.article-body img { max-width: 100%; border-radius: var(--radius-md); margin: 16px 0; }

/* ===== Reward Section ===== */
.reward-section { background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); padding: 40px; margin-top: 24px; text-align: center; }
.reward-title { font-size: 20px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.reward-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }
.reward-toggle-btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #4a9eff, #0071e3); color: white; border: none; border-radius: 24px; padding: 12px 28px; font-size: 15px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3); }
.reward-toggle-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 113, 227, 0.4); }
.reward-qr-area { display: none; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 28px; animation: fadeInUp 0.3s ease; }
.reward-qr-area.show { display: flex; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.reward-qr-item { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reward-qr-img { width: 160px; height: 160px; border-radius: var(--radius-md); border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0,0,0,0.08); object-fit: cover; background: #f0f0f0; }
.reward-qr-placeholder { width: 160px; height: 160px; border-radius: var(--radius-md); border: 2px dashed var(--border-color); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-tertiary); font-size: 13px; }
.reward-qr-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.reward-qr-label .wechat-icon { color: #07c160; }
.reward-qr-label .alipay-icon { color: #1677ff; }

/* ===== All Articles Page ===== */
.all-articles-header {
  background: linear-gradient(160deg, #dceefb 0%, #b8d9f8 40%, #e8f4fd 100%);
  padding: calc(var(--nav-height) + 40px) 24px 50px; text-align: center;
}
.all-articles-header h1 { font-size: 32px; font-weight: 700; color: #1a3a5c; letter-spacing: -0.5px; }
.all-articles-header p { color: #3a6a9a; margin-top: 8px; font-size: 16px; }
.year-group { margin-bottom: 32px; }
.year-label { font-size: 13px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; padding-left: 4px; }
.article-list-item {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-md);
  padding: 16px 24px; margin-bottom: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; transition: var(--transition);
  cursor: pointer; color: inherit; text-decoration: none;
}
.article-list-item:hover { transform: translateX(4px); box-shadow: 0 4px 20px rgba(0,0,0,0.08); border-color: rgba(0, 113, 227, 0.15); }
.article-list-item-title { font-size: 16px; font-weight: 500; color: var(--text-primary); flex: 1; transition: var(--transition); }
.article-list-item:hover .article-list-item-title { color: var(--accent-blue); }
.article-list-item-date { font-size: 13px; color: var(--text-tertiary); flex-shrink: 0; }

/* ===== Google-Style Search Box ===== */
.search-container {
  background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow); padding: 28px 32px; margin-bottom: 32px;
}
.search-box {
  display: flex; align-items: center; border: 1px solid var(--border-color);
  border-radius: 28px; padding: 0 20px; transition: var(--transition);
  background: rgba(255,255,255,0.6);
}
.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 2px 12px rgba(0,113,227,0.12);
}
.search-icon { flex-shrink: 0; color: var(--text-tertiary); }
.search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; font-family: inherit; color: var(--text-primary);
  padding: 14px 14px; -webkit-appearance: none;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-clear {
  display: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.06); cursor: pointer; flex-shrink: 0;
  color: var(--text-secondary); font-size: 14px; transition: var(--transition);
}
.search-clear:hover { background: rgba(0,0,0,0.1); }
.search-clear.show { display: flex; }
.search-hint { font-size: 13px; color: var(--text-tertiary); margin-top: 12px; text-align: center; }

/* ===== About Page ===== */
.about-page { padding-top: calc(var(--nav-height) + 40px); padding-bottom: 80px; }
.about-header {
  background: linear-gradient(160deg, #dceefb 0%, #b8d9f8 40%, #e8f4fd 100%);
  padding: calc(var(--nav-height) + 48px) 24px 56px; text-align: center;
}
.about-card { background: var(--glass-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-shadow); padding: 48px; margin-top: 32px; }
.about-card h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 28px 0 12px; letter-spacing: -0.3px; }
.about-card h2:first-child { margin-top: 0; }
.about-card p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.skill-tag { font-size: 13px; color: var(--accent-blue); background: rgba(0, 113, 227, 0.07); padding: 5px 14px; border-radius: 20px; font-weight: 500; border: 1px solid rgba(0, 113, 227, 0.12); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.contact-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent-blue); background: rgba(0, 113, 227, 0.07); padding: 8px 16px; border-radius: 20px; font-weight: 500; border: 1px solid rgba(0, 113, 227, 0.12); transition: var(--transition); }
.contact-link:hover { background: rgba(0, 113, 227, 0.14); transform: translateY(-1px); }

/* ===== Footer ===== */
footer { background: rgba(255, 255, 255, 0.6); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--border-color); padding: 32px 24px; text-align: center; }
.footer-legal { font-size: 12px; color: var(--text-tertiary); line-height: 1.8; max-width: 600px; margin: 0 auto; }
.footer-legal a { color: var(--text-secondary); border-bottom: 1px solid transparent; transition: var(--transition); }
.footer-legal a:hover { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.footer-disclaimer { margin-top: 6px; }
.footer-links-small { margin-top: 8px; font-size: 11px; color: #c7c7cc; }
.footer-links-small a { color: #aeaeb2; }
.footer-links-small a:hover { color: var(--accent-blue); }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-secondary); transition: var(--transition); }
.footer-links a:hover { color: var(--accent-blue); }
.footer-divider { width: 40px; height: 1px; background: var(--border-color); margin: 16px auto; }

/* ===== Back Button ===== */
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--accent-blue); font-weight: 500; margin-bottom: 24px; transition: var(--transition); }
.back-btn:hover { gap: 8px; }

/* ===== Scroll to Top ===== */
.scroll-top { position: fixed; bottom: 28px; right: 28px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: var(--transition); opacity: 0; pointer-events: none; z-index: 999; }
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { color: var(--accent-blue); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14); }

/* ===== Tag Filter ===== */
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag-btn { font-size: 13px; color: var(--text-secondary); background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 6px 16px; border-radius: 20px; font-family: inherit; cursor: pointer; transition: var(--transition); backdrop-filter: blur(10px); }
.tag-btn:hover, .tag-btn.active { color: var(--accent-blue); background: rgba(0, 113, 227, 0.08); border-color: rgba(0, 113, 227, 0.2); }

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .article-body { padding: 28px 22px; }
  .reward-section { padding: 28px 20px; }
  .about-card { padding: 28px 22px; }
  .article-card { padding: 20px 22px; }
  .navbar { padding: 0 16px; }
  .hero { padding: calc(var(--nav-height) + 40px) 16px 60px; }
  .quote-text { font-size: 18px !important; }
  .search-container { padding: 20px; }
}
@media (max-width: 480px) {
  .navbar-nav a { padding: 6px 10px; font-size: 13px; }
  .reward-qr-img, .reward-qr-placeholder { width: 130px; height: 130px; }
}

/* ===== 英雄区日期 + 时钟 ===== */
.hero-date {
  font-size: 16px; font-weight: 500; color: #3a6a9a;
  letter-spacing: 0.5px; margin-top: 12px;
}
.hero-time {
  display: flex; align-items: center; justify-content: center;
  gap: 2px; margin-top: 8px;
  font-size: 19px; font-weight: 500;
}
.hero-time .time-digits {
  font-family: "SF Mono", "Consolas", "Liberation Mono", monospace;
  color: #2a5a8a;
  letter-spacing: 1px;
}
.hero-time .time-colon {
  color: #2a5a8a;
  margin: 0 1px;
  animation: colon-blink 1s step-start infinite;
}
@keyframes colon-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
