/* 古典中国风配色方案 */
:root {
    --primary-color: #8b2323; /* 中国红 */
    --secondary-color: #deb887; /* 米黄/牙色 */
    --tertiary-color: #2f4f4f; /* 墨绿 */
    --bg-color: #f5f1e6; /* 宣纸色 */
    --text-color: #333333; /* 墨色 */
    --light-text: #5e5e5e; /* 淡墨色 */
    --border-color: #d4b886; /* 古铜色 */
    --accent-color: #986b41; /* 木色 */
    --highlight-color: #c41e3a; /* 朱砂红 */
}

/* 夜间模式配色 */
body.night-mode {
    --bg-color: #1c1c1e;
    --text-color: #e5e5ea;
    --light-text: #a7a7a7;
    --border-color: #38383c;
    --secondary-color: #3a3a3c;
}

body.night-mode .bg-white,
body.night-mode .ancient-card {
    background-color: #2c2c2e !important;
}

body.night-mode .tab-bar {
    background-color: rgba(38, 38, 40, 0.95);
}

/* 字体设置 */
.font-kaiti {
    font-family: 'STKaiti', 'KaiTi', serif;
}

.font-songti {
    font-family: 'SimSun', 'STSong', serif;
}

.font-heiti {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

.font-fangsong {
    font-family: 'STFangsong', 'FangSong', serif;
}

/* 字号设置 */
.text-size-small {
    font-size: 0.9rem;
}

.text-size-medium {
    font-size: 1rem;
}

.text-size-large {
    font-size: 1.1rem;
}

/* 通用样式 */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'SimSun', 'STSong', serif;
}

.status-bar {
    height: 44px;
    background-color: #000;
    color: white;
    font-size: 14px;
    padding: 0 16px;
    position: relative;
    z-index: 10;
}

.tab-bar {
    height: 83px;
    background-color: rgba(248, 243, 234, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    z-index: 10;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    font-size: 10px;
    padding-bottom: 10px;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

/* 中国古典风元素 */
.ancient-card {
    background-color: #f8f3ea;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(152, 107, 65, 0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.ancient-header {
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-weight: bold;
}

.scroll-container {
    padding: 16px;
    padding-bottom: 100px;
}

/* 书法风格文字 */
.calligraphy-title {
    font-family: 'STKaiti', 'KaiTi', 'FangSong', serif;
    font-weight: bold;
    color: var(--primary-color);
}

.ancient-poem {
    font-family: 'STKaiti', 'KaiTi', serif;
    line-height: 1.8;
}

.annotation {
    color: var(--light-text);
    font-size: 0.85em;
}

/* 装饰性边框元素 */
.decorative-border {
    position: relative;
}

.decorative-border::before,
.decorative-border::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
}

.decorative-border::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.decorative-border::after {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

/* 简繁体切换 */
.ancient-poem.traditional {
    font-family: 'STKaitiTC', 'DFKai-SB', serif;
}

/* 按钮样式 */
.ancient-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: 'STKaiti', 'KaiTi', serif;
}

.ancient-btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 8px 16px;
    font-family: 'STKaiti', 'KaiTi', serif;
}

/* 搜索框样式 */
.ancient-search {
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 8px 16px;
    width: 100%;
}

/* 卷轴效果 */
.scroll-effect {
    background-image: url('../images/paper_texture.jpg');
    background-size: cover;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.scroll-effect::before,
.scroll-effect::after {
    content: "";
    position: absolute;
    height: 100%;
    width: 8px;
    top: 0;
    background: linear-gradient(to right, rgba(152, 107, 65, 0.6), rgba(152, 107, 65, 0.1));
    border-radius: 2px;
    opacity: 0.5;
}

.scroll-effect::before {
    left: 0;
}

.scroll-effect::after {
    right: 0;
    transform: rotate(180deg);
}

/* 夜间模式下卷轴效果 */
body.night-mode .scroll-effect {
    background-image: url('../images/paper_texture_dark.jpg');
}

/* 竖排文字 */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* 音频播放控件 */
.audio-player {
    background-color: rgba(248, 243, 234, 0.9);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
}

body.night-mode .audio-player {
    background-color: rgba(44, 44, 46, 0.9);
}

.audio-player-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    background-color: var(--bg-color);
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--light-text);
    font-size: 12px;
}

.tool-item.active {
    color: var(--primary-color);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(139, 35, 35, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

/* 过渡动画 */
.tab-content,
.dot,
.ancient-card,
.audio-player-btn,
.tab-item,
.tool-item {
    transition: all 0.3s ease;
}

/* 夜间模式切换开关样式 */
body.night-mode .dot {
    transform: translateX(100%);
    background-color: var(--primary-color);
}

body.night-mode .block {
    background-color: rgba(139, 35, 35, 0.3);
}

/* 响应式字体大小 */
@media (max-width: 360px) {
    html {
        font-size: 14px;
    }
}

@media (min-width: 361px) and (max-width: 400px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 401px) {
    html {
        font-size: 16px;
    }
}

/* 中国传统纹饰 */
.chinese-pattern {
    background-image: url('../images/pattern_bg.png');
    background-repeat: repeat;
    background-size: 100px;
    opacity: 0.1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
} 