/* ── 颜色变量 ── */
:root {
    /* 背景：半透明暗蓝色 */
    --bg-panel: rgba(12, 14, 20, 0.2);
    --bg-cover: rgba(30, 41, 59, 0.5);
    /* 边框：淡蓝紫色 */
    --border:     rgba(100, 140, 200, 0.8);
    /* 主文字：白色 */
    --text-main: #e8eef8;
    /* 次要文字：淡蓝灰 */
    --text-muted: #9ab0d0;
    /* 链接：高饱和亮蓝 */
    --link:       #00b4ff;
    --link-hover: #00d4ff;
    --link-visit: #4da6ff;
    /* Bootstrap 链接覆盖 */
    --bs-link-color: #00b4ff;
    --bs-link-hover-color: #00d4ff;
}

html {
    font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 10px;
  }
}

body {
    font-family: sans-serif;
    background-image: url("/images/galaxy-handle.png");
    color: var(--text-main);
    background-size: cover;        /* 缩放覆盖整个屏幕 */
    background-repeat: no-repeat;  /* 不平铺 */
    background-attachment: fixed;  /* 固定背景，滚动时不移动 */
    line-height: 1.8;
    hyphens: auto;
    font-feature-settings: "palt";
    hanging-punctuation: first allow-end last;
    text-autospace: ideograph-alpha ideograph-numeric;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.bg-cover {
    background: var(--bg-cover); !important;
}

.avatar-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.avatar {
    max-width: 40% !important;
    height: auto !important;
    border-radius: 6px !important;
}

/* ── 导航栏 ── */
.navbar {
    background: transparent !important;  /* 完全透明 */
    backdrop-filter: none;               /* 移除模糊效果 */
    backdrop-filter: none;
    border-bottom: none;
    padding: 0.5rem 1.5rem;
}
.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    font-weight: bold;
    color: #ffffff !important;
}
.nav-title {
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    font-weight: bold;
    color: #ffffff !important;
}
.navbar .nav-link {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    color: #c8d8f0 !important;
}
.navbar .nav-link:hover {
    color: #ffffff !important;
}

@media (max-width: 576px) {
    .navbar-brand {
	font-size: 2.0rem;
    }
    .nav-title {
	display:none;
    }
    .nav-bt {
	font-size: 2.0rem !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	font-weight: bold;
	color: var(--text-muted) !important;
    }
    .nav-bt:hover,
    .nav-bt:focus,
    .nav-bt:active,
    .nav-bt:focus-visible {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	font-weight: bold;
	color: var(--text-muted) !important;
    }
}

/* ── 主区域 ── */
.main {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 1rem;
    margin: 1.25rem auto;
    width: 100%;
    max-width: 1140px;
    padding: 0 1rem;
}

/* ── 侧边栏 ── */
.sidebar {
    width: 120px;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-btn {
    display: block;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.2s;
}
.sidebar-btn:hover {
    background: rgba(252, 252, 228, 0.96);
    color: var(--text-main);
}

.sidebar-right {
    width: 180px;
    flex-shrink: 0;
    top: 70px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-self: flex-start;
}
.sidebar-widget {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
}

.sidebar-widget-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.subscribe-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.subscribe-links a {
    text-decoration: none !important;
    color: var(--text-muted) !important;
}
.subscribe-links a:hover {
    color: var(--link) !important;
}
.banner-placeholder {
    width: 100%;
    aspect-ratio: 2 / 1;
    background: rgba(200, 200, 140, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── 正文 ── */
.eko {
    flex: 1;
    background: var(--bg-panel);
    border: 2px solid var(--border);
    border-radius: 6px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    padding: 1.5rem 2rem;
    min-width: 0;
    /* 柔和蓝紫色发光 */
    box-shadow: 
        0 0 15px rgba(80, 120, 180, 0.15),
        0 0 40px rgba(60, 100, 160, 0.08),
        inset 0 0 20px rgba(80, 120, 180, 0.03);
}

/* ── Footer ── */
.footer {
    margin: 0;
    padding: 0.75rem 0;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-muted);
}

/* ── 链接 ── */
a {
    color: var(--link) !important;
    text-decoration-color: rgba(107, 107, 48, 0.35);
}
a:hover {
    color: var(--link-hover) !important;
    text-decoration-color: rgba(58, 58, 24, 0.55);
}
a:visited {
    color: var(--link-visit) !important;
    text-decoration-color: rgba(107, 107, 48, 0.35);
}

.post-list h1{
    margin-bottom: 1.5rem;
    color: var(--text-main) !important;
}

.post-card {
    
}

.post-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.post-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-summary {    
    color: var(--text-muted);
    font-size: 1.0rem;
    margin: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;    
}
.btn {
    font-size: 0.85rem;
    padding: 0.3rem 0.9rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text-muted) !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.btn:hover {
    background: rgba(40, 50, 70, 0.6);
    color: var(--text-main) !important;
    box-shadow: 0 0 12px rgba(80, 140, 200, 0.3);
}
.btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.btn:focus,
.btn:focus-visible {
    outline: none;
    box-shadow: none;
}

.post-title {
    font-size: 2.0rem;
    font-weight: normal;
    margin-bottom: 0.75rem;
    color: var(--text-main) !important;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.0rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.post-body {
    font-size: 1.05rem;
    color: var(--text-main) !important;
}

.post-body p,
.post-body li,
.post-body blockquote {
    color: var(--text-main) !important;
}

.post-body h1 {
    font-size: 1.9rem;
    color: var(--text-main) !important;
}

.post-body h2 {
    font-size: 1.7rem;
    color: var(--text-main) !important;
}

.post-body h3 {
    font-size: 1.5rem;
    color: var(--text-main) !important;
}

.post-body h4 {
    font-size: 1.3rem;
    color: var(--text-main) !important;
}

.post-body h5 {
    font-size: 1.1rem;
    color: var(--text-main) !important;
}

.post-author {
    color: var(--text-muted);
}

.post-meta-sep {
    color: var(--border);
}

.post-date {
    color: var(--text-muted);
}

.post-summary {
    font-size: 1.0rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.yumieko-svg {
    width: 100px;
    height: 50px;
}

.post-image {
  max-height: 80vh;
  width: auto;
}

@media (max-width: 575.98px) {
  .sidebar-right {
    display: none;
  }
}

/* ── Offcanvas 移动菜单 ── */
.offcanvas {
    background: var(--bg-panel) !important;
    backdrop-filter: blur(6px);
    border-left: 1px solid var(--border) !important;
    color: var(--text-main);
    width: 50% !important;
    max-width: 280px !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    position: relative;
}

.offcanvas-title {
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.btn-close {
    filter: opacity(0.4) sepia(1) hue-rotate(10deg);
}
.btn-close:focus {
    box-shadow: none !important;
    outline: none !important;
}

.offcanvas-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* 每个分组 */
.menu-section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.menu-section-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-section-links a {
    font-size: 0.9rem;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    padding: 0.2rem 0;
    transition: color 0.15s;
}

.menu-section-links a:hover {
    color: var(--text-main) !important;
}

.offcanvas-center-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    pointer-events: none;
}

/* ── 隐藏 Checkbox 控制器 ── */
#menuToggle {
    display: none;
}

/* ── 遮罩层 ── */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 20, 0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

/* ── 移动菜单 ── */
/* 替换原有的 .offcanvas */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 50%;
    max-width: 280px;
    
    /* 核心动画逻辑：默认隐藏在右侧屏幕外 */
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
    z-index: 1050;
    
    /* 保留你的视觉风格 */
    background: var(--bg-panel) !important;
    backdrop-filter: blur(6px);
    border-left: 1px solid var(--border) !important;
    color: var(--text-main);
}

#menuToggle:checked ~ .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

/* ── 菜单头部 ── */
.mobile-menu-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

/* 核心魔法：Checkbox 选中时展开菜单 */
#menuToggle:checked ~ .mobile-menu {
    transform: translateX(0);
    visibility: visible;
}

.mobile-menu-title {
    font-size: 1.0rem;
    letter-spacing: 0.1em;
    font-weight: bold;
    color: var(--text-main);
    margin: 0;
}

.mobile-menu-center-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: var(--text-main);
    pointer-events: none;
}

/* 关闭按钮现在作为 label 使用 */
.mobile-menu-close {
    cursor: pointer;
    font-size: 1.7rem;
    font-weight: bold;
    color: var(--text-main);
    /* 模拟 btn-close 的外观，你可以根据需要调整 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.mobile-menu-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    height: calc(100% - 60px); /* 减去 header 高度 */
}

/* ══════════════════════════════════════════
   画廊网格视图
   追加到 style.css 末尾，或单独 <link> 引入
   ══════════════════════════════════════════ */

/* ── 网格容器 ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);   /* 桌面：3列 */
    gap: 1.25rem;
    padding: 0;
    list-style: none;
    margin: 0;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 平板：2列 */
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;            /* 手机：1列 */
    }
}

/* ── 单张卡片 ── */
.gallery-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--text-main) !important;
    transition:
        border-color 0.2s ease,
        box-shadow   0.2s ease,
        transform    0.2s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.gallery-card:hover {
    border-color: rgba(100, 160, 255, 1);
    box-shadow:
        0 0 18px rgba(80, 140, 220, 0.35),
        0 0 45px rgba(60, 110, 180, 0.15);
    transform: translateY(-2px);
    color: var(--text-main) !important;
}

.gallery-card:visited {
    color: var(--text-main) !important;
}

/* ── 封面图区域 ── */
.gallery-card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;    /* 固定比例，图片不变形 */
    overflow: hidden;
    background: rgba(20, 30, 50, 0.6);   /* 无封面时的占位色 */
    flex-shrink: 0;
    position: relative;
}

.gallery-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-cover img {
    transform: scale(1.04);   /* 悬停时图片轻微放大 */
}

/* 无封面图时显示的占位符 */
.gallery-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--border);
    user-select: none;
}

/* ── 卡片文字区域 ── */
.gallery-card-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.4rem;
}

/* 标题 */
.gallery-card-title {
    font-size: 1.0rem;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;

    /* 超过2行显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 元信息（日期 / 作者） */
.gallery-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.gallery-card-meta-sep {
    color: var(--border);
}

/* 摘要 */
.gallery-card-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;

    /* 超过3行省略 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 标签 */
.gallery-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;      /* 推到卡片底部 */
    padding-top: 0.5rem;
}

.gallery-tag {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text-muted);
    background: rgba(100, 140, 200, 0.08);
    white-space: nowrap;
}
