/* Import Google Font - Example: Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body {
    font-family: 'Poppins', Arial, sans-serif;
    line-height: 1.6; /* 调整行高 */
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa; /* 更亮、更柔和的背景色 */
    color: #343a40; /* 更深的文本颜色以提高对比度 */
    font-size: 16px; /* 基础字体大小 */
}

.container {
    max-width: 1200px; /* 保持最大宽度 */
    margin: 0 auto;
    padding: 20px;
}

/* Status Messages - Refine colors and shadows */
.status-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: bold;
    display: none; /* 默认隐藏 */
}
.status-message.loading {
    background-color: #e0f7fa; /* 浅蓝色背景 */
    color: #007bb6; /* 深蓝色文字 */
    border: 1px solid #00acc1;
}
.status-message.success {
    background-color: #d4edda; /* 浅绿色背景 */
    color: #155724; /* 深绿色文字 */
    border: 1px solid #28a745;
}
/* 针对Worker缓存加载的特殊样式 */
.status-message.success.from-worker-cache {
    background-color: #e6ffe6; /* 更浅的绿色 */
    color: #218838;
    border-color: #28a745;
}
/* 针对数据库加载的特殊样式 */
.status-message.success.from-db {
    background-color: #cce5ff; /* 浅蓝色 */
    color: #004085;
    border-color: #007bff;
}
.status-message.error {
    background-color: #f8d7da; /* 浅红色背景 */
    color: #721c24; /* 深红色文字 */
    border: 1px solid #dc3545;
}

pre {
    background-color: #f0f0f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.category-title {
    font-size: clamp(1.8em, 4vw, 2.5em);
    color: #343a40;
    padding-bottom: 40px; /* 调整分割线与文字的距离 */
    margin-bottom: 20px; /* 调整下边距 */
    margin-top: 40px; /* 调整上边距，使其上移 */
    text-align: center;
    font-weight: 600;
    position: relative; /* 为伪元素定位提供上下文 */
}

.category-title::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px; /* 分割线粗细 */
    background-color: #007bff; /* 分割线颜色 */
    position: absolute;
    bottom: 5px; /* Adjusted to 5px from -10px for better positioning. This value ensures the line is consistently below the text. */
    left: 0;
}

/* Custom adjustments for Bootstrap's grid and cards */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col-12, .col-4 {
    padding-left: 15px;
    padding-right: 15px;
}

.card {
    height: 280px; /* Fixed height for cards */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 25px;
}

.card-header {
    font-size: 1.5em; /* 调整字体大小 */
    font-weight: 600;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-body p {
    margin-bottom: 8px;
    font-size: 0.9em; /* 调整字体大小 */
    line-height: 1.5; /* 调整行高 */
}

.card-body strong {
    color: #007bff;
}

.btn {
    margin-top: auto; /* Push button to the bottom */
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 992px) { /* Tablet, 2 columns */
    .card-header {
        font-size: 1.3em;
    }
}

@media (max-width: 768px) { /* Small tablet or large phone, 1 column */
    body {
        padding: 10px;
    }
    .col-4 {
        padding-left: 10px;
        padding-right: 10px;
    }
    .card {
        margin-bottom: 20px;
    }
    .card-header {
        font-size: 1.2em;
    }
    .category-title {
        font-size: clamp(1.4em, 5vw, 1.8em);
        margin-top: 25px;
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) { /* Mobile */
    .container {
        padding: 5px;
    }
    .card-body {
        padding: 10px;
    }
    .card-header {
        font-size: 1.1em;
    }
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}