/* ==========================================
   词元妈妈 - AI News Blog
   Style inspired by animal-island-ui
   ========================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;700&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
  /* Primary (Mint Teal) */
  --primary: #19c8b9;
  --primary-hover: #3dd4c6;
  --primary-active: #11a89b;
  --primary-bg: #e6f9f6;

  /* Text (Warm Brown) */
  --text: #794f27;
  --text-body: #725d42;
  --text-secondary: #9f927d;
  --text-muted: #8a7b66;
  --text-disabled: #c4b89e;

  /* Borders */
  --border: #9f927d;
  --border-light: #c4b89e;

  /* Backgrounds (Cream/Parchment) */
  --bg: #f8f8f0;
  --bg-content: rgb(247, 243, 223);
  --bg-secondary: #f0e8d8;
  --bg-green: #7DC395;

  /* Status */
  --success: #6fba2c;
  --warning: #f5c31c;
  --error: #e05a5a;

  /* Game Special */
  --focus-yellow: #ffcc00;
  --focus-yellow-dark: #e0b800;
  --sidebar-active: #B7C6E5;

  /* 3D Shadow */
  --shadow-btn: #bdaea0;
  --shadow-input: #d4c9b4;

  /* Card Colors */
  --card-pink: #f8a6b2;
  --card-purple: #b77dee;
  --card-blue: #889df0;
  --card-yellow: #f7cd67;
  --card-orange: #e59266;
  --card-teal: #82d5bb;
  --card-green: #8ac68a;
  --card-red: #fc736d;

  /* Sizing */
  --radius-sm: 12px;
  --radius-base: 18px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --border-width: 2px;
  --font-family: 'Nunito', 'Noto Sans SC', 'Zen Maru Gothic', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 500;
  color: var(--text-body);
  background-color: var(--bg);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Game Cursor ---------- */
.game-cursor,
.game-cursor * {
  cursor: url('../img/cursor-icon.png') 4 0, auto !important;
}

/* ---------- Page Background ---------- */
.page-bg {
  background: var(--bg-green);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}
.page-bg-compact {
  min-height: auto;
}

/* ---------- Decorative Wave Top ---------- */
.wave-top {
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0,30 C200,60 400,0 600,30 C800,60 1000,0 1200,30 L1200,60 L0,60Z' fill='%23f8f8f0'/%3E%3C/svg%3E") repeat-x center bottom;
  background-size: 1200px 60px;
}

/* ---------- Navigation ---------- */
.navbar {
  background: var(--bg);
  border-bottom: var(--border-width) solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 0 0 var(--shadow-input);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}
.navbar-brand .brand-icon {
  font-size: 28px;
}
.navbar-brand .brand-accent {
  color: var(--primary);
}

.navbar-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.navbar-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  border-radius: var(--radius-pill);
  border: var(--border-width) solid transparent;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}
.navbar-links a:hover,
.navbar-links a.active {
  background: var(--sidebar-active);
  color: var(--text);
  border-color: var(--border-light);
}

/* ---------- Container ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero Section ---------- */
.hero {
  background: var(--bg);
  padding: 60px 0 48px;
  text-align: center;
}
.hero-compact {
  padding: 32px 0 24px;
}
.hero-compact .hero-title {
  font-size: 30px;
  margin-bottom: 8px;
}
.hero-compact .hero-subtitle {
  font-size: 15px;
  margin-bottom: 0;
}

.hero-title {
  font-size: 42px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.hero-title .accent {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  border: var(--border-width) solid var(--border-light);
  background: var(--bg-content);
  color: var(--text-body);
  transition: all 0.2s;
}
.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 3px 0 0 var(--shadow-btn);
}
.tag-emoji {
  font-size: 16px;
}
.hero-tags a.tag {
  color: var(--text-body);
}
.hero-tags a.tag:hover {
  color: var(--primary);
}

/* ---------- Section ---------- */
.section {
  padding: 40px 0;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.section-icon {
  font-size: 28px;
}
.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}
.section-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.section-title-link:hover {
  color: var(--primary);
}
.section-more {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  transition: all 0.2s;
}
.section-more:hover {
  color: var(--primary-hover);
  gap: 6px;
}
.section-divider {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #f7cd67,
    #f7cd67 6px,
    #f8f8f0 6px,
    #f8f8f0 12px
  );
  border-radius: 6px;
  margin: 0 0 32px;
  opacity: 0.6;
}

/* ---------- Article List ---------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-content);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-base);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  box-shadow: 0 2px 0 0 var(--shadow-input);
}
.article-list-item:hover {
  transform: translateX(4px);
  border-color: var(--primary);
  box-shadow: 0 3px 0 0 var(--shadow-btn);
}

.list-emoji {
  font-size: 36px;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.list-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.list-date {
  font-size: 12px;
  color: var(--text-disabled);
  font-weight: 600;
}

.list-arrow {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.article-list-item:hover .list-arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .article-list-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .list-meta {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }
  .list-excerpt {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ---------- Article Card Grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card-animate {
  opacity: 0;
}

/* ---------- Article Card ---------- */
.article-card {
  background: var(--bg-content);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 0 0 var(--shadow-input);
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 7px 0 0 var(--shadow-btn);
  border-color: var(--primary);
}

.card-banner {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}
.card-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to top, var(--bg-content), transparent);
}

.card-banner-blue { background: var(--card-blue); }
.card-banner-teal { background: var(--card-teal); }
.card-banner-orange { background: var(--card-orange); }
.card-banner-purple { background: var(--card-purple); }
.card-banner-pink { background: var(--card-pink); }
.card-banner-green { background: var(--card-green); }
.card-banner-yellow { background: var(--card-yellow); }
.card-banner-red { background: var(--card-red); }

.card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-date {
  font-size: 12px;
  color: var(--text-disabled);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.card-title a {
  color: inherit;
}
.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary-active);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  transition: all 0.2s;
}
.read-more:hover {
  gap: 8px;
  color: var(--primary-hover);
}

/* ---------- 3D Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 15px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  border: var(--border-width) solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
  user-select: none;
  outline: none;
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  color: var(--text);
  background: var(--bg);
  border-color: var(--bg);
  box-shadow: 0 5px 0 0 var(--shadow-btn);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 0 var(--shadow-btn);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 var(--shadow-btn);
}

.btn-outline {
  color: var(--text);
  background: var(--bg-content);
  border-color: var(--border);
  box-shadow: 0 3px 0 0 var(--shadow-input);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 0 var(--shadow-btn);
}

.btn-teal {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 5px 0 0 var(--primary-active);
}
.btn-teal:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 0 var(--primary-active);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---------- Article Page ---------- */
.article-page {
  background: var(--bg);
  padding: 40px 0 60px;
}

.article-header {
  max-width: 780px;
  margin: 0 auto 32px;
  padding: 0 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-meta-tag {
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary-active);
}

.article-meta-date {
  font-size: 13px;
  color: var(--text-disabled);
  font-weight: 600;
}

.article-page-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.article-page-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-banner-deco {
  max-width: 780px;
  margin: 0 auto 36px;
  padding: 0 24px;
}

.article-banner-card {
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  font-size: 72px;
  border: var(--border-width) solid var(--border);
  box-shadow: 0 5px 0 0 var(--shadow-btn);
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Article Content Typography */
.article-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 40px 0 16px;
  padding-left: 16px;
  border-left: 4px solid var(--primary);
  letter-spacing: 0.01em;
}

.article-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 18px;
  line-height: 1.8;
  font-size: 15.5px;
}

.article-content ul,
.article-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}
.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  font-size: 15px;
}

.article-content strong {
  color: var(--text);
  font-weight: 700;
}

.article-content blockquote {
  background: var(--bg-content);
  border: var(--border-width) solid var(--border-light);
  border-radius: var(--radius-base);
  padding: 18px 22px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-muted);
  position: relative;
}
.article-content blockquote::before {
  content: '🌿';
  position: absolute;
  top: -12px;
  left: 16px;
  font-size: 20px;
  font-style: normal;
  background: var(--bg);
  padding: 0 6px;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-active);
  font-family: 'Courier New', monospace;
}

.article-content pre {
  background: #2b2118;
  color: #e6ddd0;
  padding: 22px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.7;
  border: 1px solid #3d3028;
}
.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-weight: 500;
}

/* Info Card inside articles */
.info-card {
  background: var(--bg-content);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin: 24px 0;
  box-shadow: 0 3px 0 0 var(--shadow-input);
}
.info-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.info-table th,
.info-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.info-table th {
  font-weight: 700;
  color: var(--text);
  background: var(--bg-secondary);
  border-radius: 0;
}
.info-table th:first-child { border-radius: 10px 0 0 0; }
.info-table th:last-child { border-radius: 0 10px 0 0; }
.info-table tr:last-child td { border-bottom: none; }

/* ---------- Back Link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  transition: gap 0.2s;
}
.back-link:hover {
  gap: 10px;
  color: var(--primary-hover);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 40px;
}

.footer-wave {
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80'%3E%3Cpath d='M0,40 C150,70 350,10 600,40 C850,70 1050,10 1200,40 L1200,80 L0,80Z' fill='%2319c8b9'/%3E%3Cpath d='M0,50 C150,75 350,25 600,50 C850,75 1050,25 1200,50 L1200,80 L0,80Z' fill='%2311a89b'/%3E%3C/svg%3E") repeat-x center bottom;
  background-size: 1200px 80px;
}

.footer-body {
  background: var(--primary-active);
  padding: 28px 0 32px;
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
}
.footer-body a {
  color: #fff;
}
.footer-body a:hover {
  color: var(--focus-yellow);
}

.footer-brand {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

/* ---------- Decorative Leaf Divider ---------- */
.leaf-divider {
  text-align: center;
  padding: 20px 0;
  font-size: 24px;
  opacity: 0.5;
  letter-spacing: 12px;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  border: var(--border-width) solid var(--border-light);
  background: var(--bg-content);
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 0 0 var(--shadow-input);
}
.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 0 var(--shadow-btn);
}
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 0 0 var(--primary-active);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}
.empty-state p {
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ---------- Typewriter Effect ---------- */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary);
  white-space: nowrap;
  animation: typing 2s steps(20, end), blink-caret 0.75s step-end infinite;
  display: inline-block;
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }
  .navbar-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero-title {
    font-size: 30px;
  }
  .hero-subtitle {
    font-size: 16px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .article-page-title {
    font-size: 26px;
  }
  .article-banner-card {
    padding: 24px;
    font-size: 48px;
  }
  .section-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 36px 0 28px;
  }
  .hero-title {
    font-size: 26px;
  }
  .container {
    padding: 0 16px;
  }
}
