/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局字体设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 滚动条隐藏类 */
.scrollbar-hide {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 布局容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #2d3748;
}

/* 公告滚动动画 */
@keyframes marquee {
    0% {
        transform: translateX(100%);
        transform-origin: right;
    }
    100% {
        transform: translateX(-100%);
        transform-origin: right;
    }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
    transform-origin: right;
    white-space: nowrap;
    text-align: right;
}

/* 当鼠标悬停时暂停滚动 */
#announcement:hover {
    animation-play-state: paused;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

/* 段落样式 */
p {
    margin-bottom: 16px;
    color: #4a5568;
}

/* 链接样式 */
a {
    color: #4299e1;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #3182ce;
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background-color: #4299e1;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.btn:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 按钮变体 */
.btn-primary {
    background-color: #4299e1;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-secondary {
    background-color: #718096;
}

.btn-secondary:hover {
    background-color: #4a5568;
}

.btn-success {
    background-color: #48bb78;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-danger {
    background-color: #f56565;
}

.btn-danger:hover {
    background-color: #e53e3e;
}

.btn-warning {
    background-color: #ed8936;
}

.btn-warning:hover {
    background-color: #dd6b20;
}

.btn-info {
    background-color: #38b2ac;
}

.btn-info:hover {
    background-color: #319795;
}

.btn-outline {
    background-color: transparent;
    border-color: #4299e1;
    color: #4299e1;
}

.btn-outline:hover {
    background-color: #4299e1;
    color: #fff;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* 输入框样式 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4a5568;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
input[type="number"]:disabled,
input[type="date"]:disabled,
input[type="time"]:disabled,
textarea:disabled,
select:disabled {
    background-color: #f7fafc;
    opacity: 0.7;
    cursor: not-allowed;
}

/* 复选框和单选按钮样式 */
input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}

label {
    font-weight: 500;
    color: #2d3748;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #718096;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

tr:hover {
    background-color: #f7fafc;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination li {
    margin: 0 0.25rem;
    list-style: none;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #fff;
    color: #4a5568;
    transition: all 0.2s ease-in-out;
}

.pagination a:hover {
    background-color: #f7fafc;
    text-decoration: none;
}

.pagination .active a {
    background-color: #4299e1;
    border-color: #4299e1;
    color: #fff;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: #fff;
    background-color: #718096;
    border-radius: 0.375rem;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background-color: #4299e1;
}

.badge-success {
    background-color: #48bb78;
}

.badge-danger {
    background-color: #f56565;
}

.badge-warning {
    background-color: #ed8936;
}

.badge-info {
    background-color: #38b2ac;
}

/* 提示框样式 */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fff4;
    border-color: #c6f6d5;
    color: #276749;
}

.alert-danger {
    background-color: #fff5f5;
    border-color: #fed7d7;
    color: #c53030;
}

.alert-warning {
    background-color: #fffaf0;
    border-color: #fefcbf;
    color: #975a16;
}

.alert-info {
    background-color: #ebf8ff;
    border-color: #bee3f8;
    color: #2b6cb0;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 模态框 */
.modal {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.modal.show {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.modal-footer .btn {
    margin-left: 0.5rem;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #4a5568;
    color: #fff;
    text-align: center;
    border-radius: 0.25rem;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #4a5568 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 网格系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* 边距和填充 */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-5 { margin: 1.25rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-5 { margin-left: 1.25rem; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-5 { margin-right: 1.25rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-5 { padding-bottom: 1.25rem; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-4 { padding-left: 1rem; }
.pl-5 { padding-left: 1.25rem; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-3 { padding-right: 0.75rem; }
.pr-4 { padding-right: 1rem; }
.pr-5 { padding-right: 1.25rem; }

/* 文本颜色 */
.text-primary { color: #4299e1; }
.text-success { color: #48bb78; }
.text-danger { color: #f56565; }
.text-warning { color: #ed8936; }
.text-info { color: #38b2ac; }
.text-gray-100 { color: #f7fafc; }
.text-gray-200 { color: #edf2f7; }
.text-gray-300 { color: #e2e8f0; }
.text-gray-400 { color: #cbd5e0; }
.text-gray-500 { color: #a0aec0; }
.text-gray-600 { color: #718096; }
.text-gray-700 { color: #4a5568; }
.text-gray-800 { color: #2d3748; }
.text-gray-900 { color: #1a202c; }

/* 背景颜色 */
.bg-primary { background-color: #4299e1; }
.bg-success { background-color: #48bb78; }
.bg-danger { background-color: #f56565; }
.bg-warning { background-color: #ed8936; }
.bg-info { background-color: #38b2ac; }
.bg-gray-100 { background-color: #f7fafc; }
.bg-gray-200 { background-color: #edf2f7; }
.bg-gray-300 { background-color: #e2e8f0; }
.bg-gray-400 { background-color: #cbd5e0; }
.bg-gray-500 { background-color: #a0aec0; }
.bg-gray-600 { background-color: #718096; }
.bg-gray-700 { background-color: #4a5568; }
.bg-gray-800 { background-color: #2d3748; }
.bg-gray-900 { background-color: #1a202c; }

/* 文本对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* 文本大小 */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

/* 字体粗细 */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 显示/隐藏 */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flex 工具类 */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.align-stretch { align-items: stretch; }
.flex-1 { flex: 1; }

/* 响应式断点 */
@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    .modal {
        margin: 10px;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding: 0 15px;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6 {
        max-width: 100%;
        flex: 0 0 100%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding: 0 20px;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        padding: 0 25px;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 0 30px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

/* 打字练习特有样式 */
.typing-container {
    background-color: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 150px;
}

.typing-text {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #4a5568;
}

.typing-input {
    width: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.125rem;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    resize: none;
    margin-top: 1rem;
}

.typing-input:focus {
    border-color: #4299e1;
    outline: none;
}

.typed-correct {
    color: #48bb78;
}

.typed-incorrect {
    color: #f56565;
    background-color: #fed7d7;
}

.current-char {
    border-bottom: 2px solid #4299e1;
    background-color: #ebf8ff;
}

/* 统计卡片样式 */
.stat-card {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4299e1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
}

/* 排行榜样式 */
.leaderboard {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease-in-out;
}

.leaderboard-item:hover {
    background-color: #f7fafc;
}

.leaderboard-rank {
    font-weight: 700;
    color: #718096;
    margin-right: 1rem;
    width: 2rem;
    text-align: center;
}

.leaderboard-rank.top-3 {
    color: #ed8936;
}

.leaderboard-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 700;
    color: #4a5568;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.leaderboard-score {
    font-size: 0.875rem;
    color: #718096;
}

/* 计时器样式 */
.timer {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    margin-bottom: 1rem;
}

/* 进度条样式 */
.progress-container {
    width: 100%;
    height: 1rem;
    background-color: #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background-color: #4299e1;
    transition: width 0.3s ease-in-out;
}