/* CSS Document */

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input[type="text"], input[type="password"], textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

.content-box {
    background-color: #f8f9fa;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.correct-btn { background-color: #4CAF50; }
.wrong-btn { background-color: #f44336; }

.error { color: #f44336; }
.success { color: #4CAF50; }


.task-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
    padding: 20px;
}

.material-list {
    border-left: 3px solid #4CAF50;
    margin: 15px 0;
    padding-left: 20px;
}

.material-item {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.point-number {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
}

.material-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.preview {
    color: #666;
    font-size: 0.9em;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.btn {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
}

.review-count {
    float: right;
    font-size: 0.8em;
    color: #666;
}

.form-group {
    margin: 15px 0;
}

.hint {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.or-divider {
    text-align: center;
    margin: 20px 0;
    color: #666;
    position: relative;
}

.or-divider::before,
.or-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

input[type="file"] {
    padding: 10px;
    border: 1px dashed #ddd;
    width: 100%;
}

.register-link {
    margin-top: 15px;
    text-align: center;
    color: #666;
}

.register-link a {
    color: #4CAF50;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* 错误提示框 */
.error-box {
    background: #ffe3e6;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #c92a2a;
}

.error-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.upload-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.or-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
    color: #868e96;
}

.or-divider::before,
.or-divider::after {
    content: "";
    display: inline-block;
    width: 45%;
    height: 1px;
    background: #dee2e6;
    vertical-align: middle;
}

.primary-btn {
    background: #339af0;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    width: 100%;
    font-size: 16px;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: #228be6;
}

.hint {
    color: #868e96;
    font-size: 0.9em;
    margin-top: 5px;
}
.study-btn {
    background: #2196F3;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: auto;
    font-size: 0.9em;
}

.study-btn:hover {
    background: #1976D2;
}

.material-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.no-material {
    color: #666;
    padding: 15px;
    text-align: center;
}

.cancel-btn {
    background: #9E9E9E;
    margin-left: 10px;
}

.cancel-btn:hover {
    background: #757575;
}

/* 复习计划表样式 */
.plan-header {
    display: grid;
    grid-template-columns: 80px 100px 1fr 120px;
    padding: 10px;
    background: #f8f9fa;
    font-weight: bold;
}

.plan-item {
    display: grid;
    grid-template-columns: 80px 100px 1fr 120px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.plan-item.urgent {
    background: #fff3e0;
}

.days { color: #4CAF50; }
.urgent .days { color: #f44336; }
.stage { color: #2196F3; }
.date { color: #666; }

        /* 添加按钮样式 */
	.home-btn {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 12px 24px;
	background-color: #4CAF50;
	color: white;
	text-decoration: none;
	border-radius: 25px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.2);
	transition: all 0.3s ease;
	z-index: 1000;
}

        .home-btn:hover {
            background-color: #45a049;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.3);
        }

        /* 移动端适配 */
        @media (max-width: 768px) {
            .home-btn {
                bottom: 15px;
                right: 15px;
                padding: 10px 20px;
                font-size: 14px;
			}
		}、
/* 用户状态样式 */
.user-status {
    position: fixed;
    top: 15px;
    right: 20px;
    background: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 0.9em;
    border: 1px solid #eee;
}

.user-status a {
    color: #4CAF50;
    text-decoration: none;
}

.user-status a:hover {
    text-decoration: underline;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.content-box {
    background: #f8f9fa;
    padding: 20px;
    margin: 15px 0;
    border-radius: 5px;
}

.form-group {
    margin: 15px 0;
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
}

/* 添加文本格式样式 */
.highlight-text,
.content-text {
    white-space: pre-line;      /* 保留换行 */
    line-height: 1.6;          /* 增加行距 */
    text-align: justify;       /* 两端对齐 */
    margin: 15px 0;            /* 增加段间距 */
}

/* 给有序列表添加样式 */
.content-text ol {
    margin: 15px 20px;
}
.content-text li {
    margin-bottom: 10px;
}

/* 高亮样式 */
.highlight {
    background-color: #ff0;
    padding: 2px 0;
    border-radius: 2px;
}

/* 内容显示区域 */
.content-text {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    line-height: 1.6;
}

/* 切换按钮样式 */
.toggle-btn {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 0;
}
.toggle-btn:hover {
    background: #45a049;
}
/* 新增样式规则 */
.highlight-text,
.content-text {
    white-space: normal; /* 合并所有空白，换行转为空格 */
    line-height: 1.6;
    padding: 15px;
    border: 1px solid #eee;

}

.highlight {
    background-color: yellow;
    padding: 2px 0;
    display: inline-block;
    white-space: normal; 
}

/* 隐藏高亮部分内部的换行符 */
br.hl-br {
    display: none;
}

/* 通过伪元素显示高亮换行 */
.highlight br.hl-br::after {
    content: "\A";
    white-space: pre;
}

/* 任务列表样式 */
.task-list {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.task-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-meta {
    color: #666;
    font-size: 0.9em;
}

.task-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.detail-btn {
    background: #2196F3;
}

.detail-btn:hover {
    background: #1976D2;
}

.study-btn {
    background: #4CAF50;
}

/* 任务详情页样式 */
.task-header-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.task-header-box h1 {
    margin: 0 0 10px 0;
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    border: 2px dashed #eee;
    border-radius: 8px;
    margin: 30px 0;
}

.study-modes {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.sequential-btn {
    background: #2196F3;
}

.random-btn {
    background: #9C27B0;
}

.study-btn:hover {
    opacity: 0.9;
}

/* 任务项容器 */
.task-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

/* 任务操作区域布局 */
.task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* 学习模式按钮组 */
.study-modes {
    display: flex;
    gap: 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .task-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .study-modes {
        flex-direction: column;
    }
}

/* 任务标题区域 */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.task-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.unlearned-count {
    font-size: 0.9em;
    color: #666;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 调整原有样式 */
.task-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

/* 添加进度条样式 */
.progress-bar {
    width: 80px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-left: 10px;
}

.progress {
    height: 100%;
    background: #4CAF50;
    width: <?php echo ($task['total_count'] ? (($task['total_count'] - $task['unlearned_count'])/$task['total_count']*100) : 0); ?>%;
    transition: width 0.3s ease;
}

