/* 
 * 学术网站增强样式
 * 包含中英文混合字体切换功能
 */

/* 默认字体设置：优先使用后台字体配置生成的 --site-font（由 fontCSS 注入），
   未注入时（例如独立静态预览）回退到跨平台中文字体链，避免落到 mac 不存在的 Windows 字体 */
body {
    font-family: var(--site-font, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Source Han Sans SC', '黑体', SimHei, sans-serif);
}

/* 中文字体类（兼容旧版中英混排卡片）：字体族统一由后台字体的 --site-font 决定，
   这里只保留类名兼容历史内容，不再写死具体字体 */
.font-chinese-1 {
    font-family: var(--site-font) !important;
}

.font-chinese-2 {
    font-family: var(--site-font) !important;
}

.font-chinese-3 {
    font-family: var(--site-font) !important;
}

/* 英文字体类 */
.font-english-1 {
    font-family: var(--site-font) !important;
}

.font-english-2 {
    font-family: var(--site-font-serif-cn) !important;
}

.font-english-3 {
    font-family: var(--site-font) !important;
}

/* 混合语言卡片样式 */
.mixed-language-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 500px;
    width: 90%;
}

.mixed-language-card h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.mixed-language-card .card-content {
    margin: 15px 0;
    color: #333;
}

.mixed-language-card .font-selection {
    margin: 15px 0;
}

.mixed-language-card .font-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.mixed-language-card .font-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mixed-language-card .font-option {
    flex: 1;
    min-width: 120px;
}

.mixed-language-card .btn-group {
    text-align: right;
    margin-top: 20px;
}

.mixed-language-card button {
    padding: 8px 16px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-confirm {
    background: var(--primary);
    color: white;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

/* 编辑框样式 */
.editable-box {
    position: relative;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.editable-box:hover {
    border-color: #ddd;
}

.editable-box.editing {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(36, 65, 90, 0.2);
}

.editable-controls {
    position: absolute;
    top: -30px;
    right: 0;
    display: none;
}

.editable-box.editing .editable-controls {
    display: block;
}

.editable-controls button {
    padding: 4px 8px;
    margin-left: 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-apply {
    background: var(--primary);
    color: white;
}

.btn-cancel-edit {
    background: #e74c3c;
    color: white;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}