/* ============================================
   Cygnus Cafe - Custom Theme for Hugo Mana
   覆盖原主题样式，打造星空咖啡馆氛围
   ============================================ */

/* 重置和基础变量 */
:root {
    /* Cygnus constellation deep space colors */
    --space-dark: #0a0e27;
    --space-medium: #1a1f3a;
    --space-light: #2a2f4a;
    
    /* Cafe warm colors */
    --cafe-cream: #f4ead5;
    --cafe-latte: #d4a574;
    --cafe-mocha: #8b6f47;
    --cafe-espresso: #5c4033;
    
    /* Accent colors */
    --star-glow: #a4b8ff;
    --star-bright: #e8f0ff;
    --nebula-purple: #9b7eba;
    --nebula-blue: #6b8cce;
    
    /* UI colors */
    --text-primary: var(--cafe-cream);
    --text-secondary: #b8a690;
    --text-dim: #8b7d6b;
    --border: rgba(212, 165, 116, 0.15);
    --card-bg: rgba(26, 31, 58, 0.6);
    --card-hover: rgba(42, 47, 74, 0.8);
}

/* 覆盖body样式 */
body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--space-dark) !important;
    color: var(--text-primary) !important;
    line-height: 1.8 !important;
    position: relative;
}

/* 星空背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at bottom, #1a1f3a 0%, #0a0e27 100%);
    pointer-events: none;
}

/* 星星容器 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 星云效果 */
.nebula {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

.nebula-1 {
    background: radial-gradient(circle, var(--nebula-purple) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: nebulaDrift 30s infinite ease-in-out;
}

.nebula-2 {
    background: radial-gradient(circle, var(--nebula-blue) 0%, transparent 70%);
    bottom: -300px;
    left: -200px;
    animation: nebulaDrift 40s infinite ease-in-out reverse;
}

@keyframes nebulaDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, -50px) scale(1.1); }
}

/* Header 样式覆盖 */
header,
.header,
.site-header {
    background: rgba(10, 14, 39, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.5rem 4rem !important;
}

/* Logo 样式 */
.logo,
.site-title,
header h1,
header a[href="/"],
header a[href="{{< ref \"/\" >}}"] {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: var(--cafe-latte) !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    font-weight: 400 !important;
}

/* 导航链接 */
nav a,
.nav a,
.menu a {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    transition: color 0.3s ease !important;
    position: relative;
}

nav a:hover,
.nav a:hover,
.menu a:hover {
    color: var(--cafe-latte) !important;
}

nav a::after,
.nav a::after,
.menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cafe-latte), var(--star-glow));
    transition: width 0.3s ease;
}

nav a:hover::after,
.nav a:hover::after,
.menu a:hover::after {
    width: 100%;
}

/* 主要内容区域 */
main,
.main,
.content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 3rem 4rem !important;
}

/* 文章标题 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif SC', serif !important;
    color: var(--cafe-cream) !important;
    font-weight: 700 !important;
}

h1 {
    font-size: 3rem !important;
    margin-bottom: 2rem !important;
    background: linear-gradient(135deg, var(--cafe-cream) 0%, var(--cafe-latte) 50%, var(--star-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.2rem !important;
    margin-top: 3rem !important;
    margin-bottom: 1.5rem !important;
    color: var(--cafe-latte) !important;
}

h3 {
    font-size: 1.6rem !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

/* 段落和文本 */
p {
    color: var(--text-secondary) !important;
    line-height: 1.9 !important;
    margin-bottom: 1.5rem !important;
}

/* 链接 */
a {
    color: var(--cafe-latte) !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

a:hover {
    color: var(--star-glow) !important;
}

/* 文章卡片/列表 */
.post,
.post-item,
article,
.article {
    background: var(--card-bg) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 20px !important;
    padding: 2.5rem !important;
    margin-bottom: 2rem !important;
    border: 1px solid var(--border) !important;
    transition: all 0.4s ease !important;
    position: relative;
    overflow: hidden;
}

.post::before,
.post-item::before,
article::before,
.article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--cafe-latte), var(--star-glow));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.post:hover,
.post-item:hover,
article:hover,
.article:hover {
    transform: translateY(-8px) !important;
    background: var(--card-hover) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(212, 165, 116, 0.3) !important;
}

.post:hover::before,
.post-item:hover::before,
article:hover::before,
.article:hover::before {
    transform: scaleX(1);
}

/* 文章元信息 */
.post-meta,
.meta,
time {
    color: var(--text-dim) !important;
    font-size: 0.9rem !important;
    margin-bottom: 1rem !important;
}

/* 标签 */
.tag,
.tags a,
.post-tags a {
    padding: 0.4rem 1rem !important;
    background: rgba(42, 47, 74, 0.6) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    color: var(--cafe-latte) !important;
    display: inline-block !important;
    margin: 0.3rem !important;
    transition: all 0.3s ease !important;
}

.tag:hover,
.tags a:hover,
.post-tags a:hover {
    background: rgba(212, 165, 116, 0.15) !important;
    border-color: var(--cafe-latte) !important;
    transform: translateY(-2px) !important;
}

/* 代码块 */
code {
    background: rgba(42, 47, 74, 0.6) !important;
    color: var(--cafe-latte) !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 4px !important;
    font-size: 0.9em !important;
    border: 1px solid var(--border) !important;
}

pre {
    background: rgba(26, 31, 58, 0.8) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
}

pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

/* 引用块 */
blockquote {
    border-left: 4px solid var(--cafe-mocha) !important;
    padding-left: 1.5rem !important;
    margin: 2rem 0 !important;
    color: var(--text-secondary) !important;
    font-style: italic !important;
    background: rgba(42, 47, 74, 0.3) !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0 8px 8px 0 !important;
}

/* 列表 */
ul, ol {
    color: var(--text-secondary) !important;
    margin-bottom: 1.5rem !important;
    padding-left: 2rem !important;
}

li {
    margin-bottom: 0.5rem !important;
}

li::marker {
    color: var(--cafe-latte) !important;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(26, 31, 58, 0.6);
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: rgba(42, 47, 74, 0.8);
    color: var(--cafe-cream);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:hover td {
    background: rgba(42, 47, 74, 0.4);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.8rem 1.5rem !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    color: var(--text-secondary) !important;
    transition: all 0.3s ease !important;
}

.pagination a:hover {
    background: var(--card-hover) !important;
    color: var(--cafe-latte) !important;
    transform: translateY(-2px) !important;
}

.pagination .active {
    background: var(--cafe-latte) !important;
    color: var(--space-dark) !important;
    border-color: var(--cafe-latte) !important;
}

/* Footer */
footer,
.footer {
    background: rgba(10, 14, 39, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    padding: 3rem 4rem !important;
    border-top: 1px solid var(--border) !important;
    margin-top: 4rem !important;
    color: var(--text-dim) !important;
}

footer a,
.footer a {
    color: var(--cafe-latte) !important;
}

/* 搜索框 */
input[type="search"],
input[type="text"],
.search-input {
    background: rgba(42, 47, 74, 0.6) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    padding: 0.8rem 1.2rem !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
}

input[type="search"]:focus,
input[type="text"]:focus,
.search-input:focus {
    outline: none !important;
    border-color: var(--cafe-latte) !important;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1) !important;
}

/* 按钮 */
button,
.button,
.btn {
    background: var(--cafe-latte) !important;
    color: var(--space-dark) !important;
    border: none !important;
    padding: 0.8rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

button:hover,
.button:hover,
.btn:hover {
    background: var(--star-glow) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(212, 165, 116, 0.3) !important;
}

/* 目录 (TOC) */
.toc,
.table-of-contents {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
}

.toc a,
.table-of-contents a {
    color: var(--text-secondary) !important;
    display: block !important;
    padding: 0.5rem 0 !important;
    transition: all 0.3s ease !important;
}

.toc a:hover,
.table-of-contents a:hover {
    color: var(--cafe-latte) !important;
    padding-left: 0.5rem !important;
}

/* 图片 */
img {
    border-radius: 12px !important;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.3s ease !important;
}

img:hover {
    transform: scale(1.02) !important;
}

/* 响应式 */
@media (max-width: 1024px) {
    header,
    .header {
        padding: 1.5rem 2rem !important;
    }
    
    main,
    .main,
    .content {
        padding: 2rem !important;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 768px) {
    header,
    .header {
        padding: 1rem 1.5rem !important;
    }
    
    main,
    .main,
    .content {
        padding: 1.5rem !important;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    .post,
    .post-item,
    article {
        padding: 1.5rem !important;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--space-medium);
}

::-webkit-scrollbar-thumb {
    background: var(--cafe-mocha);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cafe-latte);
}

/* 选中文本样式 */
::selection {
    background: var(--cafe-latte);
    color: var(--space-dark);
}

::-moz-selection {
    background: var(--cafe-latte);
    color: var(--space-dark);
}
