/* 文件名: assets/css/style.css */
/* 全局样式 - 所有页面共用 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f5f7fc;
    color: #1e293b;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 头部样式 */
.site-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 32px 0 24px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border-bottom: 3px solid #f97316;
}

.header-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* 品牌区域 - 可点击返回首页，强制保持白色 */
.branding {
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    color: white;
}

.branding h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;  /* 强制白色 */
}

.branding h1 i {
    color: #f97316;
    font-size: 2rem;
}

.branding p {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-top: 6px;
}

/* 确保所有链接状态都是白色 */
.branding:link,
.branding:visited,
.branding:hover,
.branding:active {
    color: white;
    text-decoration: none;
}

/* 悬停效果 - 轻微透明度变化 */
.branding:hover {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.branding:hover h1 {
    color: white;
}

.main-nav ul {
    display: flex;
    gap: 28px;
    list-style: none;
    flex-wrap: wrap;
}

.main-nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    font-size: 1rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .main-nav ul {
        justify-content: center;
        gap: 20px;
    }
    .branding h1 {
        font-size: 1.6rem;
    }
}

/* 主体布局 */
.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 48px 0;
}

.category-section {
    margin-bottom: 56px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-left: 5px solid #f97316;
    padding-left: 18px;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
}

.section-header h2 i {
    color: #f97316;
    margin-right: 8px;
}

.section-header .more-link {
    color: #f97316;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.section-header .more-link:hover {
    color: #ea580c;
    text-decoration: underline;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.article-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 36px -12px rgba(0,0,0,0.15);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 20px 18px 22px;
    flex: 1;
}

.card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: #f97316;
    margin-bottom: 10px;
    display: inline-block;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

.card-title a {
    color: inherit;
    text-decoration: none;
}

.card-title a:hover {
    color: #f97316;
}

.card-excerpt {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 18px;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #6c757d;
    border-top: 1px solid #edf2f7;
    padding-top: 12px;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
}

.sidebar-widget {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 18px;
    position: relative;
    display: inline-block;
}

.widget-title:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: #f97316;
}

.hot-list {
    list-style: none;
}

.hot-list li {
    margin-bottom: 16px;
    border-bottom: 1px dashed #e9ecef;
    padding-bottom: 12px;
}

.hot-list a {
    text-decoration: none;
    font-weight: 500;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.hot-list a i {
    color: #f97316;
    width: 22px;
}

.hot-list a:hover {
    color: #f97316;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.tag {
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    color: #334155;
    transition: 0.2s;
}

.tag:hover {
    background: #f97316;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid #f97316;
    color: #f97316;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: 0.2s;
}

.btn-outline:hover {
    background: #f97316;
    color: white;
}

.highlight {
    background: linear-gradient(120deg, #fef9e6 0%, #fff2df 100%);
}

/* 文章详情页 */
.article-detail {
    background: white;
    border-radius: 24px;
    padding: 40px;
    margin: 40px 0;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef2f6;
}

.article-header h1 {
    font-size: 2.2rem;
    color: #0f172a;
    margin: 15px 0 10px;
}

.article-meta {
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.article-content {
    line-height: 1.8;
    font-size: 1rem;
    color: #334155;
}

.article-content h3 {
    margin: 24px 0 12px;
    color: #f97316;
}

.article-content pre {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.85rem;
    margin: 16px 0;
}

.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* 页脚 */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 40px 0 24px;
    margin-top: 30px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.footer-social a {
    color: #cbd5e1;
    margin-left: 20px;
    font-size: 1.2rem;
    transition: 0.2s;
}

.footer-social a:hover {
    color: #f97316;
}

/* 后台管理样式 */
.admin-container {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f97316;
}

.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
}

.admin-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn-submit {
    background: #f97316;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit:hover {
    background: #ea580c;
}

.article-list-table {
    width: 100%;
    border-collapse: collapse;
}

.article-list-table th,
.article-list-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}

.article-list-table th {
    background: #f8fafc;
    font-weight: 600;
}

.btn-delete {
    color: #dc2626;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 20px;
    background: #fee2e2;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .sidebar {
        position: static;
    }
}

/* 左图右文布局样式 */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.list-article {
    display: flex;
    gap: 24px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.2s;
}
.list-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.1);
}
.list-article-img {
    flex: 0 0 240px;
}
.list-article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.list-article-content {
    flex: 1;
    padding: 20px 20px 20px 0;
}
.list-article-content h3 {
    font-size: 1.3rem;
    margin: 10px 0 12px;
}
.list-article-content h3 a {
    text-decoration: none;
    color: #0f172a;
}
.list-article-content h3 a:hover {
    color: #f97316;
}
.list-article-content .card-excerpt {
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    .list-article {
        flex-direction: column;
    }
    .list-article-img {
        flex-basis: auto;
        height: 200px;
    }
    .list-article-content {
        padding: 20px;
    }
}

/* 左图右文横向列表布局（每行一条） */
.list-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.list-article {
    display: flex;
    gap: 24px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.2s;
}
.list-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.1);
}
.list-article-img {
    flex: 0 0 200px;
    overflow: hidden;
}
.list-article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.list-article-content {
    flex: 1;
    padding: 20px 20px 20px 0;
}
.list-article-content h3 {
    font-size: 1.3rem;
    margin: 10px 0 12px;
}
.list-article-content h3 a {
    text-decoration: none;
    color: #0f172a;
}
.list-article-content h3 a:hover {
    color: #f97316;
}
.list-article-content .card-excerpt {
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    .list-article {
        flex-direction: column;
    }
    .list-article-img {
        flex-basis: auto;
        height: 200px;
    }
    .list-article-content {
        padding: 20px;
    }
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
/* 分类标题可点击链接样式 */
.section-title-link {
    display: block;          /* 使链接填满整个 h2 区域，点击区域更大 */
    text-decoration: none;  /* 去掉下划线 */
    color: inherit;         /* 继承 h2 原有的文字颜色 */
}

.section-title-link:hover {
    color: #f97316;         /* 悬停时变为主题橙色，与网站风格一致 */
    transition: color 0.2s ease;
}
