/* ================================
   露天台阶爆破智能设计系统 - 全局样式
   主题色：深蓝工业风格
   ================================ */

:root {
    --primary-color: #1a5276;
    --secondary-color: #0e3d57;
    --accent-color: #2e86c1;
    --success-color: #27ae60;
    --warning-color: #d68910;
    --danger-color: #c0392b;
    --info-color: #2980b9;
    --bg-color: #f4f6f8;
    --text-color: #2c3e50;
    --border-color: #d5dbdb;
}

/* ================================
   全局样式
   ================================ */
body {
    font-size: 16px;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
}

/* 内容区域最小高度 */
.content {
    min-height: 600px;
    margin-top: 80px;
    padding-bottom: 50px;
}

/* ================================
   导航栏优化
   ================================ */
#mainNav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    min-height: 72px;
    padding: 0;
    border: 0;
    background: linear-gradient(135deg, #1a5276 0%, #0e3d57 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

#mainNav .nav-shell {
    width: 100%;
    max-width: none;
    min-height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
}

#mainNav .navbar-brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 13px;
    margin-right: 32px;
    padding: 6px 14px 6px 8px;
    font-weight: 800;
    font-size: 1.46rem;
    line-height: 1.15;
    letter-spacing: 0.035em;
    white-space: nowrap;
    color: #0e3d57 !important;
    background: #fffaf0;
    border: 1px solid rgba(214, 162, 20, 0.28);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(5, 36, 52, 0.18);
}

#mainNav .brand-logo,
#mainNav .brand-mark {
    width: 126px;
    height: 43px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 5px;
    opacity: 0.93;
}

#mainNav .brand-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 5px;
    background-color: #fffaf0;
    isolation: isolate;
}

#mainNav .brand-logo-frame .brand-logo {
    mix-blend-mode: multiply;
}

/* 兼容 Flask 进程缓存的旧导航模板：旧圆形图标直接显示 baoli.png。 */
#mainNav .brand-mark {
    background: #fffaf0 url("../images/baoli.png?v=20260729") center / contain no-repeat;
    background-blend-mode: multiply;
    border: 0;
    box-shadow: none;
}

#mainNav .brand-mark i {
    display: none;
}

#mainNav .brand-text {
    color: #0e3d57;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

#mainNav .navbar-collapse {
    justify-content: flex-end;
}

#mainNav .navbar-nav {
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}

#mainNav .navbar-nav > li.nav-item {
    display: flex;
    align-items: center;
}

#mainNav .nav-link,
#mainNav .navbar-nav > li.nav-item > a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    padding: 0.56rem 0.82rem;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
    border-radius: 999px;
}

#mainNav .nav-link i {
    font-size: 0.92rem;
    opacity: 0.9;
}

#mainNav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-1px);
}

#mainNav.is-fixed,
#mainNav.is-visible {
    top: 0;
    transform: none;
    border: 0;
    background: linear-gradient(135deg, #1a5276 0%, #0e3d57 100%);
}

#mainNav.is-fixed .navbar-brand,
#mainNav.is-fixed .navbar-nav > li.nav-item > a {
    color: white !important;
}

#mainNav .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    font-weight: 700;
}

#mainNav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}

@media (max-width: 1199.98px) {
    #mainNav .nav-shell {
        padding: 0 18px;
    }

    #mainNav .navbar-brand {
        gap: 11px;
        font-size: 1.22rem;
        margin-right: 18px;
    }

    #mainNav .brand-logo,
    #mainNav .brand-mark {
        width: 104px;
        height: 36px;
    }

    #mainNav .nav-link,
    #mainNav .navbar-nav > li.nav-item > a {
        padding: 0.5rem 0.62rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 1099.98px) and (min-width: 992px) {
    #mainNav .navbar-brand {
        gap: 9px;
        font-size: 1.16rem;
        margin-right: 6px;
        padding: 4px 8px 4px 5px;
    }

    #mainNav .brand-logo,
    #mainNav .brand-mark {
        width: 92px;
        height: 31px;
    }

    #mainNav .navbar-nav {
        gap: 2px;
    }

    #mainNav .nav-link,
    #mainNav .navbar-nav > li.nav-item > a {
        gap: 4px;
        padding: 0.42rem 0.28rem;
        font-size: 0.74rem;
    }
}

@media (max-width: 991.98px) {
    #mainNav {
        min-height: 64px;
    }

    #mainNav .nav-shell {
        min-height: 64px;
        padding: 0 16px;
    }

    #mainNav .navbar-brand {
        gap: 9px;
        font-size: 1.12rem;
        max-width: calc(100vw - 132px);
        overflow: hidden;
        padding: 4px 8px 4px 5px;
    }

    #mainNav .brand-logo,
    #mainNav .brand-mark {
        width: 76px;
        height: 26px;
    }

    #mainNav .brand-text {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #mainNav .navbar-collapse {
        width: 100%;
        margin-top: 10px;
        padding: 10px;
        background: rgba(9, 48, 70, 0.96);
        border-radius: 8px;
    }

    #mainNav .navbar-nav {
        align-items: stretch;
        gap: 4px;
    }

    #mainNav .nav-link,
    #mainNav .navbar-nav > li.nav-item > a {
        justify-content: flex-start;
        padding: 0.72rem 0.86rem;
        border-radius: 6px;
    }
}

/* ================================
   页面头部 (Header)
   ================================ */
.masthead {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
}

.masthead .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 82, 118, 0.85) 0%, rgba(14, 61, 87, 0.85) 100%);
    border-radius: 0 0 25px 25px;
}

.masthead .site-heading {
    padding: 220px 0 170px;
    color: white;
    text-align: center;
}

.masthead .site-heading h1 {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.masthead .site-heading .subheading {
    font-size: 1.4rem;
    font-weight: 300;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
}

/* 文章头部 */
.post-heading {
    color: white;
    text-align: center;
    padding: 50px 0;
}

.post-heading h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.post-heading .meta {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ================================
   卡片样式
   ================================ */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background-color: white;
    margin-bottom: 25px;
}

.card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
    color: var(--primary-color);
}

.card-header.bg-primary { background-color: var(--primary-color) !important; color: white !important; }
.card-header.bg-success { background-color: var(--success-color) !important; color: white !important; }
.card-header.bg-warning { background-color: var(--warning-color) !important; color: white !important; }
.card-header.bg-info { background-color: var(--info-color) !important; color: white !important; }
.card-header.bg-danger { background-color: var(--danger-color) !important; color: white !important; }

.card-body {
    padding: 1.5rem;
}

.feature-title-link {
    color: var(--text-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.feature-title-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* ================================
   文章列表
   ================================ */
.post-preview {
    padding: 25px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.post-preview:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateX(5px);
}

.post-preview .post-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.post-preview .post-author {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* ================================
   表单样式
   ================================ */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 134, 193, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.btn {
    border-radius: 8px;
    padding: 10px 22px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 82, 118, 0.3);
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #1e8449;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #b9770e;
    transform: translateY(-2px);
}

.btn-info {
    background-color: var(--info-color);
}

.btn-info:hover {
    background-color: #1f618d;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #a93226;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* ================================
   登录/注册表单卡片
   ================================ */
.auth-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 35px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.12);
    border-top: 4px solid var(--primary-color);
}

.auth-card .card-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.8rem;
}

/* ================================
   消息提示
   ================================ */
.message-info {
    margin-top: 80px;
    padding-left: 0;
    list-style: none;
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
    font-weight: 500;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

/* ================================
   表格样式
   ================================ */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table thead th {
    font-weight: 600;
    padding: 14px 12px;
    border: none;
    font-size: 0.9rem;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f1f1;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ================================
   分页样式
   ================================ */
.pagination .page-link {
    border-radius: 25px;
    margin: 0 5px;
    border: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 10px 18px;
    background-color: white;
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    background-color: #f1f1f1;
    color: #bdc3c7;
}

/* ================================
   页脚
   ================================ */
.footer {
    background: linear-gradient(135deg, #1a252f 0%, #0e1a22 100%);
    text-align: center;
    color: #9baec7;
    margin-top: 80px;
    padding: 45px 0 35px;
    border-radius: 20px 20px 0 0;
}

.footer-nav {
    height: 50px;
    line-height: 50px;
    border-bottom: 1px solid #34495e;
    text-align: center;
    margin-bottom: 25px;
}

.footer-nav a {
    color: #9baec7;
    padding: 0 18px;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer-nav a:hover {
    color: white;
}

.copy {
    border-top: 1px solid #2c3e50;
    padding-top: 25px;
    font-size: 0.85rem;
    line-height: 1.8;
}

.icp-link {
    display: inline-block;
    margin-top: 8px;
    color: #9baec7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-link:hover,
.icp-link:focus {
    color: #fff;
    text-decoration: underline;
}

/* ================================
   控制台样式
   ================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.dashboard-header h1 small {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 400;
    margin-left: 12px;
}

/* 统计卡片 */
.dashboard-header + .row .card {
    border-radius: 12px;
    overflow: hidden;
}

/* ================================
   表单错误消息
   ================================ */
.errorlist {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 6px;
    padding-left: 0;
    list-style: none;
}

.errorlist i {
    margin-right: 5px;
}

/* ================================
   徽章样式
   ================================ */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-info { background-color: var(--info-color); }
.badge-success { background-color: var(--success-color); }
.badge-warning { background-color: var(--warning-color); }
.badge-danger { background-color: var(--danger-color); }

/* ================================
   响应式设计
   ================================ */
@media (max-width: 768px) {
    .masthead .site-heading {
        padding: 170px 0 120px;
    }
    
    .masthead .site-heading h1 {
        font-size: 2.2rem;
    }
    
    .masthead .site-heading .subheading {
        font-size: 1.1rem;
    }
    
    .post-heading h1 {
        font-size: 1.8rem;
    }
    
    .content {
        margin-top: 70px;
        min-height: 400px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-header .btn {
        margin-top: 15px;
    }
    
    .message-info {
        position: static;
        max-width: none;
    }
}

/* ================================
   工具类
   ================================ */
.opacity-50 {
    opacity: 0.5;
}

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }

/* 打印样式 */
@media print {
    #mainNav, .footer, .btn, .message-info {
        display: none !important;
    }
    
    .content {
        margin-top: 0;
    }
}
