/* ========== 基础重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}
a { color: #2d7ff9; text-decoration: none; transition: color .2s; }
a:hover { color: #1565d8; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.muted { color: #999; font-size: 13px; }

/* ========== 头部 ========== */
.header {
    background: #1a2332;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 20px;
    flex-wrap: wrap;
}
.logo {
    font-size: 22px;
    color: #2d7ff9;
    font-weight: bold;
    white-space: nowrap;
}
.logo-link { display: inline-block; }
.logo-img {
    height: 44px;
    width: auto;
    max-width: 200px;
    display: block;
}
.nav-top {
    flex: 1;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-top a {
    padding: 14px 18px;
    color: #e8edf5;
    border-radius: 0;
    font-size: 18px;
    font-weight: 500;
    transition: all .2s;
    position: relative;
}
.nav-top a:hover { color: #2d7ff9; background: transparent; }
.nav-top a:hover::after { content: ''; position: absolute; bottom: 0; left: 18px; right: 18px; height: 2px; background: #2d7ff9; }
.nav-top a.active { color: #2d7ff9; background: transparent; }
.nav-top a.active::after { content: ''; position: absolute; bottom: 0; left: 18px; right: 18px; height: 2px; background: #2d7ff9; }

/* 下拉菜单 */
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: inline-flex; align-items: center; gap: 3px; }
.nav-dropdown > a.nav-parent { cursor: default; }
.nav-dropdown .caret { font-size: 12px; opacity: .6; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #1a2332;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    padding: 4px 0;
    display: none;
    z-index: 100;
    flex-direction: column;
    gap: 0;
}
.dropdown-menu a {
    padding: 12px 18px;
    border-radius: 0;
    font-size: 16px;
    white-space: nowrap;
    color: #c0c8d4;
}
.dropdown-menu a:hover { background: transparent; color: #2d7ff9; }
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:hover > a { display: flex; }
.nav-dropdown:hover > a { background: transparent; color: #2d7ff9; border-radius: 0; }

/* 搜索框 */
.search-box {
    display: flex;
    gap: 0;
}
.search-box input {
    padding: 7px 12px;
    border: 1px solid #3a4556;
    border-right: none;
    border-radius: 0;
    font-size: 14px;
    width: 180px;
    outline: none;
    background: #fff;
    transition: border-color .2s;
}
.search-box input:focus { border-color: #2d7ff9; }
.search-box button {
    padding: 7px 16px;
    background: #2d7ff9;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s;
}
.search-box button:hover { background: #1565d8; }

.admin-link {
    padding: 6px 14px;
    background: #2d7ff9;
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
}
.admin-link:hover { background: #e8e8e8; color: #333; }

/* ========== 轮播图 ========== */
.banner {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    height: 340px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.banner-slides { position: relative; width: 100%; height: 100%; }
.banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity .8s ease;
}
.banner-slide.active { opacity: 1; }
.banner-link {
    display: block;
    width: 100%; height: 100%;
}
.banner-title {
    position: absolute;
    bottom: 40px;
    left: 40px;
    color: #fff;
    font-size: 24px;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
    padding: 8px 16px;
    background: rgba(0,0,0,.3);
    border-radius: 0;
    backdrop-filter: blur(4px);
}
.banner-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.banner-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: background .2s;
}
.banner-dot.active { background: #fff; }
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border: none;
    background: rgba(0,0,0,.3);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 2;
    transition: background .2s;
}
.banner-arrow:hover { background: rgba(0,0,0,.6); }
.banner-prev { left: 16px; }
.banner-next { right: 16px; }

/* banner下方广告图 */
.ad-banner {
    max-width: 1200px;
    margin: 0 auto 20px;
    overflow: hidden;
}
.ad-banner a { display: block; }
.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== 图片网格 ========== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
    margin: 25px 0;
}
.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.card a { display: block; color: inherit; }
.thumb {
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}
.thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .3s;
}
.card:hover .thumb img { transform: scale(1.05); }
.info { padding: 12px 14px; }
.info h3 {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-meta .cat, .detail-meta .cat {
    display: inline-block;
    font-size: 12px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 0;
}
.card-meta .views, .detail-meta .views {
    font-size: 12px;
    color: #aaa;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.page-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    color: #666;
    font-size: 14px;
    transition: all .2s;
}
.page-btn:hover:not(.disabled) {
    background: #2d7ff9;
    border-color: #2d7ff9;
    color: #fff;
}
.page-btn.active {
    background: #2d7ff9;
    border-color: #2d7ff9;
    color: #fff;
}
.page-btn.disabled {
    color: #ccc;
    background: #fafafa;
    cursor: not-allowed;
}

/* ========== 详情页 ========== */
.breadcrumb {
    padding: 15px 0;
    color: #999;
    font-size: 14px;
}
.breadcrumb a { color: #666; }
.detail-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 25px;
    border-radius: 0;
    margin-bottom: 30px;
}
.detail-image {
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    position: relative;
    cursor: pointer;
    text-align: center;
}
.detail-image img {
    display: block;
    max-width: 100%;
    height: auto;
}
.zoom-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px; height: 36px;
    background: rgba(0,0,0,.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
}
.zoom-btn:hover { background: rgba(0,0,0,.7); }

/* 多图画廊 */
.gallery-list {
    width: 100%;
}
.gallery-item {
    width: 100%;
    margin-bottom: 10px;
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
}
.gallery-item:last-child { margin-bottom: 0; }
.gallery-item img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: opacity .2s;
}
.gallery-item img:hover { opacity: .92; }
.gallery-count {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 0;
}
.gallery-content {
    width: 100%;
    line-height: 1.8;
    font-size: 14px;
    color: #555;
}
.gallery-content img { max-width: 100%; height: auto; display: block; margin: 10px 0; }
.gallery-content p { margin: 8px 0; }

.detail-info { padding: 10px 0; }
.detail-info h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #222;
}
.detail-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.detail-meta .cat {
    background: #eaf3ff;
    color: #2d7ff9;
    padding: 3px 10px;
    border-radius: 0;
    font-size: 13px;
}
.detail-meta .date, .detail-meta .views { color: #999; font-size: 13px; }
.detail-desc {
    color: #555;
    line-height: 1.8;
    margin-bottom: 25px;
    padding: 15px;
    background: #fafafa;
    border-radius: 0;
    border-left: 3px solid #2d7ff9;
}
.detail-desc img { max-width: 100%; height: auto; }
.detail-desc p { margin: 8px 0; }

/* 固定描述区 */
.detail-desc-fixed {
    margin-bottom: 25px;
    padding: 0;
}
.detail-desc-fixed .desc-list {
    list-style: none;
    padding: 15px;
    margin: 0 0 12px 0;
    background: #fafafa;
    border-radius: 0;
    border-left: 3px solid #2d7ff9;
    color: #555;
    line-height: 2;
}
.detail-desc-fixed .desc-list li {
    padding: 2px 0;
}
.detail-desc-fixed .desc-clause {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #fffbf0;
    border-radius: 0;
    border-left: 3px solid #f0ad4e;
    color: #666;
    line-height: 1.8;
    font-size: 14px;
}
.detail-desc-fixed .desc-clause strong { color: #b8860b; }
.detail-desc-fixed .desc-clause p { margin: 5px 0 0 0; }

.detail-nav { display: flex; gap: 10px; }
.block-title {
    font-size: 18px;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 4px solid #2d7ff9;
    color: #333;
}

/* ========== 灯箱 ========== */
.lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 0;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}
.lightbox-close:hover { color: #ccc; }
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    user-select: none;
    padding: 10px;
    opacity: .6;
    transition: opacity .2s;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { opacity: 1; }
.lightbox-index {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 15px;
    background: rgba(0,0,0,.5);
    padding: 5px 16px;
    border-radius: 0;
    z-index: 10000;
}

/* ========== 搜索结果 ========== */
.search-result-bar {
    padding: 20px 0 10px;
}
.search-result-bar h3 { font-size: 18px; color: #333; }
.search-result-bar strong { color: #2d7ff9; }

/* ========== 空状态 ========== */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}
.empty p { margin-bottom: 20px; font-size: 16px; }

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 9px 22px;
    background: #2d7ff9;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    transition: background .2s;
}
.btn:hover { background: #1565d8; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-cancel { background: #e0e0e0; color: #666; }
.btn-cancel:hover { background: #d0d0d0; color: #333; }
.btn-edit { background: #52c41a; }
.btn-edit:hover { background: #3fa00d; }
.btn-del { background: #ff4d4f; }
.btn-del:hover { background: #d9363e; }

/* ========== 页脚 ========== */
.more-banner {
    display: block;
    text-align: center;
    padding: 18px;
    margin: 25px 0 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    border-radius: 0;
    text-decoration: none;
    transition: opacity .2s;
}
.more-banner:hover { opacity: .9; }

.footer {
    text-align: center;
    padding: 25px;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #e8e8e8;
    margin-top: 40px;
    background: #fff;
}

/* ========== 右侧悬浮工具栏 ========== */
.side-toolbar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.side-toolbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    transition: opacity .2s;
}
.side-toolbar a:hover { opacity: .85; }
.side-toolbar .side-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
}
.side-toolbar .side-kf { background: #999; }
.side-toolbar .side-top { background: #1a4a6e; }
.side-toolbar .side-top.hide { display: none; }

/* ========== 登录页 ========== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2d7ff9, #1565d8);
}
.login-box {
    background: #fff;
    padding: 35px 30px;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    width: 340px;
}
.login-box h2 { text-align: center; margin-bottom: 25px; color: #333; }
.login-tip { text-align: center; color: #999; font-size: 12px; margin-top: 15px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}
.required { color: #ff4d4f; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d7ff9;
    box-shadow: 0 0 0 2px rgba(45,127,249,.15);
}
.form-group textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 25px; }

/* ========== 后台 ========== */
.admin-body { background: #f0f2f5; }
.admin-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header-inner {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-header h2 { font-size: 18px; color: #333; margin-right: 20px; white-space: nowrap; }
.admin-nav { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a {
    padding: 6px 14px;
    color: #666;
    border-radius: 0;
    font-size: 14px;
}
.admin-nav a:hover { background: #f0f6ff; color: #2d7ff9; }
.admin-nav a.active { color: #fff; background: #2d7ff9; }
.admin-main { padding: 20px 15px; }
.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.admin-bar h3 { font-size: 18px; color: #333; }
.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    border-collapse: collapse;
}
.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.admin-table th { background: #fafafa; color: #666; font-weight: 500; }
.admin-table tr:hover { background: #fafafa; }
.admin-thumb {
    width: 50px; height: 50px;
    object-fit: cover;
    border-radius: 0;
}
.admin-form {
    background: #fff;
    padding: 25px;
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    max-width: 600px;
}
.inline-form { max-width: none; display: flex; align-items: flex-end; gap: 10px; margin-bottom: 20px; }

/* 富文本编辑器 */
.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 0;
}
.editor-toolbar button {
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}
.editor-toolbar button:hover { background: #e8f0ff; border-color: #2d7ff9; color: #2d7ff9; }
.editor-body {
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    padding: 12px 15px;
    border: 2px solid #c4d0e0;
    border-radius: 0;
    outline: none;
    background: #fafcff;
    font-size: 14px;
    line-height: 1.8;
    cursor: text;
}
.editor-body:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
    font-size: 13px;
    pointer-events: none;
}
.editor-body:focus { border-color: #2d7ff9; background: #fff; }
.editor-body img { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.editor-body p { margin: 5px 0; }

.current-img {
    margin-bottom: 10px;
    padding: 10px;
    background: #fafafa;
    border-radius: 0;
    display: inline-block;
}

/* ========== 提示 ========== */
.alert {
    padding: 12px 18px;
    border-radius: 0;
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: #f0f9ff; color: #2d7ff9; border: 1px solid #bae0ff; }
.alert-error { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffccc7; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header .container { flex-direction: column; gap: 10px; }
    .nav-top { justify-content: center; }
    .search-box { width: 100%; }
    .search-box input { flex: 1; }
    .banner { height: 200px; }
    .banner-title { font-size: 16px; bottom: 20px; left: 20px; }
    .detail-wrap { grid-template-columns: 1fr; }
    .admin-header-inner { flex-direction: column; gap: 10px; }
    .admin-nav { flex-wrap: wrap; justify-content: center; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 6px; }
}
