/*
Theme Name: 游仓
Theme URI: https://example.com/youcang
Author: 猫大大
Author URI: https://example.com
Description: 一个专注于游戏资源分享的 WordPress 主题，采用 Brutalism 游戏风格设计
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: youcang
Tags: game, resource, share, blog, brutalism, gaming, user-profile

游仓 - 游戏资源分享主题
作者：猫大大
更新：2026-04-26
*/

/* === CSS 变量系统 === */
:root {
  /* 布局容器宽度 */
  --container-max-width: 1800px;
  --container-padding-mobile: 1rem;      /* 16px */
  --container-padding-desktop: 2rem;     /* 32px */
  
  /* 基础颜色（纯色，禁止渐变） */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-active: #3730a3;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --border: #e5e7eb;
  
  /* 间距系统 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* 字体系统 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
  
  /* 圆角 */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* 过渡 */
  --transition: 0.2s ease;
}

/* === 背景图案 === */
.bg-dot-pattern {
  background-image: radial-gradient(#D1D5DB 1px, transparent 1px);
  background-size: 16px 16px;
}

/* === 统一容器类 === */
.site-container {
  max-width: var(--container-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--container-padding-mobile) !important;
  padding-right: var(--container-padding-mobile) !important;
}

@media (min-width: 1024px) {
  .site-container {
    padding-left: var(--container-padding-desktop) !important;
    padding-right: var(--container-padding-desktop) !important;
  }
}

/* === 基础样式 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg-secondary);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* === 容器 === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* === 头部 === */
.site-header {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* === 主内容区 === */
.site-main {
  padding: var(--space-xl) 0;
}

/* 确保main标签宽度正确 */
main {
  width: 100% !important;
}

/* === 评论表单样式 === */
.comment-form {
    margin: 0;
}

.comment-form p {
    margin: 0 0 1rem 0;
}

.comment-form .comment-form-comment {
    margin-bottom: 1rem;
}

.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url {
    margin-bottom: 0;
}

.comment-form .form-submit {
    margin: 0;
}

.comment-form .form-submit input[type="submit"] {
    display: none;
}

/* 评论表单三栏布局 */
.comment-form-fields-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .comment-form-fields-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === 登录弹窗样式 === */
.tab-btn {
    background-color: #f1f5f9;
    color: #0f172a;
}

.tab-btn.active,
.tab-btn[data-tab="login"]:first-child {
    background-color: #ffffff;
    color: #0f172a;
    border-bottom: 4px solid #ef4444;
    margin-bottom: -4px;
}

#login-modal input[type="checkbox"] {
    accent-color: #ef4444;
}

/* 表单内容默认隐藏 */
#login-modal .tab-content {
    display: none !important;
}

/* 激活的表单显示 */
#login-modal .tab-content.tab-active {
    display: flex !important;
}

/* === 文章列表 === */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.post-card {
  background-color: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-content {
  padding: var(--space-md);
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.post-meta {
  display: flex;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === 底部 === */
.site-footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
  text-align: center;
  color: var(--text-secondary);
}

/* === Hero轮播动画效果 === */

/* 扫描线动画 */
@keyframes heroScanLine {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

.hero-scan-line.active {
  animation: heroScanLine 0.8s ease-out;
}

/* 故障效果动画 */
@keyframes heroGlitch {
  0%, 100% {
    opacity: 0;
    transform: translate(0, 0);
  }
  10% {
    opacity: 0.8;
    transform: translate(-2px, 2px);
    background: #ff0000;
  }
  20% {
    opacity: 0.8;
    transform: translate(2px, -2px);
    background: #00ff00;
  }
  30% {
    opacity: 0.8;
    transform: translate(-2px, -2px);
    background: #0000ff;
  }
  40% {
    opacity: 0;
  }
}

.hero-glitch.active {
  animation: heroGlitch 0.3s ease-in-out;
}

/* 图片切换淡入效果 */
.hero-image {
  transition: opacity 0.5s ease-in-out, transform 0.7s ease-out;
}

.hero-image.fade-out {
  opacity: 0 !important;
}

.hero-image.fade-in {
  opacity: 0.8 !important;
  animation: heroImageFadeIn 0.6s ease-out forwards;
}

@keyframes heroImageFadeIn {
  0% {
    opacity: 0;
    filter: brightness(1.5) contrast(1.2);
  }
  50% {
    filter: brightness(1.3) contrast(1.1);
  }
  100% {
    opacity: 0.8;
    filter: brightness(1) contrast(1);
  }
}

/* 标题切换效果 */
.hero-title {
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.hero-title.fade-out {
  opacity: 0 !important;
  transform: translateY(20px) !important;
}

.hero-title.fade-in {
  animation: heroTitleFadeIn 0.5s ease-out forwards;
}

@keyframes heroTitleFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  60% {
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 信息区域切换效果 */
.hero-info {
  transition: opacity 0.3s ease-out;
}

.hero-info.fade-out {
  opacity: 0 !important;
}

.hero-info.fade-in {
  animation: heroInfoFadeIn 0.6s ease-out forwards;
}

@keyframes heroInfoFadeIn {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* 列表项切换效果 */
.hero-game-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-game-item.switching {
  animation: heroItemPulse 0.5s ease-out;
}

@keyframes heroItemPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.98);
    box-shadow: inset 0 0 20px rgba(239, 68, 68, 0.3);
  }
}

/* 数据加载效果 */
@keyframes heroDataLoad {
  0% {
    content: "▌";
  }
  25% {
    content: "▌▌";
  }
  50% {
    content: "▌▌▌";
  }
  75% {
    content: "▌▌▌▌";
  }
  100% {
    content: "▌▌▌▌▌";
  }
}

/* === 导航菜单样式 === */

/* 普通菜单项 - 默认状态 */
a.nav-menu-item {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 2px solid #0f172a !important;
    box-shadow: 2px 2px 0 #0f172a !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 普通菜单项 - 悬停状态 */
a.nav-menu-item:hover {
    background-color: #ef4444 !important;
    color: #facc15 !important;
    border-color: #0f172a !important;
    transform: translate(-1px, -1px) !important;
    box-shadow: 3px 3px 0 #0f172a !important;
}

/* 普通菜单项 - 点击状态 */
a.nav-menu-item:active {
    transform: translate(1px, 1px) !important;
    box-shadow: none !important;
}

/* 当前激活菜单项 - 默认状态 */
a.nav-menu-item-active {
    background-color: #ef4444 !important;
    color: #facc15 !important;
    border: 2px solid #0f172a !important;
    box-shadow: 2px 2px 0 #0f172a !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 当前激活菜单项 - 悬停状态 */
a.nav-menu-item-active:hover {
    transform: translate(-1px, -1px) !important;
    box-shadow: 3px 3px 0 #0f172a !important;
}

/* 当前激活菜单项 - 点击状态 */
a.nav-menu-item-active:active {
    transform: translate(1px, 1px) !important;
    box-shadow: none !important;
}
