/* ===== 基础重置与通用设置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: 'Noto Sans SC', 'Noto Sans', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-bottom: 50px;
}


/* ===== 头部样式 ===== */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#site-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.2rem;
    color: #f1c40f;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: #34495e;
}

.language-switch {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.language-switch button {
    padding: 0.5rem 1rem;
    border: none;
    background: #f1f1f1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-switch button:hover {
    background: #ddd;
}

.language-switch button.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}


/* ===== 主内容区 ===== */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1c40f;
}

footer {
    background: #f1f1f1;
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

/* ===== 卡牌列表容器（主页）===== */
.card-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 每行显示 5 张 */
    grid-template-rows: repeat(2, auto);   /* 总共 2 行 */
    gap: 1rem;                             /* 卡片之间的间距 */
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 100%;
    height: 320px; /* 提高图片高度 */
    object-fit: contain; /* 完整显示图片，避免裁剪 */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
}

.card h3 {
    text-align: center;
    font-size: 1.1rem;
    margin: 0 0 10px;
    color: #2c3e50;
}

.card-details {
    padding: 0.5rem;
    background-color: #f9f9f9;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

.card-details div {
    margin: 0.2em 0;
}


/* ===== 首页小卡牌列表样式 ===== */
.home-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 20px;
}

.home-card-list .card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.home-card-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.home-card-list .card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 8px;
}

.home-card-list .card h3 {
    text-align: center;
    font-size: 1rem;
    margin: 0 0 8px;
    color: #2c3e50;
}

.home-card-list .card-details {
    padding: 0.4rem;
    background-color: #f9f9f9;
    font-size: 0.8rem;
    line-height: 1.4;
    flex-grow: 1;
}

.home-card-list .card-details div {
    margin: 0.2em 0;
}


/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .card-list {
        grid-template-columns: repeat(3, 1fr); /* 中屏幕3列 */
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .card-list {
        grid-template-columns: repeat(2, 1fr); /* 小屏幕2列 */
    }
}

@media (max-width: 480px) {
    .card-list {
        grid-template-columns: 1fr; /* 手机1列 */
    }
}




/* ===== 返回顶部按钮 ===== */
.back-to-top-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    padding: 10px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}

.back-to-top-btn:hover {
    background-color: #2980b9;
}

/* ===== 分页控件 ===== */
.pagination {
    text-align: center;
    margin-top: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    margin: 0 0.3rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background-color: #2980b9;
}

/* ===== 搜索框 ===== */
.search-box {
    margin-bottom: 1rem;
    text-align: center;
}

.search-box input[type="text"] {
    width: 80%;
    max-width: 400px;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.page-info {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* ===== 新闻ner标签 ===== */

.new-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: text-top;
}

.tag {
    background-color: #f1c40f;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
}


/* ===== 产品表格 ===== */
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed; /* 必加 */
}

.product-table th,
.product-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.product-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.product-table td img {
    max-width: 50px;
    vertical-align: middle;
}

/* ===== 筛选器标签按钮 ===== */
.filter-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag.active {
    background-color: #3498db;
    color: white;
}


/* ===== 卡牌表格样式 ===== */
.card-table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.card-table th,
.card-table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid #ddd;
}

.card-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.card-table img {
    max-width: 50px;
    height: auto;
}



/* ===== 卡牌详情页样式 ===== */

/* 居中布局 */
.card-detail-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: #f9f9f9;
}

.card-detail-section {
    width: 100%;
    max-width: 800px;
    margin: auto;
}

.card-detail-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.card-detail {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.card-detail h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #2c3e50;
}

.card-detail img {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
}

.card-details {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.card-details div {
    margin-bottom: 0.6rem;
}

.card-details strong {
    min-width: 100px;
    display: inline-block;
    text-align: left;
    font-weight: bold;
    color: #2980b9;
}

.card-details pre {
    white-space: pre-wrap; /* 允许自动换行 */
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    font-family: inherit;
}

.back-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    font-size: 1rem;
}

.back-button:hover {
    background-color: #2980b9;
}




/* ===== 卡牌筛选器页面专用样式 ===== */

/* 筛选区域 */
.filter-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.filter-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-bar strong {
    font-size: 1rem;
    margin-right: 1rem;
}

.filter-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background-color: #ecf0f1;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-size: 1.2rem;
}

.filter-tag.active {
    background-color: #3498db;
    color: white;
}

.card-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.card-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.card-table th,
.card-table td {
    padding: 0.8rem;
    text-align: left;
    border: 1px solid #ddd;
}

.card-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

.card-table img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

.pagination {
    margin-top: 2rem;
    text-align: center;
}

.pagination button {
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
}

.pagination button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}


.floating-back-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.floating-back-btn:hover {
    background-color: #2980b9;
}


/* ===== 游戏规则页面专用样式 ===== */

/* ===== 基础样式设置 ===== */
.rule-section {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.rule-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.rule-section h3 {
    font-size: 1.4rem;
    color: #34495e;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}

.rule-section h4 {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-top: 1rem;
}

.rule-section ol,
.rule-section ul {
    padding-left: 2rem;
    list-style-position: inside;
}

.rule-section li {
    margin-bottom: 0.5rem;
    color: #333;
}

.rule-section li::marker {
    color: #3498db;
    font-size: 1.2em;
}


/* ===== 图片相关样式 ===== */
.rule-images {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.rule-images img {
    max-width: 45%;
    cursor: zoom-in;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.rule-images img:hover {
    transform: scale(1.02);
}


/* ===== 规则文档链接 ===== */
.rule-document-link {
    margin: 2rem 0;
}

.rule-document-link a {
    font-size: 1.2rem;
    text-decoration: none;
    color: #3498db;
    display: inline-block;

    /* 添加下面这行，确保 emoji 正常显示 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}


/* ===== 分隔线样式：中间带小花样的横线 ===== */
.divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3rem 0;
    color: #ccc;
}

.divider hr {
    flex: 1;
    border: 0;
    height: 1px;
    background-color: #ccc;
}

.divider span {
    padding: 0 1rem;
    font-size: 1.2rem;
    color: #aaa;
}


/* ===== 视频容器样式 ===== */
.video-container {
    max-width: 600px;
    margin: auto;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 6:5 比例 */
    background: #000;
    overflow: hidden;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* ===== 游戏介绍样式 ===== */
#game-intro-text {
    line-height: 1.8;
    color: #333;
    font-size: 1.1rem;
}

#game-intro-text p {
    margin-bottom: 1.5rem;           /* 段落之间留白 */
    text-align: justify;             /* 两端对齐，更正式 */
    hyphens: auto;                   /* 自动断词（可选） */
}

/* ===== 小节标题样式 ===== */
#game-intro-text .section-title {
    font-size: 1.3rem;           /* 比正文大 */
    font-weight: 700;            /* 加粗 */
    color: #e67e22;              /* 橙色强调色，可换成 #c97a1d 古风金 */
    margin: 0rem 0 1rem 0;       /* 上下留白，与段落区分 */
    padding-left: 0;             /* 左对齐 */
    text-align: left;            /* 确保左对齐 */
    border-bottom: 2px solid #f0e4d7; /* 可选：加一条装饰线 */
    display: inline-block;       /* 防止全宽拉伸 */
}


/* 正文段落保持左对齐 */
#game-intro-text p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    text-align: left;
    color: #333;
    font-size: 1.1rem;
}

/* 在小屏幕上自适应 */
@media (max-width: 768px) {
    #game-intro {
        padding: 1rem;
    }
    #game-intro-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    #game-intro h2 {
        font-size: 1.6rem;
    }
}



/* 卡片容器 */
.card-item {
  display: flex;
  flex-direction: column;
  width: 180px;
  height: 280px;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 卡名区域 */
.card-name {
  margin: 0;
  padding: 8px 10px 6px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图片容器 */
.card-image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  background: #f0f0f0;
  padding: 10px;
}

.card-image-container img {
  max-width: 90%;
  max-height: 120px;
  object-fit: contain;
}

/* 详情区域 */
.card-details {
  font-size: 13px;
  padding: 8px 10px;
  line-height: 1.5;
  background: #fafafa;
  border-top: 1px solid #eee;
}

.card-details div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
}

/* 响应式布局（可选） */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 10px;
}
