/* ============================================================
   PokeHD - 温暖风格主题 · 高可读 · 全端适配
   ============================================================ */

:root {
  /* 背景 — 暖米色，不刺眼 */
  --bg: #f7f0e3;
  --bg-soft: #f3ead9;
  --bg-card: #fffdfa;
  --bg-input: #faf5ec;

  /* 文字 — 深暖棕，高对比 */
  --text: #332417;
  --text-soft: #5c4a38;
  --text-dim: #8a7561;
  --text-faint: #b3a28e;

  /* 主色 — 暖橙红 */
  --primary: #e05d44;
  --primary-hover: #c94d36;
  --primary-soft: rgba(224, 93, 68, 0.12);

  /* 强调 — 暖琥珀金 */
  --gold: #d9a02b;
  --gold-soft: rgba(217, 160, 43, 0.15);

  /* 辅助 — 暖青蓝 */
  --accent: #4d8fb8;
  --accent-soft: rgba(77, 143, 184, 0.12);

  /* 状态 */
  --success: #3d9b6e;
  --danger: #c0392b;

  /* 边框 */
  --border: rgba(92, 74, 56, 0.15);
  --border-strong: rgba(92, 74, 56, 0.28);

  /* 阴影 */
  --shadow: 0 2px 12px rgba(92, 74, 56, 0.08);
  --shadow-lg: 0 8px 30px rgba(92, 74, 56, 0.12);
  --shadow-btn: 0 4px 14px rgba(224, 93, 68, 0.3);

  /* 尺寸 */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --max-w: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-title: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}

/* ==================== 基础 ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ==================== 导航栏 ==================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 58px; padding: 0 20px;
  background: rgba(247, 240, 227, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 2px 12px rgba(92, 74, 56, 0.08); }
.nav-container {
  max-width: var(--max-w); margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.nav-logo:hover { color: var(--primary); }
.logo-icon { font-size: 1.4rem; }
.logo-text { font-family: var(--font-title); }

.nav-menu { display: flex; gap: 2px; }
.nav-link {
  padding: 6px 14px; border-radius: 18px;
  font-size: 0.9rem; font-weight: 500; color: var(--text-soft);
  transition: all 0.25s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
}
.nav-auth-link {
  padding: 5px 16px; border-radius: 18px;
  border: 1.5px solid var(--gold); color: #a07a1a;
  font-size: 0.82rem; font-weight: 600; transition: all 0.25s;
}
.nav-auth-link:hover { background: var(--gold); color: #fff; }
.nav-username {
  color: var(--primary); font-size: 0.85rem; font-weight: 600;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-username:hover { text-decoration: underline; }
.nav-guild-link, .nav-admin-link {
  font-size: 1.1rem; padding: 4px 7px; border-radius: 8px;
  text-decoration: none; transition: all 0.25s;
}
.nav-guild-link { background: var(--gold-soft); border: 1px solid rgba(217,160,43,0.25); }
.nav-guild-link:hover { background: rgba(217,160,43,0.3); }
.nav-admin-link { background: var(--primary-soft); border: 1px solid rgba(224,93,68,0.2); }
.nav-admin-link:hover { background: rgba(224,93,68,0.2); }
.nav-admin-link[data-badge]::after {
  content: attr(data-badge);
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 8px; padding: 0 4px;
}
.nav-logout {
  padding: 4px 11px; border-radius: 12px; border: 1px solid rgba(192,57,43,0.25);
  background: none; color: var(--text-dim); font-size: 0.76rem; cursor: pointer; transition: all 0.25s;
}
.nav-logout:hover { border-color: var(--danger); color: var(--danger); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.lang-switch {
  display: flex; align-items: center; gap: 4px; padding: 5px 12px;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--bg-card); color: var(--text-soft);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.25s;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

/* ==================== Hero ==================== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(224, 93, 68, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 25%, rgba(217, 160, 43, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 85%, rgba(77, 143, 184, 0.05) 0%, transparent 50%),
    var(--bg-soft);
}
.hero-overlay {
  position: absolute; inset: 0; opacity: 0.25;
  background: url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='24' cy='24' r='18' fill='none' stroke='%23d9b88a' stroke-width='1'/%3E%3C/svg%3E") repeat;
}
.hero-content { position: relative; z-index: 2; max-width: 680px; padding: 0 20px; animation: fadeUp 0.8s ease-out; }
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.35; margin-bottom: 18px; color: var(--text);
}
.title-line.accent {
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem); color: var(--text-soft);
  margin-bottom: 36px; max-width: 440px; margin-left: auto; margin-right: auto;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 50px; }
.hero-scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 0.76rem; animation: bounce 2s infinite;
}
.scroll-arrow { width: 14px; height: 14px; border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim); transform: rotate(45deg); }

/* 宝可梦精灵 */
.poke-sprites { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.poke-sprite {
  position: absolute; image-rendering: pixelated; opacity: 0.85;
  animation: spriteFloat 5s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(92,74,56,0.15));
}
@keyframes spriteFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(3deg); }
  75% { transform: translateY(6px) rotate(-3deg); }
}

/* 粒子 */
.particle {
  position: absolute; border-radius: 50%; pointer-events: none;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0.3); opacity: 0; }
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 30px; border-radius: 28px;
  font-size: 0.95rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: none; transition: all 0.25s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #e88a4a);
  color: #fff; box-shadow: var(--shadow-btn);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(224, 93, 68, 0.4); }
.btn-outline {
  background: transparent; color: var(--text-soft); border: 2px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 8px 20px; font-size: 0.83rem; }

/* ==================== 通用区块 ==================== */
.section { padding: 70px 20px; }
.container { max-width: var(--max-w); margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 44px; }
.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.section-desc { color: var(--text-soft); font-size: 0.95rem; }

/* ==================== 标签 ==================== */
.news-tabs, .download-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.tab-btn {
  padding: 7px 20px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-soft); font-size: 0.86rem; font-weight: 500;
  cursor: pointer; transition: all 0.25s;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active { background: linear-gradient(135deg, var(--primary), #e88a4a); border-color: transparent; color: #fff; }

/* ==================== 新闻卡片 ==================== */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.news-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  cursor: pointer; transition: all 0.25s; box-shadow: var(--shadow);
}
.news-card:hover { transform: translateY(-3px); border-color: rgba(224,93,68,0.3); box-shadow: var(--shadow-lg); }
.news-card.pinned { border-color: var(--gold); }
.news-card.pinned::before {
  content: '置顶'; position: absolute; top: 12px; right: 14px;
  background: var(--gold); color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 8px;
}
html[lang="en"] .news-card.pinned::before { content: 'Pinned'; }
.news-card { position: relative; }
.news-category {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 600; margin-bottom: 10px;
}
.cat-news { background: var(--accent-soft); color: var(--accent); }
.cat-notice { background: var(--gold-soft); color: #a07a1a; }
.cat-update { background: var(--primary-soft); color: var(--primary); }
.cat-event { background: rgba(192,57,43,0.08); color: var(--danger); }
.news-card h3 {
  font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-summary {
  color: var(--text-soft); font-size: 0.85rem; margin-bottom: 12px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-meta { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 0.76rem; }
.news-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.page-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-soft); font-size: 0.84rem;
  cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ==================== 下载区 ==================== */
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-bottom: 40px; }
.download-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
  transition: all 0.25s; box-shadow: var(--shadow);
}
.download-card:hover { transform: translateY(-3px); border-color: rgba(224,93,68,0.3); box-shadow: var(--shadow-lg); }
.download-platform { font-size: 0.74rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.download-card h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 6px; color: var(--text); word-break: break-all; }
.download-size, .download-date, .download-version, .download-count { color: var(--text-dim); font-size: 0.78rem; margin-bottom: 4px; }
.download-btn {
  display: inline-block; padding: 10px 26px; border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), #e88a4a); color: #fff;
  font-weight: 600; font-size: 0.86rem; border: none; cursor: pointer;
  transition: all 0.25s; margin-top: 12px;
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(224,93,68,0.35); }

/* ==================== 关于我们 ==================== */
.about-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.about-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 24px; text-align: center;
  transition: all 0.25s; box-shadow: var(--shadow);
}
.about-card:hover { transform: translateY(-3px); border-color: rgba(224,93,68,0.25); }
.about-icon { font-size: 2.6rem; margin-bottom: 12px; }
.about-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; color: var(--primary); }
.about-card p { color: var(--text-soft); font-size: 0.85rem; line-height: 1.8; }

/* ==================== 页脚 ==================== */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 42px 20px 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 28px; max-width: var(--max-w); margin-left: auto; margin-right: auto; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand .logo-icon { font-size: 1.6rem; color: var(--primary); }
.footer-brand .logo-text { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.footer-brand p { color: var(--text-soft); font-size: 0.82rem; }
.footer-links h4 { color: var(--text); font-size: 0.92rem; font-weight: 600; margin-bottom: 12px; }
.footer-links a { display: block; color: var(--text-soft); font-size: 0.82rem; margin-bottom: 6px; transition: color 0.25s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 18px; border-top: 1px solid var(--border); max-width: var(--max-w); margin: 0 auto; }
.footer-bottom p { color: var(--text-dim); font-size: 0.72rem; line-height: 2; }
.footer-status { color: var(--success) !important; font-weight: 500; }

/* ==================== 空状态 / 加载 ==================== */
.loading-spinner { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--text-dim); animation: pulse 1.5s ease-in-out infinite; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 48px 20px; color: var(--text-dim); }
.empty-state .empty-icon { font-size: 2.6rem; margin-bottom: 10px; }
.empty-state p { font-size: 0.92rem; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(51, 36, 23, 0.45); backdrop-filter: blur(3px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: 82vh; overflow-y: auto;
  padding: 32px; position: relative; box-shadow: 0 16px 48px rgba(51,36,23,0.15);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-dim);
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.25s;
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.modal-category { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; margin-bottom: 10px; }
.modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.modal-meta { color: var(--text-dim); font-size: 0.8rem; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-body { color: var(--text-soft); line-height: 1.85; font-size: 0.9rem; white-space: pre-wrap; }

/* ==================== 论坛迷你列表 ==================== */
.forum-mini { max-width: 800px; margin: 0 auto; }
.forum-mini-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all .25s; gap: 12px; flex-wrap: wrap;
}
.forum-mini-item:hover { background: rgba(224,93,68,.04); }
.forum-mini-item:last-child { border-bottom: none; }
.forum-mini-cat {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 0.68rem; font-weight: 700; margin-right: 8px;
}
.forum-mini-title { font-size: 0.93rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-mini-meta { font-size: 0.76rem; color: var(--text-dim); white-space: nowrap; }
@media(max-width:768px){.forum-mini-item{padding:12px 10px;}.forum-mini-title{font-size:.85rem;}.forum-mini-meta{font-size:.72rem;}}

/* ==================== 动画 ==================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(7px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ==================== 移动端 (≤768px) ==================== */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .navbar { height: 54px; padding: 0 14px; }
  .nav-logo { font-size: 1rem; }
  .nav-menu {
    position: fixed; top: 54px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 14px 18px; gap: 2px; display: none;
    box-shadow: 0 6px 16px rgba(92,74,56,0.08);
  }
  .nav-menu.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-actions { gap: 6px; }
  .nav-username { max-width: 80px; font-size: 0.8rem; }
  .nav-auth-link { padding: 4px 12px; font-size: 0.78rem; }
  .lang-switch { padding: 4px 10px; font-size: 0.76rem; }

  .hero { min-height: 92vh; }
  .hero-content { padding: 0 16px; }
  .hero-subtitle { font-size: 0.92rem; margin-bottom: 30px; }
  .hero-actions { flex-direction: column; align-items: center; margin-bottom: 40px; }
  .hero-actions .btn { width: 220px; }
  .hero-scroll { bottom: 18px; }
  .poke-sprite { opacity: 0.5 !important; }

  .section { padding: 50px 14px; }
  .section-header { margin-bottom: 30px; }

  .news-grid, .download-grid, .about-content { grid-template-columns: 1fr; }
  .news-card { padding: 20px; }
  .download-card { padding: 20px; }
  .about-card { padding: 24px 20px; }

  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .modal-content { padding: 24px 20px; border-radius: var(--radius); }
  .modal-title { font-size: 1.15rem; }

  .tab-btn { padding: 6px 16px; font-size: 0.8rem; }
}

/* ==================== 小屏 (≤480px) ==================== */
@media (max-width: 480px) {
  .section { padding: 44px 12px; }
  .section-title { font-size: 1.35rem; }
  .hero-title { font-size: 1.55rem; }
  .btn { padding: 11px 26px; font-size: 0.88rem; }
  .tab-btn { padding: 5px 14px; font-size: 0.78rem; }
  .news-card h3 { font-size: 0.92rem; }
  .poke-sprite { display: none !important; }
}
