/* ==================== 页面过渡动画 ==================== */
.hidden-section { display: none; }
.active-section { display: block; animation: fadeIn 0.3s ease-in; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ==================== 题目卡片样式 ==================== */
.problem-card { 
    background: white; 
    padding: 1.5rem; 
    border-radius: 8px; 
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.problem-card:hover { 
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 第一行：元数据（主题、难度、模式） */
.card-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.theme-tag { 
    display: inline-block; 
    padding: 4px 10px; 
    border-radius: 4px; 
    font-size: 0.85em; 
    font-weight: 500;
    background: #e0f2fe; 
    color: #0369a1; 
}

.difficulty-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    background: #fef3c7;
    color: #92400e;
}

.mode-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
}

/* 第二行：标题 */
.problem-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

/* 第三行：标签 */
.card-tags-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.tag-item {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* ==================== 列表页筛选栏 ==================== */
.list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters-bar {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    align-items: center;
}

.filters-bar select,
.filters-bar input {
    padding: 0.5rem 1rem;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
    background-color: #fff;
}

.filters-bar select:focus,
.filters-bar input:focus {
    outline: none;
    border-color: #409eff;
}

.filters-bar input {
    flex-grow: 1;
}

/* 优化按钮样式 */
.filters-bar .btn {
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* ==================== Markdown 表格样式 ==================== */
#markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    background: white;
}

#markdown-body thead {
    background: #f5f7fa;
}

#markdown-body th,
#markdown-body td {
    padding: 0.6rem 1rem;
    border: 1px solid #dcdfe6;
    text-align: left;
}

#markdown-body th {
    font-weight: 600;
    color: #303133;
    white-space: nowrap;
}

#markdown-body tbody tr:hover {
    background: #f0f7ff;
}

#markdown-body blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid #409eff;
    background: #ecf5ff;
    color: #4a5568;
}

#markdown-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

#markdown-body code {
    background: #f0f2f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', monospace;
}

#markdown-body pre code {
    background: none;
    padding: 0;
}

/* ==================== 题目详情页样式 ==================== */
#problem-content { 
    background: white; 
    padding: 2rem; 
    border-radius: 8px; 
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    line-height: 1.8;
    margin-top: 1.5rem;
}

.meta-info {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #606266;
}

.submit-area { 
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#code-input { 
    width: 100%; 
    height: 250px; 
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    padding: 1rem; 
    border: 1px solid #dcdfe6; 
    border-radius: 6px; 
    margin-top: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

#code-input:focus {
    outline: none;
    border-color: #409eff;
}

.hidden {
    display: none;
}

/* ==================== 分页器 ==================== */
.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: white;
    color: #409eff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    user-select: none;
}

.pager-btn:hover {
    border-color: #409eff;
    background: #ecf5ff;
}

.pager-btn.active {
    background: #409eff;
    color: white;
    border-color: #409eff;
}

.pager-btn.disabled {
    color: #c0c4cc;
    cursor: not-allowed;
    pointer-events: none;
}

.pager-info {
    margin-left: 12px;
    font-size: 0.85rem;
    color: #909399;
}

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    width: 90%;
    max-width: 480px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ebeef5;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #909399;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #303133;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ebeef5;
}

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #303133;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}
