/* FPGA代码生成器 - 自定义样式 */

/* 全局样式 */
body {
    font-family: "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* 表单样式 */
.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 代码编辑器样式 */
pre {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
}

/* 代码行号样式 */
.line-numbers {
    position: relative;
    padding-left: 3.8rem;
    counter-reset: linenumber;
}

.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: -3.8rem;
    width: 3rem;
    
    /* 与代码保持相同的字体和行高 */
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    line-height: 1.5;
    
    /* 边框 */
    border-right: 1px solid #ddd;
    user-select: none;
}

.line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #888;
    display: block;
    padding-right: 0.8rem;
    text-align: right;
}

/* 高亮当前行 */
.line-highlight {
    background-color: rgba(255, 255, 0, 0.1);
}

/* 代码高亮 */
.hljs {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

/* 页脚样式 */
footer {
    border-top: 1px solid #dee2e6;
}

/* 首页特殊样式 */
.display-4 {
    font-weight: 700;
}

/* 仪表盘样式 */
.dashboard-card {
    height: 100%;
}

/* 项目详情页样式 */
.code-editor {
    height: 500px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: auto;
}

/* 支付页面样式 */
#qrcode {
    display: inline-block;
    padding: 1rem;
    background-color: #fff;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .code-editor {
        height: 300px;
    }
}

/* 管理后台样式 */
.admin-sidebar {
    background-color: #343a40;
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
}

.admin-sidebar .nav-link:hover {
    color: #fff;
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 表格样式 */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* 加载动画 */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

/* 提示框样式 */
.alert {
    border: none;
    border-radius: 0.25rem;
}

/* 标签页样式 */
.nav-tabs .nav-link {
    border: none;
    color: #495057;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 2px solid #0d6efd;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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