/* --- 全局文章内容优化 --- */ .article-content { /* 假设您的主要文章内容包裹在一个 class="article-content" 的 div 内 */ font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; /* 优先使用思源黑体/微软雅黑 */ line-height: 1.7; font-size: 17px; /* 桌面基础字号 */ } /* --- 文章内导航表格 (Table of Contents) --- */ .custom-toc-table { width: 100%; border-collapse: separate; border-spacing: 10px; margin-bottom: 30px; } .custom-toc-table td { padding: 18px; border: 1px solid #e0e0e0; background: #f9f9f9; text-align: center; border-radius: 8px; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; box-sizing: border-box; /* 确保padding和border不增加总宽度 */ } .custom-toc-table td:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); } .custom-toc-table td a { color: #0056b3; text-decoration: none; font-weight: bold; font-size: 1.1em; /* 桌面字体大小 */ } .custom-toc-table td a:hover { color: #003d80; text-decoration: underline; } /* --- 文章H2标题 --- */ .article-content h2 { color: #c00000 !important; /* 稍微深一点的红色 */ font-size: 28px; /* 桌面字体大小 */ margin-top: 45px; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 2px solid #eee; } /* --- WhatsApp CTA按钮 --- */ .whatsapp-cta { display: inline-flex; align-items: center; padding: 12px 24px; /* 桌面内边距 */ background-color: #25d366; color: #ffffff !important; font-weight: bold; text-align: center; border-radius: 8px; text-decoration: none !important; line-height: 1.2; font-size: clamp(16px, 3vw, 20px); /* 使用 clamp 实现字体平滑缩放 */ margin: 20px 0; transition: background-color 0.2s ease; } .whatsapp-cta:hover { background-color: #1da851; color: #ffffff !important; text-decoration: none !important; } .whatsapp-cta img { width: clamp(24px, 5vw, 32px); /* 使用 clamp 实现图片平滑缩放 */ height: auto; margin-right: 10px; } /* --- 文章列表 (ul) --- */ .article-content ul { list-style-type: '✓ '; padding-left: 25px; /* 桌面左内边距 */ margin-bottom: 20px; } .article-content ul li { margin-bottom: 10px; line-height: 1.7; } /* --- 最常见汉字部首列表表格 --- */ /* 包裹表格的容器,用于在小屏幕上实现水平滚动 */ .radicals-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */ margin-top: 30px; margin-bottom: 30px; } .radicals-table { border-collapse: collapse; width: 100%; /* 表格本身宽度100%,由wrapper控制溢出 */ box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* 稍微减弱阴影 */ } .radicals-table th, .radicals-table td { border: 1px solid #ddd; padding: 12px 15px; /* 桌面内边距 */ text-align: left; vertical-align: middle; } .radicals-table th { background-color: #f0f0f0; font-weight: bold; color: #333; } .radicals-table tr:nth-child(even) { background-color: #f9f9f9; } .radicals-table tr:hover { background-color: #f1f1f1; } .radicals-table td i { color: #555; font-size: 0.9em; } /* --- 底部链接区域 (卡片式) --- */ .bottom-links-container { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 40px; margin-bottom: 30px; justify-content: center; } .bottom-link-card { display: block; flex: 1 1 300px; max-width: 350px; padding: 20px; /* 桌面内边距 */ background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; text-decoration: none !important; color: #333; transition: box-shadow 0.3s ease, transform 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } .bottom-link-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); transform: translateY(-5px); color: #0056b3; } .bottom-link-card h4 { margin-top: 0; margin-bottom: 10px; color: #0056b3; font-size: 1.2em; /* 桌面字体大小 */ } .bottom-link-card p { font-size: 0.95em; /* 桌面字体大小 */ color: #555; line-height: 1.6; } /* --- 音频播放器微调 (示例,具体取决于您的播放器结构) --- */ .custom-audio-player { background-color: #583080; border-radius: 12px; padding: 20px; margin: 30px auto; /* auto 使其在父容器中居中 */ box-shadow: 0 4px 15px rgba(0,0,0,0.2); color: #ecf0f1; max-width: 600px; position: relative; overflow: hidden; } /* ... (音频播放器内部其他样式,根据需要添加) ... */ /* --- 响应式设计媒体查询 --- */ /* 平板电脑及较小桌面 (例如: <= 1024px) */ @media (max-width: 1024px) { .article-content { font-size: 16px; /* 略微减小基础字号 */ } .article-content h2 { font-size: 26px; /* 减小H2字号 */ } .custom-toc-table td a { font-size: 1.05em; } .bottom-link-card { flex-basis: calc(50% - 10px); /* 两列布局,减去gap的一半 */ max-width: none; /* 取消最大宽度限制,让其填充 */ } } /* 平板电脑 (例如: <= 768px) */ @media (max-width: 768px) { .article-content h2 { font-size: 24px; /* 进一步减小H2字号 */ margin-top: 35px; margin-bottom: 20px; } .custom-toc-table td { padding: 15px; /* 减小内边距 */ } .custom-toc-table td a { font-size: 1em; /* 调整目录字体 */ } .whatsapp-cta { padding: 10px 20px; /* 减小按钮内边距 */ } .article-content ul { padding-left: 20px; /* 减小列表缩进 */ } .radicals-table th, .radicals-table td { padding: 10px 12px; /* 减小表格内边距 */ } .bottom-link-card { padding: 15px; /* 减小卡片内边距 */ } .bottom-link-card h4 { font-size: 1.1em; } .bottom-link-card p { font-size: 0.9em; } .custom-audio-player { margin: 20px auto; /* 减小上下边距 */ padding: 15px; } } /* 手机屏幕 (例如: <= 480px) */ @media (max-width: 480px) { .article-content { font-size: 15px; /* 手机屏幕基础字号 */ } .article-content h2 { font-size: 22px; /* 手机H2字号 */ margin-top: 30px; margin-bottom: 15px; } /* 目录表格变为单列堆叠 */ .custom-toc-table { border-spacing: 0 10px; /* 移除水平间距,增加垂直间距 */ } .custom-toc-table tr, .custom-toc-table tbody { display: contents; /* 使tr和tbody不影响td的flex/block布局 */ } .custom-toc-table td { display: block; /* 每个单元格占一行 */ width: 100%; /* 占满宽度 */ margin-bottom: 10px; /* 单元格之间的垂直间距 */ padding: 12px; } .custom-toc-table td:last-child { margin-bottom: 0; } .whatsapp-cta { font-size: clamp(14px, 4vw, 18px); /* 调整 clamp 范围以适应更小屏幕 */ padding: 8px 15px; display: flex; /* 确保在小屏幕上也是flex以便居中 */ justify-content: center; width: 100%; /* 可以考虑让按钮占满宽度 */ box-sizing: border-box; } .whatsapp-cta img { width: clamp(20px, 5vw, 28px); } .radicals-table th, .radicals-table td { padding: 8px 10px; /* 进一步减小表格内边距 */ font-size: 0.9em; /* 减小表格内文字大小 */ } .bottom-links-container { gap: 15px; /* 减小卡片间距 */ } .bottom-link-card { flex-basis: 100%; /* 卡片单列 */ padding: 12px; } .bottom-link-card h4 { font-size: 1.05em; } .custom-audio-player { border-radius: 8px; /* 减小圆角 */ } }