/* ============================================
   Android Weekly Theme - Magazine Style 2025
   Modern, Clean, Readable Design
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */

:root {
  /* Brand Colors - Red Accent Theme */
  --brand-primary: #ff4040;
  --brand-primary-light: #ff5c5c;
  --brand-primary-dark: #e63535;
  --brand-secondary: #7a7a7a;
  --brand-accent: #ff4040;

  /* Light Mode by Default - Clean & Readable */
  --bg-base: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f9fafb;
  --bg-subtle: #f3f4f6;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  --border-default: #e5e7eb;
  --border-subtle: #f3f4f6;

  /* Semantic Colors */
  --link-color: #111827;
  --link-hover: #374151;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Typography - Medium-like Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --font-serif: 'Source Serif 4', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --font-display: var(--font-serif);
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* Font Sizes - Fluid Typography */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 0.925rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --text-4xl: clamp(2.5rem, 2rem + 3vw, 4rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width: 1280px;
  --content-width: 720px;
  --sidebar-width: 320px;
  --header-height: 64px;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 40px rgba(0, 210, 106, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-tooltip: 500;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-base: #0a0a0b;
  --bg-elevated: #111113;
  --bg-muted: #18181b;
  --bg-subtle: #27272a;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #0a0a0b;

  --border-default: #27272a;
  --border-subtle: #1f1f23;

  --link-color: #fafafa;
  --link-hover: #d4d4d8;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4), 0 4px 8px rgba(0,0,0,0.35);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

::selection {
  background: #d1d5db;
  color: var(--text-inverse);
}

/* ============================================
   Header - Floating Glass Style
   ============================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: var(--z-fixed);
  transition: all var(--transition-slow);
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

[data-theme="dark"] .header::before {
  background: rgba(9, 9, 11, 0.8);
}

.header.scrolled::before {
  opacity: 1;
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

/* Hero mode - header colors for light mode */
.header.on-hero .logo,
.header.on-hero .nav-link {
  color: #374151;
}

[data-theme="dark"] .header.on-hero .logo,
[data-theme="dark"] .header.on-hero .nav-link {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.header.on-hero.scrolled .logo,
.header.on-hero.scrolled .nav-link {
  color: #374151;
  text-shadow: none;
}

[data-theme="dark"] .header.on-hero.scrolled .logo,
[data-theme="dark"] .header.on-hero.scrolled .nav-link {
  color: var(--text-secondary);
}

/* Inner pages - always show glass header */
.page-inner .header::before {
  opacity: 1;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.logo-icon-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.logo:hover {
  color: #1f2937;
}

.logo-text {
  color: #001428; /* Deep blue from palette */
}

[data-theme="dark"] .logo-text {
  color: #e5e7eb;
}

/* Navigation - Right aligned */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .nav-link {
  color: var(--text-secondary);
}

.nav-link:hover {
  color: #1f2937;
}

[data-theme="dark"] .nav-link:hover {
  color: var(--text-primary);
}

/* Icon Button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-default);
  background: transparent;
  color: #374151;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .icon-btn {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.icon-btn:hover {
  background: var(--bg-muted);
  color: #1f2937;
  border-color: #d1d5db;
}

[data-theme="dark"] .icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* Theme Toggle Icons */
.icon-btn .icon-sun,
.icon-btn .icon-moon {
  display: none;
}

.icon-btn .icon-moon {
  display: block;
}

[data-theme="dark"] .icon-btn .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-btn .icon-moon {
  display: none;
}

/* Subscribe Button */
.btn-text {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #1f2937;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-text:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
}

[data-theme="dark"] .btn-text {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--text-secondary);
}

[data-theme="dark"] .btn-text:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
}

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #1f2937;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-subscribe:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
}

[data-theme="dark"] .btn-subscribe {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-subscribe:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 64, 64, 0.3);
}

.btn-primary:hover {
  background: var(--brand-primary-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 64, 64, 0.4);
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.btn-outline {
  border: 1.5px solid var(--border-default);
  color: var(--text-primary);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(255, 64, 64, 0.05);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Hero Section - Immersive Design
   ============================================ */

.hero-fullscreen {
  position: relative;
  min-height: 50vh;
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-base);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

[data-theme="dark"] .hero-bg {
  background: linear-gradient(180deg, #0a0a0b 0%, #111113 100%);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 64, 64, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(122, 122, 122, 0.04), transparent);
}

[data-theme="dark"] .hero-bg::before {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 64, 64, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(122, 122, 122, 0.06), transparent);
}

/* Animated mesh gradient */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.hero-overlay {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--space-6);
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 64, 64, 0.1);
  border: 1px solid rgba(255, 64, 64, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: #ff4040;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-6);
  animation: fadeInUp 0.6s ease-out;
}

[data-theme="dark"] .hero-badge {
  background: rgba(255, 64, 64, 0.15);
  border: 1px solid rgba(255, 64, 64, 0.3);
  color: #ff4040;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #ff4040;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

[data-theme="dark"] .hero-badge::before {
  background: #ff4040;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

[data-theme="dark"] .hero-title {
  color: #fff;
}

.hero-title .highlight {
  color: #ff4040;
}

[data-theme="dark"] .hero-title .highlight {
  color: #ff4040;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--space-6);
  line-height: 1.7;
  animation: fadeInUp 0.6s ease-out 0.15s both;
}

[data-theme="dark"] .hero-subtitle {
  color: rgba(255,255,255,0.7);
}

.hero-typing {
  font-size: var(--text-xl);
  color: #4b5563;
  margin-bottom: var(--space-8);
  min-height: 2em;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

[data-theme="dark"] .hero-typing {
  color: rgba(255,255,255,0.7);
}

.typing-text {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  color: var(--brand-primary);
  animation: blink 1s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.btn-hero {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.btn-hero-primary {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}

.btn-hero-primary:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-hero-primary {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-hero-primary:hover {
  background: #ff4040;
  color: #fff;
  border-color: #ff4040;
}

/* Scroll Indicator - Hidden since hero is shorter */
.scroll-down {
  display: none;
}

/* ============================================
   Main Content Layout
   ============================================ */

.main-content {
  min-height: calc(100vh - 200px);
  background: var(--bg-base);
  position: relative;
}

/* Transition from hero removed - hero is now shorter */

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-8);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  position: relative;
  z-index: 1;
}

/* ============================================
   Article Card - Main Content (Clean Style)
   ============================================ */

.latest-issue,
.post-detail {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

/* Issue Header */
.issue-header {
  padding: var(--space-6);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(to bottom, var(--bg-muted), var(--bg-elevated));
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: #1f2937;
}

.issue-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

[data-theme="dark"] .issue-badge {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.issue-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.issue-number {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.separator {
  display: none;
}

.issue-meta time {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Sponsor Banner */
.sponsor-banner {
  margin: 0 var(--space-6) var(--space-4);
  padding: var(--space-3);
  background: var(--bg-muted);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  text-align: center;
}

.sponsor-label {
  display: inline-block;
  padding: 2px 6px;
  background: var(--text-muted);
  color: var(--bg-elevated);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  margin-right: var(--space-2);
}

.sponsor-content p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: inline;
}

.sponsor-content a {
  color: var(--link-color);
  font-weight: 500;
}

/* Issue Content */
.issue-content {
  padding: var(--space-6);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
}

/* Hide duplicate first h1 (title already in header) */
.issue-content > h1:first-child {
  display: none;
}

/* Section headers - Clean style */
.issue-content h1,
.issue-content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-10) 0 var(--space-5);
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid var(--border-default);
  display: block;
}

.issue-content h1::before,
.issue-content h2::before {
  display: none;
}

.issue-content h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: var(--space-6) 0 var(--space-3);
}

/* Intro paragraph (first p after hidden h1) */
.issue-content > p:first-of-type,
.issue-content > h1:first-child + p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border-left: 3px solid #d1d5db;
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

/* Subscription channels line */
.issue-content > p:nth-of-type(2) {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.issue-content p {
  margin: 0 0 var(--space-4);
}

.issue-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================
   Lists Base Styles - Medium Clean Style
   ========================================== */

.issue-content ol,
.issue-content ul {
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
}

/* ==========================================
   Ordered Lists (ol) - Medium Style Articles
   Clean, minimal, elegant
   ========================================== */

.issue-content > ol {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.issue-content > ol > li {
  position: relative;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.6;
}

.issue-content > ol > li:last-child {
  border-bottom: none;
}

/* No hover effects - keep it clean */
.issue-content > ol > li:hover {
  background: transparent;
}

/* Article link styling - bold BLACK title, larger font */
.issue-content ol li > a:first-child,
.issue-content ol li > strong:first-child a {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: #1a1a1a;
  display: block;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
}

[data-theme="dark"] .issue-content ol li > a:first-child,
[data-theme="dark"] .issue-content ol li > strong:first-child a {
  color: #fafafa;
}

.issue-content ol li > a:first-child:hover,
.issue-content ol li > strong:first-child a:hover {
  color: #ff4040;
  transform: translateY(-2px);
  text-decoration: underline;
  text-decoration-color: #ff4040;
  text-underline-offset: 4px;
}

[data-theme="dark"] .issue-content ol li > a:first-child:hover,
[data-theme="dark"] .issue-content ol li > strong:first-child a:hover {
  color: #ff4040;
  text-decoration-color: #ff4040;
}

/* External link arrow for article titles */
.issue-content ol li > a:first-child[href^="http"]::after,
.issue-content ol li > strong:first-child a[href^="http"]::after {
  content: '↗';
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7em;
  opacity: 0.3;
  vertical-align: middle;
  transition: all var(--transition-fast);
}

.issue-content ol li > a:first-child[href^="http"]:hover::after,
.issue-content ol li > strong:first-child a[href^="http"]:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

/* Nested ordered lists (sub-articles) */
.issue-content ol li > ol {
  margin-top: var(--space-4);
  margin-bottom: 0;
  padding-left: var(--space-4);
  gap: 0;
  border-left: none;
}

.issue-content ol li ol li {
  padding: var(--space-2) 0;
  border-bottom: none;
  font-size: var(--text-sm);
}

.issue-content ol li ol li a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--link-color);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.issue-content ol li ol li a:hover {
  color: #ff4040;
  text-decoration: underline;
  text-decoration-color: #ff4040;
  text-underline-offset: 2px;
}

[data-theme="dark"] .issue-content ol li ol li a:hover {
  color: #ff4040;
  text-decoration-color: #ff4040;
}

.issue-content ol li ol li:hover {
  background: transparent;
}

/* ==========================================
   Unordered Lists (ul) - Simple Bullet Lists
   For sections like 投稿指南, 版权声明
   ========================================== */

.issue-content > ul {
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.issue-content > ul > li {
  position: relative;
  padding-left: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Bullet point */
.issue-content > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
}

.issue-content > ul > li a {
  color: #1a1a1a;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: #d1d5db;
  text-underline-offset: 3px;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .issue-content > ul > li a {
  color: #fafafa;
  text-decoration-color: #4b5563;
}

.issue-content > ul > li a:hover {
  color: #ff4040;
  text-decoration-color: #ff4040;
  transform: translateY(-1px);
}

[data-theme="dark"] .issue-content > ul > li a:hover {
  color: #ff4040;
  text-decoration-color: #ff4040;
}

/* External link icon for ul list links */
.issue-content > ul > li a[href^="http"]::after {
  content: '↗';
  display: inline-block;
  margin-left: 4px;
  font-size: 0.75em;
  opacity: 0.5;
}

/* Nested unordered lists */
.issue-content ul ul {
  margin-top: var(--space-2);
  padding-left: var(--space-4);
  gap: var(--space-1);
}

.issue-content ul ul li {
  font-size: var(--text-base);
}

.issue-content ul ul li::before {
  width: 4px;
  height: 4px;
  background: var(--text-muted);
}

/* Blockquote */
.issue-content blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--brand-secondary);
  background: var(--bg-muted);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Code */
.issue-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: #e11d48;
}

[data-theme="dark"] .issue-content code {
  color: #fb7185;
}

.issue-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: var(--space-5);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
  border: 1px solid #334155;
}

.issue-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Images */
.issue-content img {
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-md);
}

/* Issue Footer */
.issue-footer {
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-muted);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.share-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #1f2937;
}

.original-link {
  margin-top: var(--space-4);
}

.original-link a {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Post Navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
}

.nav-prev,
.nav-next {
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-base);
}

.nav-prev:hover,
.nav-next:hover {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}

.nav-next {
  text-align: right;
}

.nav-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.nav-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  max-height: calc(100vh - var(--header-height) - var(--space-12));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 2px;
}

.sidebar-section {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Archive List */
.archive-list {
  list-style: none;
}

.archive-item {
  border-bottom: 1px solid var(--border-subtle);
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-item a {
  display: block;
  padding: var(--space-3) 0;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.archive-item a:hover {
  color: #1f2937;
  transform: translateX(4px);
}

.archive-title {
  font-size: var(--text-sm);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.archive-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.view-all {
  display: block;
  text-align: center;
  padding: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.view-all:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Social Links */
.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: #e5e7eb;
  color: #1f2937;
  transform: translateY(-2px);
}

.sponsor-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.btn-block {
  width: 100%;
}

/* ============================================
   Archive Page
   ============================================ */

.archive-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + var(--space-10)) var(--space-6) var(--space-10);
}

.archive-page {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  padding: var(--space-8);
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.page-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.archive-year {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #1f2937;
  margin: var(--space-8) 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid #e5e7eb;
}

.archive-year-posts {
  display: grid;
  gap: var(--space-2);
}

.archive-post a {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-base);
}

.archive-post a:hover {
  background: var(--bg-elevated);
  border-color: #d1d5db;
  transform: translateX(4px);
}

.archive-post time {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 90px;
}

.archive-post h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ============================================
   Page Content
   ============================================ */

.page-content {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  padding: var(--space-8);
  max-width: var(--content-width);
  margin: calc(var(--header-height) + var(--space-10)) auto var(--space-10);
}

.page-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-6);
}

.page-content p {
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.page-content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-4);
  color: var(--text-primary);
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* Table styles for about page */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--text-base);
}

.page-content table th,
.page-content table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.page-content table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-content table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  width: 120px;
}

.page-content table a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-default);
  text-underline-offset: 2px;
}

.page-content table a:hover {
  text-decoration-color: var(--text-primary);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  background: var(--bg-muted);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-12) 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-info p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.footer-info a {
  color: #4b5563;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #1f2937;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .sidebar-section {
    flex: 1;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-typing {
    font-size: var(--text-lg);
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .btn-hero {
    width: 100%;
    max-width: 280px;
  }

  .issue-content {
    padding: var(--space-5);
  }

  .issue-header {
    padding: var(--space-5);
  }

  .post-nav {
    grid-template-columns: 1fr;
    padding: var(--space-5);
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-6);
    text-align: center;
  }

  .sidebar {
    flex-direction: column;
  }

  .sidebar-section {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .issue-number {
    font-size: var(--text-xl);
  }

  .issue-content h1,
  .issue-content h2 {
    font-size: var(--text-lg);
  }

  .issue-content li {
    padding: var(--space-4);
  }
}

/* ============================================
   Enhanced Article List Styles (2025 Redesign)
   Medium-like Clean Style + Dark Theme
   ============================================ */

/* Article items - title and description on separate lines */
.issue-content > ol > li {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) 0;
}

/* Article title - serif font, bold BLACK */
.issue-content > ol > li > strong:first-child {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.35;
  display: block;
  letter-spacing: -0.02em;
}

.issue-content > ol > li > strong:first-child a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .issue-content > ol > li > strong:first-child a {
  color: #fafafa;
}

.issue-content > ol > li > strong:first-child a:hover {
  text-decoration: underline;
  color: #1a1a1a;
}

[data-theme="dark"] .issue-content > ol > li > strong:first-child a:hover {
  color: #fafafa;
}

/* Article description - below title, lighter color */
.issue-content > ol > li > p {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: #6b7280;
  line-height: 1.7;
  margin: 0;
}

[data-theme="dark"] .issue-content > ol > li > p {
  color: #9ca3af;
}

/* ============================================
   Animations & Utilities
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.latest-issue,
.post-detail {
  animation: fadeIn 0.5s ease-out;
}

.sidebar-section {
  animation: fadeIn 0.5s ease-out;
}

.sidebar-section:nth-child(1) { animation-delay: 0.1s; animation-fill-mode: both; }
.sidebar-section:nth-child(2) { animation-delay: 0.2s; animation-fill-mode: both; }
.sidebar-section:nth-child(3) { animation-delay: 0.3s; animation-fill-mode: both; }

/* Focus visible */
:focus-visible {
  outline: 2px solid #ff4040;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Print styles */
@media print {
  .header,
  .sidebar,
  .hero-fullscreen,
  .footer,
  .share-buttons,
  .post-nav {
    display: none !important;
  }

  .content-wrapper {
    display: block;
  }

  .latest-issue,
  .post-detail {
    box-shadow: none;
    border: none;
  }
}

/* ============================================
   Search Modal
   ============================================ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  visibility: hidden;
  opacity: 0;
  transition: all var(--transition-base);
}

.search-modal.active {
  visibility: visible;
  opacity: 1;
}

.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .search-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.search-modal-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 70vh;
  margin: 0 var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-20px) scale(0.95);
  transition: transform var(--transition-base);
}

.search-modal.active .search-modal-content {
  transform: translateY(0) scale(1);
}

/* Search Header */
.search-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-muted);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: #ff4040;
  box-shadow: 0 0 0 3px rgba(255, 64, 64, 0.1);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-close-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.search-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.search-hint {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

/* Search Results */
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.search-empty,
.search-loading,
.search-error {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.search-empty p,
.search-loading p,
.search-error p {
  margin: 0;
}

.search-tip {
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.search-error {
  color: var(--error);
}

.search-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* Search Result Items - 与文章列表风格一致 */
.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-muted);
  margin: 0 calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-radius: var(--radius-md);
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  letter-spacing: -0.01em;
}

.search-result-snippet {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* 关键词高亮 - 红色 */
.search-highlight {
  background: transparent;
  color: #dc2626;
  font-weight: 600;
}

[data-theme="dark"] .search-highlight {
  color: #f87171;
}

/* Responsive */
@media (max-width: 640px) {
  .search-modal {
    padding-top: 5vh;
  }

  .search-modal-content {
    max-height: 80vh;
    margin: 0 var(--space-3);
  }

  .search-header {
    padding: var(--space-3);
  }

  .search-results {
    padding: var(--space-3);
  }

  .search-result-title {
    font-size: 1rem;
  }
}
