/* ============================================
   东方命理主题 - Oriental Mystic Theme
   ============================================ */

:root {
    --bg-dark: #0a0a0f;
    --bg-mid: #1a1a2e;
    --bg-light: #2a2a4e;
    --card-bg: #12122a;
    --card-bg-hover: #1a1a3e;
    --gold: #d4af37;
    --gold-light: #f4df87;
    --gold-dim: #8b7355;
    --text: #f0e6d2;
    --text-dim: #b8a88c;
    --accent: #c9b896;
    --border-gold: rgba(212, 175, 55, 0.3);
    --glow-gold: rgba(212, 175, 55, 0.15);
    --font-serif: 'Georgia', 'Times New Roman', 'Noto Serif SC', serif;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-dark: #f5f0e8;
    --bg-mid: #e8e0d0;
    --bg-light: #d4c9b8;
    --card-bg: #fffdf5;
    --card-bg-hover: #fff8e8;
    --text: #2a1f14;
    --text-dim: #5a4a3a;
    --gold: #8b6914;
    --gold-light: #d4af37;
    --gold-dim: #a08050;
    --border-gold: rgba(139, 105, 20, 0.3);
    --glow-gold: rgba(139, 105, 20, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-serif);
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-dark) 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

.stars { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.star { position: absolute; width: 2px; height: 2px; background: white; border-radius: 50%; animation: starTwinkle 3s infinite; }
@keyframes starTwinkle { 0%, 100% { opacity: 0.3; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); } }

.bagua-bg { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80vh; height: 80vh; opacity: 0.03; pointer-events: none; z-index: 0; animation: baguaRotate 120s linear infinite; }
@keyframes baguaRotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.mountain-layer { position: fixed; bottom: 0; left: 0; width: 100%; height: 200px; pointer-events: none; z-index: 1; }
.mountain { position: absolute; bottom: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(10,10,15,0.8), transparent); }

.mist { position: fixed; bottom: 0; left: 0; width: 100%; height: 100px; background: linear-gradient(to top, var(--bg-dark), transparent); pointer-events: none; z-index: 2; animation: mistFloat 20s ease-in-out infinite; }
@keyframes mistFloat { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.6; } }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(10, 10, 15, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-gold); padding: 16px 0; }
[data-theme="light"] .site-header { background: rgba(245, 240, 232, 0.95); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }

.site-title { font-size: 1.1rem; color: #ffffff; text-decoration: none; font-weight: bold; letter-spacing: 1px; transition: var(--transition); }
.site-title:hover { color: var(--gold-light); text-shadow: 0 0 10px var(--glow-gold); }
.title-diamond { color: #e74c3c; font-size: 0.85rem; vertical-align: middle; }

.nav-menu { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav-menu a { color: var(--text); text-decoration: none; font-size: 0.95rem; transition: var(--transition); }
.nav-menu a:hover { color: var(--gold); }

.theme-toggle { background: none; border: none; color: var(--gold); font-size: 1.2rem; cursor: pointer; transition: var(--transition); }
.theme-toggle:hover { color: var(--gold-light); transform: scale(1.1); }

.language-selector { display: flex; align-items: center; }
.language-selector select { background: rgba(10, 10, 15, 0.8); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 6px; color: var(--gold); padding: 8px 15px; font-size: 14px; cursor: pointer; transition: all 0.3s ease; font-family: var(--font-serif); }
.language-selector select:hover { border-color: var(--gold); box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
.language-selector select option { background: var(--bg-dark); color: var(--text); }
[data-theme="light"] .language-selector select { background: rgba(245, 240, 232, 0.9); border-color: rgba(139, 105, 20, 0.5); color: var(--gold); }

.main-wrapper { max-width: 1200px; margin: 0 auto; padding: 40px 20px; position: relative; z-index: 10; display: flex; gap: 30px; }

/* Sidebar */
.sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
.sidebar-header { margin-bottom: 16px; }
.sidebar-toggle { color: var(--gold); cursor: pointer; font-size: 1rem; font-weight: bold; }
.sidebar-group { margin-bottom: 8px; border: 1px solid var(--border-gold); border-radius: 8px; overflow: hidden; }
.sidebar-group-title, .sidebar-subgroup-title { background: rgba(212, 175, 55, 0.1); padding: 12px 16px; cursor: pointer; color: var(--gold); font-weight: bold; font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sidebar-group-title::-webkit-details-marker, .sidebar-subgroup-title::-webkit-details-marker { display: none; }
.sidebar-group-title::marker, .sidebar-subgroup-title::marker { content: ""; }
.sidebar-count { font-size: 0.75rem; color: var(--text-dim); font-weight: normal; }
.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { border-top: 1px solid rgba(212, 175, 55, 0.1); }
.sidebar-list li a { display: block; padding: 10px 16px; color: var(--text); text-decoration: none; font-size: 0.85rem; transition: var(--transition); }
.sidebar-list li a:hover, .sidebar-list li.active a { background: rgba(212, 175, 55, 0.1); color: var(--gold); }
.sidebar-subgroup { margin: 0; border: none; border-radius: 0; }
.sidebar-subgroup-title { background: rgba(212, 175, 55, 0.05); padding: 8px 16px; font-size: 0.85rem; }

.main-content { flex: 1; min-width: 0; }

.hero { text-align: center; padding: 60px 20px; margin-bottom: 40px; }
.hero h1 { font-size: 2.5rem; color: var(--gold); margin-bottom: 16px; text-shadow: 0 0 20px var(--glow-gold); }
.hero p { font-size: 1.1rem; color: var(--text-dim); max-width: 600px; margin: 0 auto; }

.post-list { display: flex; flex-direction: column; gap: 24px; }
.post-card { background: var(--card-bg); border: 1px solid var(--border-gold); border-radius: 12px; padding: 24px; transition: var(--transition); position: relative; }
.post-card:hover { background: var(--card-bg-hover); transform: translateY(-2px); box-shadow: 0 4px 20px var(--glow-gold); }
.post-card h2 { margin-bottom: 12px; }
.post-card h2 a { color: var(--gold); text-decoration: none; font-size: 1.3rem; }
.post-card h2 a:hover { text-decoration: underline; }
.post-excerpt { color: var(--text-dim); margin-bottom: 16px; font-size: 0.95rem; }
.post-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-dim); flex-wrap: wrap; }

.post-single { background: var(--card-bg); border: 1px solid var(--border-gold); border-radius: 12px; padding: 40px; max-width: 900px; margin: 0 auto; }
.post-header { margin-bottom: 32px; border-bottom: 1px solid var(--border-gold); padding-bottom: 24px; }
.post-header h1 { font-size: 2rem; color: var(--gold); margin-bottom: 16px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.post-tags a { background: rgba(212, 175, 55, 0.1); color: var(--gold); padding: 4px 12px; border-radius: 20px; text-decoration: none; font-size: 0.85rem; }
.post-tags a:hover { background: rgba(212, 175, 55, 0.2); }
.post-content { line-height: 2; }
.post-content h2 { color: var(--gold); margin: 32px 0 16px; font-size: 1.5rem; }
.post-content h3 { color: var(--gold-light); margin: 24px 0 12px; }
.post-content p { margin-bottom: 16px; }
.post-content a { color: var(--gold); }
.post-content ul, .post-content ol { margin-left: 24px; margin-bottom: 16px; }
.post-content blockquote { border-left: 3px solid var(--gold); padding-left: 16px; margin: 16px 0; color: var(--text-dim); font-style: italic; }
.post-content code { background: rgba(212, 175, 55, 0.1); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.post-content pre { background: var(--bg-dark); padding: 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; }
.post-content pre code { background: none; padding: 0; }
.post-nav { display: flex; justify-content: space-between; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border-gold); }
.post-nav a { color: var(--gold); text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }

.page-header { text-align: center; padding: 40px 20px; margin-bottom: 32px; }
.page-header h1 { font-size: 2rem; color: var(--gold); margin-bottom: 8px; }

.site-footer { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 0.85rem; border-top: 1px solid var(--border-gold); margin-top: 60px; position: relative; z-index: 10; }
.site-footer a { color: var(--gold); text-decoration: none; }

/* 导航栏 Portal 和 Order 链接 */
.portal-link { color: var(--gold-light); text-decoration: none; font-weight: bold; }
.order-link { color: var(--gold); text-decoration: none; font-weight: bold; background: var(--glow-gold); padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border-gold); }
.order-link:hover { background: var(--gold); color: var(--bg-dark); }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; margin-bottom: 15px; color: var(--text-dim); }
.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text); }

/* 文章 CTA 区域 */
.post-cta {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-mid) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.post-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow-gold) 0%, transparent 70%);
    animation: cta-glow 3s ease-in-out infinite;
}
@keyframes cta-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}
.post-cta p { margin: 8px 0; position: relative; z-index: 1; }
.post-cta p:first-child { font-size: 1.3rem; font-weight: bold; color: var(--gold); }
.post-cta p:nth-child(2) { color: var(--text-dim); font-size: 0.95rem; }
.cta-button {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--bg-dark);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px var(--glow-gold);
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-wrapper { padding: 20px 16px; }
    .hero h1 { font-size: 1.8rem; }
    .post-single { padding: 24px; }
}
