/* 太乙心学 - 公共样式 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    background-color: #f9f7f3; 
    color: #333; 
    font-family: "SimSun", "Songti SC", serif; 
    line-height: 1.8;
}
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 小太极 Logo */
.mini-taiji {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(90deg, #fff 50%, #333 50%);
    position: relative;
    border: 1px solid #333;
    animation: spin 10s linear infinite;
    display: block;
}
.mini-taiji::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #333;
    background-image: radial-gradient(circle at center, #fff 25%, #333 25%);
}
.mini-taiji::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    background-image: radial-gradient(circle at center, #333 25%, #fff 25%);
}
@keyframes spin { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}

/* 导航链接 */
.nav-links {
    flex-wrap: nowrap;
    white-space: nowrap;
    display: flex;
    gap: 15px;
}
.nav-links a {
    white-space: nowrap;
    font-size: 0.95rem;
    color: #555;
    font-weight: bold;
}
.nav-links a:hover, .nav-links a.active {
    color: #d4a017;
}

/* 后台按钮 */
.admin-btn {
    background-color: #333;
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid #333;
}
.admin-btn:hover {
    background-color: #fff;
    color: #333 !important;
}

/* 主体容器 */
.container { 
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px;
    min-height: calc(100vh - 60px - 100px);
}

/* 首页样式 */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
}
.hero-taiji { 
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    background: linear-gradient(90deg, #fff 50%, #333 50%); 
    position: relative; 
    border: 1px solid #333; 
    animation: spin 20s linear infinite; 
    margin: 0 auto 1.5rem; 
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.hero-taiji::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background: #333; 
    background-image: radial-gradient(circle at center, #fff 25%, #333 25%);
}
.hero-taiji::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background: #fff; 
    background-image: radial-gradient(circle at center, #333 25%, #fff 25%);
}

.site-title { 
    font-size: 2.8rem; 
    font-weight: 600; 
    letter-spacing: 8px; 
    color: #1a1a1a;
    margin-bottom: 0.3rem;
}
.site-slogan {
    font-size: 1.15rem;
    color: #8b4513;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.site-subtitle { 
    color: #666; 
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* 栏目卡片 */
.nav-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 15px; 
    margin-top: 2rem;
}
.nav-card { 
    background: #fff; 
    padding: 2rem; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    text-align: center; 
    border: 1px solid #eee;
    transition: transform 0.3s, box-shadow 0.3s;
}
.nav-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); 
}
.nav-card:nth-child(1) { border-top: 4px solid #d4a017; }
.nav-card:nth-child(2) { border-top: 4px solid #333; }
.nav-card:nth-child(3) { border-top: 4px solid #8fbc8f; }
.nav-card:nth-child(4) { border-top: 4px solid #aaa; }
.card-icon { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.card-title { font-size: 1.4rem; margin-bottom: 0.8rem; font-weight: bold; }
.card-desc { font-size: 0.9rem; color: #777; line-height: 1.6; }
.article-count { font-size: 0.8rem; color: #999; margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed #e0e0e0; letter-spacing: 1px; }

/* 文章序号 */
.article-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f0f0f0;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 最新文章 */
.latest-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}
.section-title {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #555;
}
.latest-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.latest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #eee;
    transition: all 0.3s;
}
.latest-item:hover {
    border-color: #d4a017;
}
.latest-item a { font-weight: bold; }
.latest-item span { font-size: 0.8rem; color: #999; }

/* 列表页 */
.page-header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}
.page-title {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}
.page-desc { color: #666; font-size: 1rem; font-style: italic; }

/* 文章卡片列表 */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.article-card {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.3s, box-shadow 0.3s;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}
.article-date { font-size: 0.8rem; color: #999; margin-bottom: 0.5rem; }
.article-title { font-size: 1.3rem; font-weight: bold; margin-bottom: 0.8rem; }
.article-title a:hover { color: #d4a017; }
.article-summary { font-size: 0.95rem; color: #666; line-height: 1.7; }
.article-tags { margin-top: 1rem; display: flex; gap: 10px; }
.tag { font-size: 0.75rem; padding: 2px 8px; background: #f0f0f0; border-radius: 3px; color: #666; }

/* 文章页顶部栏 */
.article-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}
.article-top-bar .back-link {
    margin-bottom: 0;
}
.article-top-bar .article-category {
    margin-left: auto;
    font-size: 0.9rem;
    color: #d4a017;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: #fdf8f0;
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid #f0e0c0;
}
/* 文章页头部 */
.article-header {
    text-align: center;
    margin-bottom: 2rem;
}
.article-category {
    display: inline-block;
    font-size: 0.8rem;
    color: #d4a017;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.article-meta {
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    font-size: 0.8rem;
    color: #999;
    letter-spacing: 0.1em;
    margin-top: 0.6rem;
}
/* 文章页 */
.article-content {
    font-size: 1rem;
    line-height: 1.9;
}
.article-content p {
    margin-bottom: 1rem;
    text-indent: 2em;
}
.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f5f5f5;
    border-left: 4px solid #d4a017;
    font-style: italic;
}
.article-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}
.article-content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}
.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}
.article-content li { margin-bottom: 0.5rem; }

/* 通用 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}
.back-link:hover { color: #d4a017; }
footer { 
    text-align: center; 
    padding: 2rem 0; 
    color: #999; 
    font-size: 0.8rem; 
    border-top: 1px solid #eee; 
    margin-top: 2rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .nav-left {
        margin-bottom: 10px;
        width: 100%;
        justify-content: center;
    }
    .nav-links {
    flex-wrap: nowrap;
    white-space: nowrap;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }
    .admin-btn { margin-top: 5px; }
    .nav-grid { grid-template-columns: 1fr; }
    .article-card { padding: 1rem; }
    .article-title { font-size: 1.5rem; }
}