/* ===== 基础样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    background: url("images/mountain-bg.jpg") top center no-repeat #ede7d9;
    background-size: contain;
    min-height: 100vh;
}

ul, ol { list-style: none; }
a { color: #333; text-decoration: none; cursor: pointer; }
a:hover { color: #c5653e; }

/* ===== 容器 ===== */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===== 标题区 ===== */
.site-header {
    text-align: center;
    padding: 40px 0 50px;
    position: relative;
}

.site-title {
    font-size: 42px;
    font-weight: normal;
    color: #392b20;
    letter-spacing: 4px;
    position: relative;
}

.title-text {
    font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
}

/* 国学印章（与 hgcha.com 保持一致） */
.seal {
    display: inline-block;
    width: 30px;
    height: 50px;
    background: url("images/guoxue-seal.png") no-repeat 0 0;
    background-size: 30px 50px;
    vertical-align: middle;
    margin-left: 4px;
}

.site-sub {
    margin-top: 14px;
    color: #7d7065;
    font-size: 15px;
    letter-spacing: 2px;
}

/* 手机适配：让国学印章紧贴标题 */
@media (max-width: 768px) {
    .site-title {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .seal {
        width: 22px;
        height: 36px;
        background-size: 22px 36px;
        margin-left: 4px;
    }
}

/* ===== 内容卡片 ===== */
.panel {
    background-color: #f1ece1;
    border-radius: 6px;
    padding: 24px;
    box-shadow: #ddd9cf 2px 2px 10px 0;
}

.panel-title {
    margin-bottom: 18px;
}

.contitle {
    background-color: #bbbaa7;
    color: #fff;
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 3px;
    display: inline-block;
}

.contitle.category-title {
    background-color: transparent;
    color: #c5653e;
}

/* ===== 词语网格 ===== */
.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

.word-list li {
    list-style: none;
}

.word-list li a {
    display: block;
    padding: 10px 6px;
    border: 1px solid #e8e2d4;
    background-color: #e8e2d4;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

.word-list li a:hover {
    background-color: #fff;
    border: 1px solid #c5653e;
    box-shadow: rgb(235, 234, 226) 2px 2px 10px 0, rgba(122, 122, 119, 0.3) 2px 2px 10px 0;
}

.word-list li a .pinyin {
    font-size: 14px;
    color: #999;
    display: block;
    line-height: 20px;
    font-family: Tahoma, Arial, Georgia, Verdana, Helvetica, sans-serif;
    margin-bottom: 2px;
}

.word-list li a:hover .pinyin {
    color: #c5653e;
}

.word-list li a .word {
    font-size: 18px;
    color: #333;
    display: block;
    line-height: 26px;
}

.word-list li a:hover .word {
    color: #333;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #999;
    font-size: 13px;
}

/* ===================== 详情页 ===================== */

/* 顶部：点击返回首页（左上角，与首页同样样式） */
.detail-header {
    padding: 20px 0 30px;
}

.back-title {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #392b20;
    font-size: 28px;
    letter-spacing: 3px;
    text-decoration: none;
}

.back-title .title-text {
    font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
}

.back-title .seal {
    width: 24px;
    height: 40px;
    background-size: 24px 40px;
}

.back-title:hover {
    color: #c5653e;
}

/* 词头：拼音 + 大字 */
.word-head {
    padding: 20px 0 24px;
    text-align: center;
    font-family: Georgia, Baskerville, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", KaiTi, KaiTi_GB2312, serif;
}

.word-head .pinyin {
    font-size: 16px;
    color: #c5653e;
    font-family: Tahoma, Arial, Georgia, Verdana, Helvetica, sans-serif;
    margin-bottom: 10px;
}

.word-head .pinyin span {
    min-width: 56px;
    display: inline-block;
    text-align: center;
}

.word-title {
    font-size: 48px;
    font-weight: normal;
    color: #392b20;
    letter-spacing: 6px;
    line-height: 1.2;
}

/* 分隔线 */
.panel hr {
    border: none;
    border-top: 1px dashed #d9d2c2;
    margin: 22px 0;
}

/* 拼音属性行 */
.attr-row {
    padding: 6px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.attr-item {
    display: inline-flex;
    align-items: center;
}

.attr_name {
    background-color: #e7e3d5;
    color: #392b20;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 3px;
    margin-right: 10px;
    display: inline-block;
}

.attr_val {
    color: #333;
    font-family: Tahoma, Arial, Georgia, Verdana, Helvetica, sans-serif;
}

/* 朗读按钮（喇叭） */
.audio-btn {
    display: inline-block;
    width: 22px;
    height: 17px;
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: transparent url("images/audio.gif") no-repeat center center;
    background-size: 22px 17px;
    cursor: pointer;
    vertical-align: middle;
}

.audio-btn:hover {
    opacity: 0.8;
}

.audio-btn.playing {
    background-image: url("images/audio-playing.gif");
}

/* 小节标题 */
.section-title {
    font-size: 20px;
    font-weight: normal;
    color: #392b20;
    margin: 6px 0 16px;
}

/* 释义/造句条目 */
.panel p.indent {
    position: relative;
    margin-left: 25px;
    padding: 6px 0;
    line-height: 1.8;
    font-size: 16px;
}

.panel p.indent .no {
    position: absolute;
    left: -21px;
    top: 10px;
    color: #c5653e;
    font-size: 16px;
    line-height: 1;
}

/* 英文翻译行：与上一行的第一个字对齐
   .indent 文本起始于 25px，tag 有 6px 左 padding，
   这里抵消 padding，让"英"字与上方首字同列 */
.panel p.indent.w2 {
    margin-left: 25px;
}

.panel p.indent.w2 .attr_tag {
    margin-left: -6px;
}

.def-type {
    color: #7a5b3b;
    margin-right: 4px;
}

/* "英" 标签 */
.attr_tag {
    color: #605b45;
    background-color: #e7e3d5;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: 1px;
}

.attr_ext {
    color: #555;
}

/* 造句高亮：当前词语 */
.panel em {
    font-style: normal;
    color: #d25f32;
}

.muted {
    color: #999;
}

.not-found {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.not-found a {
    color: #c5653e;
}
