/* 基础重置与字体 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family:
        "Noto Sans SC",          /* Google 版思源黑体 */
        "Source Han Sans SC",    /* Adobe 版名称（旧系统） */
        "PingFang SC",          /* macOS 苹方 */
        "Microsoft YaHei",      /* Windows 雅黑 */
        "WenQuanYi Micro Hei",  /* Linux 文泉驿 */
        sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 40px; /* 为固定底部栏留出空间 */
}

/* 导航栏样式 */
.navbar {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 0.25rem;
}
.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

/* 新增：导航链接容器 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem; /* 使用相对单位，间距会随字体大小变化 */
}

/* 导航链接样式 */
.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap; /* 防止文字换行 */
}

.nav-link:hover {
    color: #007bff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-links {
        gap: 0.75rem; /* 在小屏幕上减小间距 */
    }
    
    .nav-link {
        font-size: 0.9rem; /* 在小屏幕上减小字体 */
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: 0.5rem; /* 在非常小的屏幕上进一步减小间距 */
    }
    
    .nav-link {
        font-size: 0.85rem; /* 在非常小的屏幕上进一步减小字体 */
    }
}

.site-logo { 
    width:32px; 
    height:32px; 
    border-radius:6px;
    object-fit: contain;
    margin-right:8px; 
    vertical-align:middle; 
}
.logo {
    display: inline-flex;   /* 关键：行内弹性 */
    align-items: center;    /* 垂直居中 */
    gap: 8px;               /* 图-文间距 */
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}
.nav-link {
    color: #6c757d;
    text-decoration: none;
}
.nav-link:hover {
    color: #007bff;
}

/* 主容器 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
}
.container h1 { 
    font-size: 1.5rem; 
} 

/* 首页网格布局 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}
.article-card:hover {
    transform: translateY(-2px);
    transition:transform .2s ease
}
.article-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.article-content {
    display: flex;               /* 标题+副标同一行 */
    justify-content: space-between;
    align-items: baseline;
    padding: 1rem;    
}

.article-content a {
    text-decoration: none;
}

.article-content h2 {
    margin-bottom: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
    color: #2c3e50;
    white-space: nowrap;         /* 标题不换行 */
}
.article-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.75rem;
    text-decoration: none;
    text-align: right;           /* 右侧对齐 */
    flex-shrink: 0;   
}
.article-card a { 
    text-decoration: none; 
}

/* 更新提示卡片 - 高度 = 普通卡片一半 */
.update-hint .article-content {
  height: 80px;                 /* 160÷2 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.update-hint .article-cover {
  background: #fff;          /* 纯白色 */
  height: 160px;
  width: 100%;
  object-fit: cover;
  display: block;
}

.update-hint p {
  font-size: 0.75rem;           /* 与副标题同阶 */
  color: #999;
  margin: 0;
}

/* 固定底部栏 */
.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.cta-button {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    border: none;
}
.cta-button:hover {
    background-color: #0056b3;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    color: #495057;
    border-top: 1px solid #e9ecef;
    font-size: 12px; /* 整体字号调小 */
}

/* 备案信息行 */
.footer-beian {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.beian-link {
    display: inline-flex;
    align-items: center;
    color: #6c757d !important; /* 强制灰色，去掉蓝色 */
    text-decoration: none !important; /* 去掉下划线 */
    font-size: 12px;
    transition: color 0.3s;
}

.beian-link:hover {
    color: #495057 !important; /* 悬停时稍微深一点，但不是蓝色 */
    text-decoration: none !important; /* 确保悬停时也没有下划线 */
}

.beian-icon {
    width: 14px; /* 调整图标大小 */
    height: 14px; /* 调整图标大小 */
    margin-right: 4px;
    vertical-align: middle;
    object-fit: contain; /* 确保图标比例正确 */
}

.beian-separator {
    color: #dee2e6;
    margin: 0 8px;
    font-size: 12px;
}

/* 联系方式行 */
.footer-contact {
    color: #6c757d;
    font-size: 12px; /* 调小字号 */
    margin-top: 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .footer {
        padding: 0.8rem;
        font-size: 11px; /* 移动端更小 */
    }
    
    .footer-beian {
        flex-direction: column;
        gap: 4px;
    }
    
    .beian-separator {
        display: none; /* 移动端隐藏分隔线 */
    }
    
    .beian-link {
        font-size: 11px;
    }
    
    .beian-icon {
        width: 12px;
        height: 12px;
    }
    
    .footer-contact {
        font-size: 11px;
    }
}

/* 首页适配移动端 */
/* 0. 用 rem 基准，方便缩放 */
html { font-size: 16px; }
@media (max-width: 375px) { html { font-size: 14px; } }

/* 1. 平板以下直接双排 */
@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);   /* 强制两列 */
    gap: 1rem;                               /* 间距收紧 */
    margin-top: 1rem;
  }
  /* 卡片文字再小一点 */
  .article-content h2   { font-size: 1rem; }   /* 16→14px */
  .article-content p    { font-size: 0.875rem; }
  /* 图片区域减小，保持 3:2 */
  .article-cover { height: 25vw; min-height: 120px; }
}

/* 2. 极小屏（<360px）再压一点 */
@media (max-width: 360px) {
  .article-grid { gap: 0.75rem; }
  .article-content { padding: 0.75rem; }
}

/* 模态框样式 */
.modal {
    display: none !important;   /* 强制隐藏 */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show { 
    display: flex !important;
    align-items: center;
    justify-content: center;
}   /* JS 一点才出现 */

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr;
    }
    .article-body {
        font-size: 1rem;
    }
}

.alipay-button {
    background-color: #1677FF;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}
.alipay-button:hover {
    background-color: #0e5fd9;
}

/* ===== 文章详情页专用 ===== */
/* 居中布局容器 */
.article-container {
    max-width: 820px;
    margin: 0 auto;
    min-height: 100vh;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 70px; /* 为底部按钮留空间 */
}

/* 头部 */
.article-header {
    text-align: center;    /* 左对齐 */
    margin-bottom: 30px;
    border-bottom:1px solid #f0f0f0; 
    padding-bottom:1rem;
}
.article-header h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}
.article-meta {
    color: #666;
    font-size: 0.875em;
}

/* 拼音控制按钮 */
.pinyin-controls {
    margin: 20px 0;
    margin: 20px 0;
}
.pinyin-toggle-btn {
    padding: 4px 8px;
    border: none;
    background: #fff;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: #1890ff;
}
.pinyin-toggle-btn:hover {
    background: rgba(24,144,255,.06);;
}

.pinyin-toggle-btn:active {
    transform: scale(.96);
}

/* 内容排版 */
.article-body {
    line-height: 2; /* 增大行高以容纳拼音 */
    font-size: 1em;
    margin: 40px 0;
    text-align: justify;
    text-align-last: left;
}
/* 段与段之间再补 1 em */
.article-body p + p { margin-top: 1em; }

/* 有拼音时*/
.article-body.show-pinyin {
    line-height: 2.4; /* 再升高 0.4，字与拼音不挤 */
    font-size: 1.05rem; /* 整体大 5 %，手机已单独降过 */
}

.poem-mode { 
    text-align:center; 
    text-align-last:center; 
    max-width:34em; 
    margin:0 auto; 
}
.pinyin-content {
    display: inline-block;
    text-align: center;
    line-height: 1.15; /* 整体行高 */
}
.char-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2px;
    vertical-align: bottom;
}
.pinyin-char {
    font-size: 0.75em;
    color: #7d8e95;
    height: 0.9em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: -0.25em;
}
.chinese-char {
    font-size: 1em;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 标点符号样式 */
.char-container.punctuation {
    margin: 0 8px; /* 标点符号周围有更多空间 */
    vertical-align: bottom; /* 确保标点符号底部对齐 */
}

.char-container.punctuation .chinese-char {
    font-size: 1em; /* 恢复字号 */
    margin-bottom: 0; /* 移除底部间距 */
    display: inline-block;
    vertical-align: bottom; /* 标点符号底部对齐 */
    line-height: 1; /* 确保行高正常 */
}

/* 隐藏拼音状态 */
.article-body.hide-pinyin .pinyin-char {
    display: none;
}
.article-body.hide-pinyin .char-container {
    margin: 0 1px;
}

/* 底部固定操作栏（详情页） */
.article-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 8px 20px;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.article-actions .cta-button {
    background: #1890ff;
    border-radius: 25px;
    font-size: 1.1em;
    padding: 10px 24px;
    transition: all .2s; 
}
.article-actions .cta-button:active {              /* 新增 */
    transform: scale(.97);
}
.article-actions .cta-button:hover {
    background: #40a9ff;
}

/* 错误页（404） */
.error-page {
    text-align: center;
    padding: 50px 20px;
}
.back-home {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

/* 响应式微调（详情页） */
@media (max-width: 768px) {
    .article-container {
        padding: 15px;
        padding-bottom: 80px;
    }
    .article-header h1 {
        font-size: 1.5em;
    }
    .article-body {
        font-size: 1.2em;
        line-height: 2.2;
    }
    .char-container {
        margin: 0 1px;
    }
}

/* 自定义支付弹窗样式 */
.custom-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.custom-modal-header h2 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.custom-close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.custom-close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.custom-modal-body {
    padding: 16px; /* 减少上下padding，因为内容多了 */
}

/* 支付方式样式 */
.payment-method {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.payment-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1677ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.payment-icon span {
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.payment-icon img{
    width:100%;      /* 撑满 50×50 的圆框 */
    height:100%;
    object-fit:contain;
    border-radius:50%;   /* 若 logo 本身带圆角可去掉 */
}

.payment-info {
    flex-grow: 1;
}

.payment-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.payment-desc {
    font-size: 12px;
    color: #666;
}

.payment-selector {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
}

.payment-selector.selected {
    border-color: #1677ff;
    background: #1677ff;
}

.payment-selector.selected::after {
    content: "";
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

.alipay-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1677ff 0%, #1890ff 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
    margin-bottom: 15px;
}

.alipay-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.alipay-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.4);
}

.alipay-btn:not(:disabled):active {
    transform: translateY(0);
}

.price {
    font-size: 20px;
}

.btn-text {
    letter-spacing: 1px;
}

.agreement {
    text-align: center;
    font-size: 9px;
    color: #999;
}

.agreement a {
    color: #1677ff;
    text-decoration: none;
}

.agreement a:hover {
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .custom-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .custom-modal-header h2 {
        font-size: 18px;
    }
    
    .alipay-btn {
        padding: 14px;
        font-size: 16px;
    }
    
    .payment-method {
        padding: 10px;
    }
    
    .payment-icon {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
}

.option.correct   { background:#52c41a; }
.option.incorrect { background:#ff4d4f; }
/* 0.3s 过渡避免闪变 */
.option{ transition:background .3s,color .3s; }


/* === 测试页移动端 === */
@media (max-width: 768px) {
  /* 1 题干挖空可换行 */
  .blank { display: inline-flex; min-width: 80px; max-width: 100%; margin: 2px 4px; }
  .blank input { width: 100%; font-size: 1rem; }

  /* 2 选项整体靠下 + 上下并排 */
  .options { 
      margin-top: auto;              /* 吸底 */
      flex-direction: column; 
      gap: 8px; 
      padding: 0 16px 24px;          /* 左右留空，下留安全区 */
  }
  /* 3 长选项自动断行 */
  .option { 
      width: 100%; 
      white-space: normal;           /* 允许换行 */
      text-align: center; 
      padding: 12px 16px; 
      font-size: 1rem; 
      line-height: 1.4; 
  }
}

/* 默认桌面 / 大屏 */
.article-body { font-size: 1rem; }   /* 16 px */

/* ≤768 px 手机 / 小平板 */
@media (max-width: 768px) {
  .article-body { font-size: 0.875rem; }   /* 14 px，约降 12 % */
  .pinyin-char  { font-size: 0.55em; }     /* 拼音同步缩，防止上下错位 */
}
@media (max-width: 375px) {
  .article-body { font-size: 0.8125rem; }  /* 13 px */
}
@media (max-width: 768px) {
  .article-body { line-height: 1.7; }   /* 桌面 1.8 → 手机 1.7 */
}

/* ===== 恢复权限弹窗 - 重置版 ===== */
#licenseModal .modal-content {
    position: relative;
    width: 90%;
    max-width: 360px;                    /* 1. 宽度压到 360 → 手机不撑满 */
    min-height: 320px;                   /* 1. 最低高度 → 不再扁盒 */
    padding: 40px 32px 32px;             /* 整体内边距，上多 8px 留空给关闭钮 */
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    text-align: center;                  /* 2. 内部全部居中 */
}

/* 5. 关闭按钮 - 右上角 + 缩小 */
#licenseModal .close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all .2s;
}
#licenseModal .close:hover {
    background: #f5f5f5;
    color: #333;
}

/* 4. 上、下两区视觉分隔 */
#licenseModal .modal-header {            /* 标题区 */
    margin-bottom: 24px;                 /* 与主题区拉开距离 */
}
#licenseModal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
}
#licenseModal .modal-header p {          /* 副标题 */
    font-size: .875rem;
    color: #666;
    margin: 0;
}

/* 3. 主题区 - 输入框拉高 + 按钮独占一行 */
#licenseModal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;                           /* 输入⇄按钮间距 */
}
#licenseModal input[type="text"] {
    width: 100%;
    height: 48px;                        /* 拉高输入框 */
    padding: 0 16px;
    font-size: 1rem;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    transition: border-color .2s;
}
#licenseModal input[type="text"]:focus {
    border-color: #1890ff;
    outline: none;
}
#licenseModal button {                  /* 按钮独占下方 */
    width: 100%;
    height: 44px;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background: #1890ff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s;
}
#licenseModal button:hover {
    background: #40a9ff;
}

/* 文章内容防复制样式 */
.article-content, .question, .quiz-area {
    -webkit-user-select: none;  /* Chrome, Safari, Opera */
    -moz-user-select: none;     /* Firefox */
    -ms-user-select: none;      /* IE/Edge */
    user-select: none;          /* Standard */
    
    /* 防止文字选择 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* 允许输入框选择文字 */
.blank input, input[type="text"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 会员协议文案样式 */
.agreement-text {
    margin: 15px 0 0 0;
    text-align: center;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.agreement-text a {
    color: #1890ff;
    text-decoration: none;
}

.agreement-text a:hover {
    text-decoration: underline;
}

.agreement-content {
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
    margin: 20px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.agreement-content p {
    margin: 10px 0;
    line-height: 1.5;
}

.agreement-content strong {
    color: #333;
}

/* 确保模态框正确显示 */
#agreementModal.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

#agreementModal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}