:root {
    --primary: #28a745;
    --primary-color: #28a745;
    --primary-light: #d4edda;
    --primary-dark: #218838;
    --border: #dee2e6;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --orange: #fd7e14;
    --level-star: #ffc107;
    --level-moon: #6f42c1;
    --level-sun: #fd7e14;
    --level-crown: #e83e8c;
    --accent-color: #ffc107;
    --text-dark: #212529;
    --text-light: #6c757d;
    --tag-efficient-bg-color: #27ae60;
    --tag-inefficient-bg-color: #88cb7f;
    --tag-relaxing-bg-color: #a3a3a2;
    --tag-sports-bg-color: #89c3eb;
    --tag-life-bg-color: #eacd76;
    --tag-other-bg-color: #edd1d8;
    --tag-unrecorded-bg-color: #f0f0f0;
    --tag-color: white;
    --socre-level-A-bg-color: #27ae60;
    --socre-level-B-bg-color: #27ae60;
    --socre-level-C-bg-color: #00BFFF;
    --socre-level-D-bg-color: #00BFFF;
    --socre-level-F-bg-color: #666666;
}

@font-face {
  font-display: swap;
  font-family: 'bootstrap-icons';
  src: url('/backup/webfonts/bootstrap-icons.woff2?1bb88866b4085542c8ed5fb61b9393dd') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Font Awesome';
  src: url('/backup/webfonts/fa-solid-900.woff2') format('woff2');
}

.card {
    --bs-card-spacer-x: 0.3rem;
}

body {
    background-color: #f0f8f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.progress-container {
    position: relative;
}

.progress {
    border-radius: 15px;
    overflow: visible;
}

.progress-bar {
    border-radius: 15px;
    position: relative;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.total-score {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.circle {
    width: 200px;
    height: 200px;
    background: conic-gradient(var(--primary) 0% var(--progress, 0%), #e9ecef var(--progress, 0%) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
    animation: pulse 2s infinite;
}

.circle-inner {
    width: 170px;
    height: 170px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.circle-inner h2 {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.score {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

.total-max {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    margin-top: -10px;
}

.subject-mini-circle {
    width: 140px;
    height: 140px;
    background: conic-gradient(var(--primary) 0% var(--progress, 0%), #e9ecef var(--progress, 0%) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.2);
    margin: 0 auto;
}

.subject-mini-circle .circle-inner {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    padding: 10px;
}

.subject-mini-circle h6 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: var(--dark);
    font-weight: bold;
}

.subject-mini-circle .score {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.subject-mini-circle small {
    font-size: 0.8rem;
    color: var(--secondary);
}

.chapter-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.chapter-item {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
    margin-bottom: 15px;
    position: relative;
    overflow: visible; /* 允许子元素溢出 */
}

.chapter-header {
    background-color: var(--primary-light);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.task-list {
    padding-top: 5px;
}

.task-item {
    background-color: var(--light);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 8px;
}

.task-item:hover {
    background-color: #e9f7e9;
}

.completed-task {
    background-color: var(--primary-light);
}

.completed-task .task-name {
    color: var(--primary);
    text-decoration: line-through;
}

.completed-task .dailytask-name {
    color: var(--primary);
    text-decoration: line-through;
}

.exam-item {
    background-color: #f1f8e9;
    border-left: 4px solid var(--primary);
}


.quote-grid {
    display: grid;
    background-color: var(--primary-light);
    grid-template-columns: auto 1fr auto;
    align-items: start;
    margin-top: 5px;
    margin-bottom: 10px;
    gap: 0 1rem;
    transition: all 0.5s ease;
}

.quote-grid i.fa-quote-left {
    grid-column: 1;
    font-size: 1.5rem;
    color: #999;
}

.quote-grid p {
    grid-column: 2;
    margin: 0;
    padding: 1rem 0;
    line-height: 1.6;
}

.quote-grid i.fa-quote-right {
    grid-column: 3;
    align-self: end; /* 右引号对齐底部 */
    font-size: 1.5rem;
    color: #999;
}

.quote-grid:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.leaderboard-container::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.highlight-self {
    animation: highlight 2s ease;
    background-color: rgba(40, 167, 69, 0.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes highlight {
    0% { background-color: rgba(40, 167, 69, 0.3); }
    100% { background-color: rgba(40, 167, 69, 0.1); }
}

/* 清华紫 */
.bg-thu-purple {
    background-color: #800080 !important;
}

/* 清华紫 */
.bg-thu-purple {
    background-color: #800080 !important;
}

.non-user-select {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
    -webkit-touch-callout: none; /* iOS Safari */
}

/* 任务checkbox */
.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0;
    cursor: pointer;
    border: 2px solid #cbd5e0;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.completed-task {
    background-color: #f0fff4;
    border-left: 4px solid var(--primary-color);
}

/* 为核心链接添加基础样式 */
.footer-icp-link {
    color: #999; /* 设置为与你页脚文字相近的颜色 */
    text-decoration: none; /* 去除下划线 */
    font-size: 12px; /* 设置合适的字号 */
    margin-left: 10px; /* 或其他你需要的外边距 */
}

/* 鼠标悬停时的效果（可选） */
.footer-icp-link:hover {
    color: #ccc; /* 悬停时颜色微变 */
    text-decoration: underline; /* 悬停时显示下划线，可选 */
}

/* 学习相关标签 */
.tag-efficient {
    background-color: var(--tag-efficient-bg-color) !important;
    color: var(--tag-color);
}

.tag-inefficient {
    background-color: var(--tag-inefficient-bg-color) !important;
    color: var(--tag-color);
}

/* 休闲活动标签 */
.tag-relaxing {
    background-color: var(--tag-relaxing-bg-color) !important;
    color: var(--tag-color);
}

/* 运动标签 */
.tag-sports {
    background-color: var(--tag-sports-bg-color) !important;
    color: var(--tag-color);
}

/* 生活标签 */
.tag-life {
    background-color: var(--tag-life-bg-color) !important;
    color: var(--tag-color);
}

/* 其它标签 */
.tag-other {
    background-color: var(--tag-other-bg-color) !important;
    color: var(--tag-color);
}

/* 无记录标签 */
.tag-unrecorded {
    background-color: var(--tag-unrecorded-bg-color) !important;
    color: var(--tag-color);
}

/* 记录左边框颜色 */
.record-item.efficient {
    border-left-color: var(--tag-efficient-bg-color);
}

.record-item.inefficient {
    border-left-color: var(--tag-inefficient-bg-color);
}

.record-item.relaxing {
    border-left-color: var(--tag-relaxing-bg-color);
}

.record-item.sports {
    border-left-color: var(--tag-sports-bg-color);
}

.record-item.life {
    border-left-color: var(--tag-life-bg-color);
}

.record-item.other {
    border-left-color: var(--tag-other-bg-color);
}

.record-item.unrecorded {
    border-left-color: var(--tag-unrecorded-bg-color);
}

/* 统一的标签样式 */
.tag {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* 选中状态样式 */
.tag-btn.active {
    position: relative;
    border: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    font-weight: 689;
}

/* 分类标签样式 */
.category-tags-container {
    margin-top: 0.5rem;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background-color: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.category-tag:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.category-tag.active {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.task-type-option {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #e9ecef !important;
    background-color: #f8f9fa;
}

.task-type-option:hover {
    background-color: #e9ecef;
    border-color: #ced4da !important;
}

.form-check-input:checked + .task-type-option {
    border-color: #28a745 !important;
    background-color: rgba(40, 167, 69, 0.08);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.icon-text-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 4px;
}
.icon-text-container i {
    font-size: 1.1rem;
}
.icon-text-container span {
    font-size: 0.9rem;
}

/* Markdown 内容样式 */
.markdown-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
}

.markdown-body h1 { font-size: 1.6em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.4em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.2em; }
.markdown-body h4 { font-size: 1.1em; }
.markdown-body h5 { font-size: 1em; }
.markdown-body h6 { font-size: 0.9em; color: #6a737d; }

.markdown-body .heading-anchor {
    position: relative;
}

.markdown-body .anchor-link {
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.8em;
    text-decoration: none;
}

.markdown-body .heading-anchor:hover .anchor-link {
    opacity: 1;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    margin: 1em 0;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 2em;
}

.markdown-body li {
    margin: 0.25em 0;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(175, 184, 193, 0.2);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

.markdown-body pre {
    padding: 1em;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f6f8fa;
    border-radius: 6px;
    margin: 1em 0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.markdown-body table th,
.markdown-body table td {
    padding: 0.5em 1em;
    border: 1px solid #dfe2e5;
}

.markdown-body table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .markdown-body {
        font-size: 13px;
        padding: 0.5rem;
    }

    .markdown-body h1 { font-size: 1.4em; }
    .markdown-body h2 { font-size: 1.3em; }
    .markdown-body h3 { font-size: 1.2em; }
}

.ai-summary-result {
    min-height: 600px;
}

/* 流式输出稳定性样式 */
#streaming-content {
    font-size: 14px !important;
    line-height: 1.6 !important;
    contain: layout style paint;
    will-change: transform;
}

/* 强制稳定标题大小 */
#streaming-content .markdown-heading-1 {
    font-size: 1.8em !important;
    line-height: 1.3 !important;
    margin: 1.5em 0 0.8em 0 !important;
}
#streaming-content .markdown-heading-2 {
    font-size: 1.5em !important;
    line-height: 1.3 !important;
    margin: 1.3em 0 0.6em 0 !important;
}
#streaming-content .markdown-heading-3 {
    font-size: 1.3em !important;
    line-height: 1.3 !important;
    margin: 1.1em 0 0.5em 0 !important;
}
#streaming-content .markdown-heading-4 {
    font-size: 1.1em !important;
    line-height: 1.3 !important;
    margin: 1em 0 0.4em 0 !important;
}
#streaming-content .markdown-heading-5 {
    font-size: 1em !important;
    line-height: 1.3 !important;
    margin: 0.9em 0 0.3em 0 !important;
}
#streaming-content .markdown-heading-6 {
    font-size: 0.9em !important;
    line-height: 1.3 !important;
    margin: 0.8em 0 0.2em 0 !important;
}

/* 稳定段落和列表样式 */
#streaming-content p,
#streaming-content li {
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 0.5em 0 !important;
}

/* 稳定代码块样式 */
#streaming-content pre,
#streaming-content code {
    font-size: 13px !important;
    font-family: 'Courier New', Monaco, monospace !important;
    line-height: 1.4 !important;
}

/* 稳定表格样式 */
#streaming-content table {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* 防止任何继承样式影响 */
#streaming-content * {
    box-sizing: border-box !important;
    font-family: inherit !important;
}

/* 提问输入框样式 */
#ai-question-input {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.3s;
    font-size: 0.9rem;
}

#ai-question-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#ask-ai-question-btn, #ai-summary-btn {
    background-color: var(--primary-color);
    color: white;
}

#ask-ai-question-btn:hover, #ai-summary-btn:hover {
    background-color: #218838;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 90%;
    }

    #ai-summary-content .alert {
        margin-bottom: 1rem;
    }
}

/* 定义光标样式 */
.streaming-cursor {
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s infinite;
}

/* 定义闪烁动画 */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
