  /* 无依赖分数样式 - 核心 */
.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 4px;
}
/* 分子 */
.fraction .num {
    font-size: 0.9em;
    line-height: 1;
    margin-bottom: 2px;
}
/* 分数线 */
.fraction .line {
    width: 100%;
    height: 1px;
    background-color: var(--text-main);
    margin: 0 2px;
}
/* 分母 */
.fraction .den {
    font-size: 0.9em;
    line-height: 1;
    margin-top: 2px;
}
/* 公式整体对齐优化 */
.formula {
    font-size: 1.1em;
    line-height: 2;
}

      
      
        /* 密码验证界面样式 */
/* 密码验证界面样式 */
        .password-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }
        .password-box {
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
            width: 90%;
            max-width: 400px;
            text-align: center;
        }
        .password-input {
            width: 100%;
            padding: 12px 15px;
            margin: 20px 0;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            box-sizing: border-box;
        }
        .password-input:focus {
            outline: none;
            border-color: #ff4499;
        }
        .password-btn {
            padding: 12px 25px;
            margin: 0 10px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            display: inline-block; /* 新增：让a标签和按钮样式一致 */
            text-decoration: none; /* 新增：去除超链接下划线 */
        }
        .submit-btn {
            background: #ff4499;
            color: white;
        }
        .contact-btn { /* 修改：重置按钮样式改为联系作者按钮 */
            background: #eee;
            color: #333;
        }
        .password-btn:hover {
            opacity: 0.9;
            transform: translateY(-2px);
        }
        .error-msg {
            color: #ff3333;
            margin: 10px 0;
            font-size: 14px;
        }
        .tip-text {
            color: #666;
            font-size: 14px;
            margin-bottom: 15px;
        }
        /* 未验证时隐藏原内容 */
        .content-wrapper {
            display: <?php echo $isAuthenticated ? 'block' : 'none'; ?>;
        }
        
        
        
        
        
        
        
        
        
        
        
        
        

        :root {
            --primary-color: #2563eb;
            --secondary-color: #1e40af;
            --bg-color: #f3f4f6;
            --card-bg: #ffffff;
            --text-main: #1f2937;
            --text-light: #6b7280;
            --accent-color: #f59e0b;
        }

        body {
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            margin: 0;
            padding: 0;
            line-height: 1.6;
        }

        /* 布局容器 */
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            min-height: 100vh;
        }

        /* 头部 */
        header {
            text-align: center;
            margin-bottom: 30px;
        }
        header h1 {
            color: var(--primary-color);
            margin-bottom: 5px;
        }
        header p {
            color: var(--text-light);
        }

        /* 页面切换控制 */
        .view-section {
            display: none; /* 默认隐藏所有部分 */
            animation: fadeIn 0.3s ease-in-out;
        }
        .view-section.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 首页：章节选择列表 */
        .chapter-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }

        .chapter-card {
            background: var(--card-bg);
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            transition: transform 0.2s;
            border-left: 5px solid var(--primary-color);
        }
        .chapter-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 12px rgba(0,0,0,0.1);
        }
        .chapter-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 15px;
        }
        .action-buttons {
            display: flex;
            gap: 10px;
        }
        .btn {
            flex: 1;
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.2s;
            text-align: center;
        }
        .btn-study {
            background-color: #e0e7ff;
            color: var(--primary-color);
        }
        .btn-study:hover { background-color: #c7d2fe; }
        .btn-quiz {
            background-color: #fef3c7;
            color: #d97706;
        }
        .btn-quiz:hover { background-color: #fde68a; }
        .btn-back {
            background-color: #e5e7eb;
            color: var(--text-main);
            margin-bottom: 20px;
            width: auto;
            display: inline-block;
        }

        /* 学习模式样式 */
        .study-content {
            background: var(--card-bg);
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
        .study-content h2 { border-bottom: 2px solid var(--bg-color); padding-bottom: 10px; }
        .study-content ul { padding-left: 20px; }
        .study-content li { margin-bottom: 10px; }
        
        /* 重点关键词高亮/遮挡样式 */
        .keyword {
            font-weight: bold;
            color: var(--primary-color);
            padding: 0 4px;
            border-radius: 4px;
            transition: all 0.3s;
        }
        /* 当开启背诵模式时 */
        .recite-mode .keyword {
            background-color: #333;
            color: #333; /* 文字颜色变黑，实现遮挡 */
            cursor: pointer;
            user-select: none;
        }
        .recite-mode .keyword.revealed {
            background-color: #dbeafe;
            color: var(--primary-color);
        }

        .tools-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .toggle-switch {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
        }

        /* 测试模式（题目）样式 */
        .quiz-card {
            background: var(--card-bg);
            padding: 40px;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 10px 15px rgba(0,0,0,0.05);
            min-height: 200px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .question-text {
            font-size: 1.3rem;
            margin-bottom: 20px;
        }
        .answer-area {
            margin-top: 20px;
            padding: 15px;
            background: #f0fdf4;
            color: #166534;
            border-radius: 8px;
            display: none; /* 默认隐藏答案 */
            width: 100%;
        }
        .quiz-controls {
            margin-top: 30px;
            display: flex;
            gap: 15px;
            justify-content: center;
            width: 100%;
        }
        .btn-primary {
            background-color: var(--primary-color);
            color: white;
            padding: 10px 20px;
        }

    