/* ============================================
   FreeGame - 全站样式表
   适配奶白风浅色主题
   ============================================ */

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* ============================================
   通用基础（所有页面共享）
   ============================================ */
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #fafafa;
    color: #1f2937;
}

h1, h2, h3 {
    text-transform: capitalize;
}

/* 重置 ul 默认样式（footer/list 使用） */
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   站点导航栏 - .site-header
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e5e7eb;
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header-side {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.site-logo:hover {
    color: #9333ea;
}

.site-logo i {
    margin-right: 0.5rem;
    color: #9333ea;
}

/* 导航图标按钮（搜索/分类/用户） */
.nav-icon-btn {
    color: #4b5563;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav-icon-btn:hover {
    color: #9333ea;
}

/* 返回按钮（带箭头） */
.nav-back-btn {
    color: #4b5563;
    transition: color 0.2s;
}

.nav-back-btn:hover {
    color: #9333ea;
}

/* 当前页高亮（用户中心图标） */
.nav-icon-btn-active {
    color: #9333ea;
}

/* ============================================
   主内容区 - .site-main / .site-section
   ============================================ */
.site-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.site-section {
    margin-bottom: 2rem;
}

/* 模块标题行（标题 + 右侧链接） */
.section-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ============================================
   页面标题 - .page-title / .page-subtitle
   ============================================ */
.page-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #111827;
}

.page-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin-top: 0.25rem;
}

/* 模块小标题 */
.section-title {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* ============================================
   卡片基础 - .card-base / .card-base-sm
   ============================================ */
.card-base {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.card-base-sm {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* 卡片小标题（about/terms/privacy 等内容页） */
.card-title {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* ============================================
   文本与列表（内容页通用）
   ============================================ */
.text-body {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5rem;
    margin-bottom: 1rem;
}

.text-muted {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* 项目列表（disc + 缩进） */
.article-list {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5rem;
    list-style-type: disc;
    list-style-position: inside;
    padding-left: 0;
}

.article-list > li + li {
    margin-top: 0.5rem;
}

/* 无标记列表（仅间距） */
.stack-list > li + li {
    margin-top: 0.75rem;
}

/* ============================================
   按钮 - .btn-primary 系列
   ============================================ */
.btn-primary {
    background-color: #9333ea;
    color: #ffffff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #7e22ce;
}

/* 圆角大按钮（Load More 等） */
.btn-primary-pill {
    background-color: #9333ea;
    color: #ffffff;
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary-pill:hover {
    background-color: #7e22ce;
}

/* 小圆角按钮（编辑资料等） */
.btn-primary-small {
    background-color: #9333ea;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary-small:hover {
    background-color: #7e22ce;
}

/* "更多" 链接 */
.more-link {
    color: #a855f7;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.more-link:hover {
    color: #9333ea;
}

/* 危险按钮（清除历史等） */
.btn-danger-text {
    color: #ef4444;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-danger-text:hover {
    color: #dc2626;
}

/* ============================================
   表单输入 - .form-input
   ============================================ */
.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.form-field {
    margin-bottom: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ============================================
   站点页脚 - .site-footer
   ============================================ */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.site-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-col-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.footer-col-desc {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1rem;
    margin-bottom: 0.75rem;
}

.footer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.footer-link {
    color: #6b7280;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #9333ea;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social-link {
    color: #6b7280;
    transition: color 0.2s;
}

.footer-social-link:hover {
    color: #9333ea;
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* ============================================
   首页 - index.html
   ============================================ */
/* Daily Pick 每日精选卡片 */
.daily-pick {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.daily-pick:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* 分类卡片 */
.category-card {
    transition: transform 0.3s ease;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    transform: scale(1.05);
}

/* ============================================
   分类页 - category.html
   ============================================ */
/* 分类页卡片变体 */
.category-page-card {
    transition: all 0.3s ease;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-page-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* 当前激活的分类 */
.category-active {
    border: 2px solid #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* ============================================
   游戏卡片（index / category / search / game / user）
   ============================================ */
.game-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background-color: #ffffff;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

/* 播放按钮 */
.play-button {
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.05);
}

/* ============================================
   游戏详情页 - game.html
   ============================================ */
/* 游戏预览区 */
.game-preview {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* 播放覆盖层 */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-preview:hover .play-overlay {
    opacity: 1;
}

/* 大播放按钮 */
.play-button-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.play-button-large:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 1);
}

/* ============================================
   用户中心 - user.html
   ============================================ */
.profile-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 开关 toggle 容器 */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.toggle-track {
    width: 2.75rem;
    height: 1.5rem;
    background-color: #d1d5db;
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-track {
    background-color: #9333ea;
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(100%);
    border-color: #ffffff;
}

.toggle-switch input:focus + .toggle-track {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* ============================================
   联系页 - contact.html
   ============================================ */
.contact-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 社交媒体圆形按钮 */
.social-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #374151;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background-color 0.3s ease;
}

.social-icon-btn:hover {
    background-color: #9333ea;
}

/* 联系信息小图标圆 */
.contact-info-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #9333ea;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-right: 1rem;
}

/* ============================================
   FAQ 页 - faq.html
   ============================================ */
.faq-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.faq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* ============================================
   隐私页 - privacy.html
   ============================================ */
.privacy-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.privacy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   搜索页 - search.html
   ============================================ */
/* 热门搜索标签 */
.tag-chip {
    display: inline-block;
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.tag-chip:hover {
    background-color: #9333ea;
    color: #ffffff;
}

/* ============================================
   第二批语义化类 - 进一步抽取常用 utility 组合
   ============================================ */

/* 游戏卡片网格（响应式：手机2列 / 平板4列 / 桌面6列） */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 640px) { .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .games-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* 游戏卡片网格 - 4 列变体（手机2列 / 桌面4列） */
.games-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 768px) { .games-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 分类导航网格 - 始终 4 列 */
.category-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

/* 内容双列网格（手机单列 / 桌面双列） */
.content-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) { .content-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 统计数据 4 列网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 垂直间距容器（替代 space-y-*） */
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-md > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.5rem; }

/* 水平间距容器（替代 space-x-*） */
.row-gap > * + * { margin-left: 1rem; }

/* 行布局：两端对齐（替代 flex justify-between items-center） */
.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 行布局：两端对齐 + 底部间距 */
.row-between-mb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* 行布局：水平排列（替代 flex items-center） */
.row-center {
    display: flex;
    align-items: center;
}

/* 文本列表（替代 text-gray-600 text-sm space-y-2） */
.text-list {
    color: #4b5563;
    font-size: 0.875rem;
}
.text-list > * + * { margin-top: 0.5rem; }

/* 设置项行（用户中心） */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 圆形头像容器 - 用户中心（80x80 紫色） */
.avatar-circle {
    width: 5rem;
    height: 5rem;
    background-color: #9333ea;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-right: 1rem;
}

/* 圆形分类图标容器 - 首页分类入口（48x48） */
.category-icon-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 0.5rem;
}
.category-icon-circle-purple { background-color: #9333ea; }
.category-icon-circle-blue   { background-color: #2563eb; }
.category-icon-circle-green  { background-color: #16a34a; }
.category-icon-circle-red    { background-color: #dc2626; }

/* FAQ 题目行（替代 flex justify-between items-center cursor-pointer） */
.faq-question-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* FAQ 箭头图标（替代 text-gray-500 transition-transform duration-300） */
.faq-arrow {
    color: #6b7280;
    transition: transform 0.3s ease;
}

/* FAQ 答案内容区（替代 mt-3 text-gray-600 text-sm） */
.faq-answer-content {
    margin-top: 0.75rem;
    color: #4b5563;
    font-size: 0.875rem;
}

/* FAQ 项增强（替代 p-4 border-b border-gray-200） */
.faq-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.faq-item:last-child { border-bottom: none; }

/* FAQ 卡片增强（替代 bg-white shadow-sm border border-gray-200 rounded-lg） */
.faq-card {
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

/* 行布局：顶部对齐（替代 flex items-start） */
.row-top {
    display: flex;
    align-items: flex-start;
}

/* 设置项容器（替代 border-b border-gray-200 p-4 / p-4） */
.setting-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.setting-item:last-child { border-bottom: none; }

/* 增强分类卡片（替代 rounded-lg p-4 flex flex-col items-center） */
.category-card {
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 搜索条（input + button 组合） */
.search-bar {
    display: flex;
}
.search-bar-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: #ffffff;
    color: #1f2937;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.search-bar-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}
.search-bar-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    background-color: #9333ea;
    color: #ffffff;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.search-bar-btn:hover {
    background-color: #7e22ce;
}
