/* 字体定义 */
@font-face {
    font-family: 'JingangTie';
    src: url('../fonts/jingangtie.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'shouxieti';
    src: url('../fonts/shouxieti.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'MC';
    src: url('../fonts/mc.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'KuanMaoBi';
    src: url('../fonts/kuanmaobi.ttf') format('truetype');
    font-display: swap;
}

/* 字体切换器样式 */
.font-switcher {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
}

.font-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.font-toggle:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.font-options {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--card-bg);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 10px;
    margin-bottom: 10px;
    display: none;
    min-width: 150px; /* 增加宽度 */
    max-height: 300px; /* 限制最大高度 */
    overflow-y: auto; /* 添加滚动条 */
}

.font-options.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.font-options button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.font-options button:hover {
    background: var(--primary-color);
    color: white;
}

.font-options button:last-child {
    margin-bottom: 0;
}

/* 字体应用类 - 字体大小设置 */
body.font-jingangtie,
body.font-jingangtie * {
    font-family: 'JingangTie', 'Microsoft YaHei', sans-serif !important;
    font-size: 1.12em !important;
}

body.font-mc,
body.font-mc * {
    font-family: 'MC', 'Microsoft YaHei', sans-serif !important;
    font-size: 1.1em !important;
}

body.font-kuanmaobi,
body.font-kuanmaobi * {
    font-family: 'KuanMaoBi', 'Microsoft YaHei', sans-serif !important;
    font-size: 1.15em !important;
}

body.font-shouxieti,
body.font-shouxieti * {
    font-family: 'shouxieti', 'Microsoft YaHei', sans-serif !important;
    font-size: 1.08em !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .font-switcher {
        left: 10px;
        bottom: 10px;
    }
    
    .font-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
}
/* 调整移动端字体切换器 */
@media (max-width: 768px) {
    .font-switcher {
        left: 10px;
        bottom: 10px;
    }
    
    .font-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .font-options {
        min-width: 130px;
        max-height: 250px;
    }
}