/*
Theme Name: Game Resource (RX Game Library)
Theme URI: https://example.com/game-resource
Author: Kilo Code
Author URI: https://example.com
Description: A modern game resource library theme based on RX Game Library design.
Version: 5.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: game-resource
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --nav-height: 64px;
}

/* Dark Mode Variables */
:root[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 确保 WordPress admin bar 不影响布局 */
html.wp-toolbar {
  padding-top: 0 !important;
}

#wpadminbar {
  position: fixed !important;
}

/* Background Decoration */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 50% 0%, #eff6ff, transparent 40%);
  pointer-events: none;
}

/* Hero Banner with Background Image */
.hero-banner-wrapper {
  position: relative;
  width: 100%;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  overflow: hidden;
}

.hero-banner-wrapper.has-bg {
  margin-top: -2rem;
  padding-top: 2rem;
}

.hero-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(3px);
  transform: scale(1.02);
  z-index: -1;
}

.hero-banner-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.75) 0%,
    rgba(248, 250, 252, 0.85) 50%,
    rgba(248, 250, 252, 0.95) 100%
  );
}

.hero-banner-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-banner-wrapper.has-bg .hero {
  padding-top: 4rem;
}

.hero-banner-wrapper.has-bg .hero-title {
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.hero-banner-wrapper.has-bg .stats-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.hero-banner-wrapper.has-bg .search-input-wrapper {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
}

@media (max-width: 640px) {
  .hero-banner-wrapper.has-bg {
    margin-top: -1rem;
    padding-top: 1rem;
  }
  
  .hero-banner-wrapper.has-bg .hero {
    padding-top: 2rem;
  }
}

/* Navigation Bar */
.site-header-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0;
  padding-right: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  height: 100%;
}

.logo-image {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
}

.main-navigation {
  display: flex;
  justify-content: flex-start;
}

.main-navigation ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a:hover {
  color: var(--primary);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.2s;
  border-radius: 2px;
}

.main-navigation a:hover::after {
  width: 100%;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 3rem;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  color: var(--text-main);
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.stats-container {
  display: inline-flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  background: #fff;
  padding: 1.25rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  position: relative;
}

.stat-card:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 30px;
  background-color: var(--border);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  font-weight: 500;
}

.stat-card.highlight .stat-value {
  color: var(--primary);
}

/* Search Section */
.search-section {
  margin-bottom: 3rem;
  position: sticky;
  top: calc(var(--nav-height) + 1rem); /* Stick below header */
  z-index: 50;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
}

.clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.clear-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.search-status {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  padding: 0.5rem;
  border-radius: 99px;
  display: inline-block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Results Section */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.resource-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
}

.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* 置顶文章样式 */
.resource-card.sticky-post {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.resource-card.sticky-post:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.sticky-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  letter-spacing: 0.5px;
}

.card-content {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.card-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.resource-category-pill {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-block;
}

.resource-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.resource-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.5;
  color: var(--text-main);
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Thumbnail */
.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
  background: #f1f5f9;
  position: relative;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.resource-card:hover .card-thumbnail img {
  transform: scale(1.08);
}

/* View Count Badge */
.view-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-count-badge svg {
  width: 12px;
  height: 12px;
  opacity: 0.9;
}

/* Single Page Styles */
.single-post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.single-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.single-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.single-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.single-preview {
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.single-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.single-content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.content-area {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main);
}

.content-area p {
    margin-bottom: 1.5rem;
}

.content-area img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.sidebar-area {
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    height: fit-content;
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
}

.download-btn {
    display: block;
    width: 100%;
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    transition: background 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.info-row:last-of-type {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
    color: var(--text-main);
}

.tag-pill {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 99px;
    display: inline-block;
    transition: all 0.2s;
}

.tag-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .single-content-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }
    .content-area {
        order: 1;
    }
    .sidebar-area {
        order: 2;
        margin-top: 2rem;
        margin-bottom: 0;
        position: static;
    }
}

/* Post Navigation */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.nav-previous, .nav-next {
    width: 100%;
}

.nav-previous a, .nav-next a {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-previous a:hover, .nav-next a:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.nav-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .nav-links {
        grid-template-columns: 1fr;
    }
}

/* Download Modal */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-modal.hidden {
    display: none;
}

.download-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.download-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2001;
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.download-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.download-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.download-options {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.download-option:hover {
    border-color: var(--primary);
    background: #f0f9ff;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.option-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: #f8fafc;
    padding: 2px;
}

.quark-icon {
    background: linear-gradient(135deg, #0084ff, #0056b3);
}

.baidu-icon {
    background: linear-gradient(135deg, #06a7ff, #0681ff);
}

.xunlei-icon {
    background: linear-gradient(135deg, #00a4ff, #0066cc);
}

.option-info {
    flex: 1;
}

.option-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pwd-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.option-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--primary);
    color: #fff;
}

.no-download {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Pagination */
.pagination {
  margin-top: 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.load-more-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.75rem 2rem;
  border-radius: 99px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.load-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle.active .menu-icon {
    display: none;
}

.mobile-menu-toggle.active .close-icon {
    display: block;
}

@media (max-width: 640px) {
    /* Mobile Header Layout - Logo left, Menu button right */
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }
    
    .site-header-nav {
        height: var(--nav-height);
        position: sticky;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide navigation by default on mobile */
    .main-navigation {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
        z-index: 999;
        box-shadow: var(--shadow-md);
    }
    
    .main-navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .main-navigation li {
        border-bottom: 1px solid var(--border);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem;
        font-size: 1rem;
        text-align: center;
    }
    
    .main-navigation a::after {
        display: none;
    }
    
    /* Hide header-actions content except toggle on mobile */
    .header-actions {
        order: 2;
    }
    
    .hero-title { font-size: 2rem; }
    .page { padding: 1rem; } /* Reduced padding */
    .stats-container { width: 100%; justify-content: space-around; padding: 1rem; }
    
    /* Mobile Grid - 2 Columns */
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Mobile Card Optimizations */
    .resource-card {
        padding: 0;
        border-radius: 8px; /* Slightly smaller radius */
    }
    
    .card-thumbnail {
        height: 120px; /* 移动端固定高度 */
        border-radius: 0;
        margin-bottom: 0;
    }

    .card-content {
        padding: 0.75rem;
    }
    
    .card-thumbnail img {
        object-fit: cover;
        object-position: center;
    }
    
    .resource-title {
        font-size: 0.95rem; /* Smaller title */
        line-height: 1.35;
        -webkit-line-clamp: 2;
    }
    
    .resource-category-pill {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .resource-date {
        font-size: 0.65rem;
    }
    
    .card-meta-top {
        margin-bottom: 0.35rem;
    }
    
    .view-count-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
        top: 6px;
        right: 6px;
    }
    
    .view-count-badge svg {
        width: 10px;
        height: 10px;
    }
}
/* Post Navigation */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-previous, .nav-next {
    width: 48%;
}

.nav-previous a, .nav-next a {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
    height: 100%;
}

.nav-previous a:hover, .nav-next a:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

/* Download Modal */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-modal.hidden {
    display: none;
}

.download-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.download-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2001;
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.download-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.download-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.download-options {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.download-option:hover {
    border-color: var(--primary);
    background: #f0f9ff;
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.quark-icon {
    background: linear-gradient(135deg, #0084ff, #0056b3);
}

.baidu-icon {
    background: linear-gradient(135deg, #06a7ff, #0681ff);
}

.option-info {
    flex: 1;
}

.option-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pwd-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.option-btn {
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.option-btn:hover {
    background: var(--primary);
    color: #fff;
}

.no-download {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

/* Download Modal QR Code Styles */
.download-tip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #fcd34d;
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.5;
}

.download-tip svg {
    flex-shrink: 0;
    color: #d97706;
}

/* Show QR Code Button */
.show-qrcode-btn {
    cursor: pointer;
    font-family: inherit;
}

.show-qrcode-btn.active {
    background: var(--primary);
    color: #fff;
}

/* QR Code Expand Area */
.qrcode-expand-area {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
    margin-top: -0.5rem;
    animation: slideDown 0.3s ease;
}

.qrcode-expand-area.hidden {
    display: none !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qrcode-container {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.qrcode-container canvas,
.qrcode-container img {
    max-width: 100%;
    max-height: 100%;
}

.qrcode-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* Desktop/Mobile visibility classes */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 640px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
}

/* Announcement Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-surface);
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2001;
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-body);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-main);
  line-height: 1.6;
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.modal-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Adjust for when announcement is not present */
body .site-header-nav {
    top: 0;
}

body .search-section {
    top: calc(var(--nav-height) + 1rem);
}


/* Guestbook Section */
.guestbook-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.guestbook-hero {
    text-align: center;
    padding: 3rem 0 2rem;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    margin-bottom: 1rem;
}

/* Top Area: Form + Stats */
.guestbook-top-area {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guestbook-form-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.form-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.guestbook-form-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.form-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nickname-group {
    width: 200px;
    flex-shrink: 0;
}

.message-group {
    flex: 1;
    position: relative;
}

.nickname-input, .message-input-line {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-body);
    color: var(--text-main);
    transition: all 0.2s;
}

.message-input-line {
    padding-right: 40px; /* Space for emoji trigger */
}

.nickname-input:focus, .message-input-line:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--bg-surface);
}

.emoji-trigger {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-trigger:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.emoji-picker {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-top: 8px;
    z-index: 10;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-item {
    cursor: pointer;
    font-size: 1.25rem;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.emoji-item:hover {
    background: var(--bg-body);
    transform: scale(1.2);
}

.submit-btn {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    white-space: nowrap;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mini Stats */
.guestbook-stats-mini {
    display: flex;
    justify-content: center;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.875rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.stat-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.stat-text strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Grid Layout - 4 columns */
.guestbook-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    align-items: start;
}

/* Legacy masonry class for compatibility */
.guestbook-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.guestbook-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s;
    break-inside: avoid;
    overflow: hidden;
    min-width: 0;
}

.guestbook-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.delete-message-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
}

.guestbook-card:hover .delete-message-btn {
    opacity: 1;
}

.delete-message-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.delete-message-btn svg {
    width: 14px;
    height: 14px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.message-author {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.card-body {
    color: var(--text-main);
    line-height: 1.5;
    font-size: 0.9rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Admin Reply Section */
.admin-reply-section {
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    overflow: hidden;
}

.admin-reply-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.admin-avatar {
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.admin-avatar svg {
    width: 12px;
    height: 12px;
}

.admin-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.reply-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.delete-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}

.delete-reply-btn svg {
    width: 12px;
    height: 12px;
}

.delete-reply-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.admin-reply-content {
    color: var(--text-main);
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Admin Reply Form */
.admin-reply-form-wrapper {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.admin-reply-form-wrapper.hidden {
    display: none;
}

.toggle-reply-form-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-reply-form-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--primary);
}

.admin-reply-form {
    margin-top: 0.75rem;
}

.admin-reply-form.hidden {
    display: none;
}

.admin-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    background: var(--bg-surface);
    color: var(--text-main);
    transition: all 0.2s;
}

.admin-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cancel-reply-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-reply-btn:hover {
    background: var(--bg-surface);
    color: var(--text-main);
}

.submit-reply-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-reply-btn:hover {
    background: var(--primary-hover);
}

.submit-reply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Card with reply indicator */
.guestbook-card.has-reply {
    border-color: rgba(37, 99, 235, 0.3);
}

.empty-guestbook-wide {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

/* Guestbook Pagination */
.guestbook-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.page-btn:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.page-num:hover:not(.current) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-num.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-dots {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* Responsive breakpoints for guestbook grid */
@media (max-width: 1200px) {
    .guestbook-grid,
    .guestbook-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .guestbook-grid,
    .guestbook-masonry {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nickname-group {
        width: 100%;
    }
    
    .guestbook-grid,
    .guestbook-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .guestbook-hero {
        padding: 2rem 0;
    }
    
    /* Pagination mobile */
    .guestbook-pagination {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .page-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .page-numbers {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .page-num {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .guestbook-grid,
    .guestbook-masonry {
        grid-template-columns: 1fr;
    }
}


/* ====================================================================================
   Steam Media Gallery Styles - 双Swiper联动模式
   ==================================================================================== */

.steam-media-section {
    margin-bottom: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.steam-media-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.75rem;
}

.steam-media-title svg {
    color: var(--primary);
    flex-shrink: 0;
}

/* 双Swiper容器 */
.steam-gallery-container {
    position: relative;
    width: 100%;
}

/* 主显示区 - Gallery Top */
.gallery-top {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
}

.gallery-top .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 缩略图导航 - Gallery Thumbs */
.gallery-thumbs {
    width: 100%;
    height: 80px;
    padding: 0.5rem 0;
}

.gallery-thumbs .swiper-slide {
    width: auto !important;
    height: 100%;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.media-thumb-item {
    position: relative;
    width: 120px;
    height: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f1f5f9;
}

.media-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 视频缩略图播放图标覆盖层 */
.thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.thumb-overlay svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.steam-media-gallery {
    position: relative;
    width: 100%;
    overflow: visible;
    margin: 0 -10px;
    padding: 0 10px;
}

.steam-media-gallery .swiper-wrapper {
    display: flex;
    align-items: stretch;
    padding-bottom: 10px;
}

.steam-media-gallery .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
}

.media-item {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 比例 */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.media-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.media-item img,
.media-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-item video {
    cursor: pointer;
}

.media-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(37, 99, 235, 0.9);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Swiper Navigation Buttons - 主显示区 */
.gallery-top .swiper-button-prev,
.gallery-top .swiper-button-next {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.gallery-top .swiper-button-prev:after,
.gallery-top .swiper-button-next:after {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary);
}

.gallery-top .swiper-button-prev:hover,
.gallery-top .swiper-button-next:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.gallery-top .swiper-button-prev:hover:after,
.gallery-top .swiper-button-next:hover:after {
    color: #fff;
}

.gallery-top .swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 旧版单一轮播样式保留（兼容性） */
.steam-media-gallery .swiper-button-prev,
.steam-media-gallery .swiper-button-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.steam-media-gallery .swiper-button-prev:after,
.steam-media-gallery .swiper-button-next:after {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}

.steam-media-gallery .swiper-button-prev:hover,
.steam-media-gallery .swiper-button-next:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.steam-media-gallery .swiper-button-prev:hover:after,
.steam-media-gallery .swiper-button-next:hover:after {
    color: #fff;
}

.steam-media-gallery .swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Swiper Pagination */
.steam-media-gallery .swiper-pagination {
    position: relative;
    margin-top: 1.5rem;
    bottom: auto;
}

.steam-media-gallery .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: var(--border);
    opacity: 1;
    transition: all 0.3s;
}

.steam-media-gallery .swiper-pagination-bullet-active {
    background: var(--primary);
    width: 24px;
    border-radius: 5px;
}

/* Video Item Hover Effect */
.video-item:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Image Item Hover Effect */
.image-item img {
    transition: transform 0.5s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .steam-media-gallery {
        margin: 0;
        padding: 0;
    }
    
    .media-thumb-item {
        width: 100px;
    }
}

/* Mobile Responsive - 双Swiper联动模式 */
@media (max-width: 768px) {
    .steam-media-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .steam-media-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .steam-media-title svg {
        width: 18px;
        height: 18px;
    }
    
    /* 双Swiper容器 - 移动端 */
    .steam-gallery-container {
        width: 100%;
        overflow: hidden;
    }
    
    /* 主显示区 - 移动端 */
    .gallery-top {
        width: 100%;
        margin-bottom: 0.75rem;
        border-radius: var(--radius-md);
    }
    
    .gallery-top .swiper-slide {
        width: 100%;
    }
    
    /* 主显示区的媒体项 */
    .gallery-top .media-item {
        width: 100%;
        padding-bottom: 56.25%; /* 16:9 */
        border-radius: var(--radius-md);
    }
    
    .gallery-top .media-item img,
    .gallery-top .media-item video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #000;
    }
    
    /* 缩略图导航 - 移动端优化 */
    .gallery-thumbs {
        height: 60px;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .gallery-thumbs .swiper-wrapper {
        display: flex;
    }
    
    .gallery-thumbs .swiper-slide {
        width: 90px !important;
        flex-shrink: 0;
    }
    
    .media-thumb-item {
        width: 90px;
        height: 60px;
    }
    
    /* 隐藏主显示区导航按钮 */
    .gallery-top .swiper-button-prev,
    .gallery-top .swiper-button-next {
        display: none;
    }
    
    /* 移动端轮播容器 - 填满宽度 */
    .steam-media-gallery {
        margin: 0;
        padding: 0 1.25rem 1.25rem;
        overflow: hidden;
        max-width: 100%;
        width: 100%;
    }
    
    .steam-media-gallery .swiper-wrapper {
        padding-bottom: 0;
        max-width: 100%;
    }
    
    /* 每张幻灯片填满容器 */
    .steam-media-gallery .swiper-slide {
        width: 100%;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* 图片/视频容器 - 填满并美化 */
    .media-item {
        padding-bottom: 56.25%; /* 恢复标准16:9 */
        border-radius: var(--radius-md);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        margin: 0;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .media-item img,
    .media-item video {
        border-radius: var(--radius-md);
    }
    
    /* 隐藏导航按钮 */
    .steam-media-gallery .swiper-button-prev,
    .steam-media-gallery .swiper-button-next {
        display: none;
    }
    
    /* 分页器样式优化 */
    .steam-media-gallery .swiper-pagination {
        position: relative;
        margin-top: 1.25rem;
        bottom: auto;
    }
    
    .steam-media-gallery .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 5px;
        background: var(--border);
        opacity: 1;
    }
    
    .steam-media-gallery .swiper-pagination-bullet-active {
        width: 24px;
        background: var(--primary);
        border-radius: 4px;
    }
    
    /* 标签样式 */
    .media-label {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
        top: 8px;
        left: 8px;
    }
}

/* 小屏手机优化 */
@media (max-width: 640px) {
    .steam-media-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .steam-media-title {
        font-size: 1.125rem;
        margin-bottom: 0.875rem;
    }
    
    /* 双Swiper容器 */
    .steam-gallery-container {
        width: 100%;
    }
    
    /* 主显示区 */
    .gallery-top {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .gallery-top .media-item {
        width: 100%;
        padding-bottom: 56.25%;
    }
    
    /* 缩略图 */
    .gallery-thumbs {
        height: 55px;
    }
    
    .gallery-thumbs .swiper-slide {
        width: 80px !important;
    }
    
    .media-thumb-item {
        width: 80px;
        height: 55px;
    }
    
    /* 旧版轮播容器填满 */
    .steam-media-gallery {
        padding: 0;
        margin: 0;
        overflow: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .steam-media-gallery .swiper-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .steam-media-gallery .swiper-slide {
        width: 100% !important;
        max-width: 100%;
    }
    
    /* 图片填满容器 */
    .steam-media-gallery .media-item {
        padding-bottom: 56.25%;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .steam-media-gallery .media-item img,
    .steam-media-gallery .media-item video {
        border-radius: 12px;
    }
    
    .steam-media-gallery .swiper-pagination {
        margin-top: 1rem;
        padding: 0;
    }
    
    .media-label {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
        top: 8px;
        left: 8px;
        backdrop-filter: blur(8px);
        background: rgba(37, 99, 235, 0.95);
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .steam-media-section {
        padding: 0.875rem;
    }
    
    .steam-media-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .steam-media-title svg {
        width: 16px;
        height: 16px;
    }
    
    /* 双Swiper - 超小屏 */
    .gallery-thumbs {
        height: 50px;
    }
    
    .gallery-thumbs .swiper-slide {
        width: 75px !important;
    }
    
    .media-thumb-item {
        width: 75px;
        height: 50px;
    }
    
    /* 旧版轮播 */
    .steam-media-gallery {
        padding: 0;
        margin: 0;
    }
    
    .steam-media-gallery .media-item {
        padding-bottom: 56.25%;
        border-radius: 10px;
        width: 100%;
    }
    
    .steam-media-gallery .media-item img,
    .steam-media-gallery .media-item video {
        border-radius: 10px;
    }
}

/* Latest Games Section */
.latest-games-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

.more-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.more-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.more-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.more-link:hover svg {
    transform: translateX(2px);
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.25rem;
    }
    .more-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Disclaimer Section */
.disclaimer-section {
    max-width: 1200px;
    margin: 3rem auto 2rem;
    padding: 0 1.5rem;
}

.disclaimer-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
    position: relative;
}

/* Inner decorative frame */
.disclaimer-container::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    pointer-events: none;
}

.disclaimer-title {
    color: #2563eb;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    letter-spacing: 1px;
}

.disclaimer-content {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.8;
}

.disclaimer-content p {
    margin: 0;
}


/* ====================================================================================
   文章详情页文字溢出修复
   ==================================================================================== */

/* 修复文章详情页所有文本内容的溢出问题 */
.single-post .entry-content,
.single-post .post-content,
.single-post .article-content,
.single-post-container .content-area {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow-x: hidden;
}

/* 修复段落、div等块级元素的文字溢出 */
.single-post .entry-content p,
.single-post .entry-content div,
.single-post .entry-content span,
.single-post-container .content-area p,
.single-post-container .content-area div {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 修复长URL和链接溢出 */
.single-post .entry-content a,
.single-post-container .content-area a {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 修复代码块溢出 - 添加横向滚动 */
.single-post .entry-content pre,
.single-post .entry-content code,
.single-post-container .content-area pre,
.single-post-container .content-area code {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: normal;
    white-space: pre-wrap;
    word-break: normal;
}

.single-post .entry-content pre {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow-x: auto;
}

/* 修复表格溢出 - 添加响应式包装器 */
.single-post .entry-content table,
.single-post-container .content-area table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    word-break: normal;
    border-collapse: collapse;
}

.single-post .entry-content table td,
.single-post .entry-content table th,
.single-post-container .content-area table td,
.single-post-container .content-area table th {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 300px;
    padding: 0.5rem;
}

/* 修复图片和媒体元素溢出 */
.single-post .entry-content img,
.single-post .entry-content video,
.single-post .entry-content iframe,
.single-post-container .content-area img,
.single-post-container .content-area video,
.single-post-container .content-area iframe {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* 修复嵌入内容溢出 */
.single-post .entry-content iframe,
.single-post-container .content-area iframe {
    max-width: 100%;
    border: none;
}

/* 修复列表溢出 */
.single-post .entry-content ul,
.single-post .entry-content ol,
.single-post-container .content-area ul,
.single-post-container .content-area ol {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    padding-left: 2rem;
}

.single-post .entry-content li,
.single-post-container .content-area li {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 修复引用块溢出 */
.single-post .entry-content blockquote,
.single-post-container .content-area blockquote {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 1rem;
    border-left: 4px solid var(--primary);
    background: #f8fafc;
    margin: 1rem 0;
}

/* 移动端额外优化 */
@media (max-width: 768px) {
    .single-post .entry-content,
    .single-post-container .content-area {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .single-post .entry-content pre,
    .single-post-container .content-area pre {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .single-post .entry-content table,
    .single-post-container .content-area table {
        font-size: 0.85rem;
    }
    
    .single-post .entry-content table td,
    .single-post .entry-content table th,
    .single-post-container .content-area table td,
    .single-post-container .content-area table th {
        max-width: 200px;
        padding: 0.4rem;
    }
}


/* ====================================================================================
   移动端显示优化 - 修复右侧截断和padding过大问题
   ==================================================================================== */

/* 平板端优化 */
@media(max-width: 768px) {
    .single-post-container {
        padding: 1.5rem 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .single-title {
        font-size: 1.75rem;
        word-wrap: break-word;
    }
}

/* 手机端优化 */
@media (max-width: 640px) {
    .page {
        padding: 0.5rem;
        width: 100%;
        overflow-x: hidden;
    }
    
    .single-post-container {
        padding: 1rem 0.75rem;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .single-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .single-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    /* Steam媒体区域全宽显示 */
    .steam-gallery-container,
    .steam-media-section {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .steam-media-section {
        padding: 0.75rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        width: calc(100% + 1.5rem);
        max-width: calc(100% + 1.5rem);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .gallery-top {
        border-radius: 0;
    }

    .gallery-top .media-item {
        border-radius: 0;
    }
}
