/* ==================== 全局样式 ==================== */
:root {
    --primary-color: #1e88e5;
    --secondary-color: #ff6b6b;
    --accent-color: #ffa726;
    --background-color: #f5f7fa;
    --text-color: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e1e8ed;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* ==================== 导航栏样式 ==================== */
.tm-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.uk-navbar-container:not(.uk-navbar-transparent) {
    background: transparent;
}

.uk-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.uk-navbar-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.uk-navbar-right {
    display: flex;
    align-items: center;
}

/* Logo样式 */
.uk-navbar-item.uk-logo {
    padding: 8px 15px;
}

.uk-navbar-item.uk-logo img {
    max-height: 44px;
    width: auto;
    display: block;
}

/* 导航链接样式 */
.uk-navbar-nav > li > a {
    color: white !important;
    font-weight: 500;
    text-transform: none;
    padding: 0 18px;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.uk-navbar-nav > li > a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.uk-navbar-nav > li.uk-active > a {
    background: rgba(255, 255, 255, 0.2);
}

/* 汉堡按钮样式 - 移到右上角 */
.uk-navbar-toggle {
    color: white !important;
    padding: 0 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.uk-navbar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.uk-navbar-toggle i {
    font-size: 24px;
}

/* 移动端导航样式 */
.uk-offcanvas-bar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
}

.uk-offcanvas-bar .uk-nav-default > li > a {
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.uk-offcanvas-bar .uk-nav-default > li > a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.uk-offcanvas-close {
    color: white;
}

/* ==================== 容器和布局优化 ==================== */
.uk-container {
    padding-left: 8px;
    padding-right: 8px;
    max-width: 100%;
}

/* 移动端减少内边距 */
@media (max-width: 639px) {
    .uk-container {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .uk-card {
        margin-left: 0;
        margin-right: 0;
    }
    
    .uk-card-body {
        padding: 8px !important;
    }
    
    .uk-card-header {
        padding: 8px 10px !important;
    }
    
    .uk-margin-medium-top {
        margin-top: 10px !important;
    }
    
    .uk-margin-medium-bottom {
        margin-bottom: 10px !important;
    }
    
    .uk-margin {
        margin-bottom: 10px !important;
    }
    
    .uk-grid-small {
        margin-left: -5px;
    }
    
    .uk-grid-small > * {
        padding-left: 5px;
    }
    
    .uk-grid-medium {
        margin-left: -5px;
    }
    
    .uk-grid-medium > * {
        padding-left: 5px;
    }
}

/* 平板端优化 */
@media (min-width: 640px) and (max-width: 959px) {
    .uk-container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .uk-card-body {
        padding: 12px !important;
    }
    
    .uk-card-header {
        padding: 10px 12px !important;
    }
}

/* 桌面端也减少一些 */
@media (min-width: 960px) {
    .uk-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ==================== 卡片样式 ==================== */
.uk-card {
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: white;
}

.uk-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.uk-card-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-bottom: 2px solid var(--primary-color);
    padding: 10px 12px;
}

.uk-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.uk-card-title i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.uk-card-body {
    padding: 12px;
}

/* ==================== 图片样式 ==================== */
.article-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.article-thumb-small {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.uk-card:hover .article-thumb {
    transform: scale(1.05);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 文章页面样式 ==================== */
.uk-breadcrumb {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.uk-breadcrumb > * > * {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.uk-breadcrumb > * > *:hover {
    color: var(--primary-color);
}

.uk-article-title {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.uk-article-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.uk-article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.uk-article-meta i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.uk-article-content {
    margin-top: 15px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.uk-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.uk-article-content p {
    margin-bottom: 1em;
}

.uk-article-content h2,
.uk-article-content h3 {
    margin-bottom: 0.6em;
    font-weight: 600;
}
.uk-width-auto{
    float: left;
}
.uk-width-auto img{
    margin: 0px 30px 0px 0px ;
}
/* ==================== 列表样式 ==================== */
.uk-list > li {
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.uk-list > li:hover {
    background-color: rgba(30, 136, 229, 0.05);
    border-left: 3px solid var(--primary-color);
    padding-left: 5px;
}

.uk-list-divider > li:nth-child(n+2) {
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    padding-top: 6px;
}

/* ==================== 最佳回答样式 ==================== */
.best-answer {
    border: 2px solid var(--primary-color);
    position: relative;
    background: linear-gradient(to bottom, rgba(30, 136, 229, 0.03), white);
}

.best-answer::before {
    content: "✓ 最佳回答";
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(30, 136, 229, 0.3);
}

/* ==================== 回答卡片样式 ==================== */
.answer-card {
    margin-bottom: 12px;
}

.answer-card .uk-card-footer {
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
}

.answer-card .uk-card-header {
    padding: 10px 12px;
}

.answer-card .uk-card-body {
    padding: 10px 12px;
}

/* ==================== 页脚样式 ==================== */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    margin-top: 30px;
}

footer h3 {
    color: white;
    margin-bottom: 8px;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

footer .footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

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

@media (max-width: 639px) {
    footer {
        margin-top: 20px;
    }
    
    footer .uk-padding-small {
        padding: 15px 5px;
    }
}

/* ==================== 侧边栏粘性定位 ==================== */
@media (min-width: 960px) {
    .sidebar-sticky {
        position: sticky;
        top: 80px;
        align-self: flex-start;
    }
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 639px) {
    .uk-article-title {
        font-size: 1.25rem;
        margin-bottom: 0.6rem;
    }
    
    .uk-article-content {
        font-size: 14px;
        margin-top: 10px;
    }
    
    .uk-article-meta {
        font-size: 0.8rem;
        gap: 8px;
        padding-bottom: 10px;
    }
    
    .article-thumb {
        height: 140px;
    }
    
    .article-thumb-small {
        width: 70px;
        height: 55px;
    }
    
    .uk-card-title {
        font-size: 0.9rem;
    }
    
    .uk-breadcrumb {
        font-size: 0.85rem;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uk-animation-fade {
    animation: fadeInUp 0.4s ease-out;
}

/* ==================== 按钮美化 ==================== */
.uk-button {
    transition: all 0.3s ease;
    border-radius: 6px;
    font-weight: 500;
}

.uk-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.uk-button-primary:hover {
    background: #1976d2;
}

/* ==================== 加载优化 ==================== */
img[loading="lazy"] {
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==================== SEO优化：提升可读性 ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1565c0;
    text-decoration: underline;
}

/* ==================== 可访问性优化 ==================== */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.uk-navbar-toggle:focus,
.uk-offcanvas-close:focus {
    outline-color: white;
}

/* ==================== 打印样式 ==================== */
@media print {
    .tm-header,
    footer,
    .uk-navbar-toggle,
    aside {
        display: none;
    }
    
    .uk-width-expand\@m {
        width: 100% !important;
    }
}
@media (min-width: 960px) {
    .uk-width-expand\@m {
        width: 66%;
        float: left;
    }
}



@media (min-width: 960px) {
    .sidebar-sticky {
        float: left;
    }
}