/* ==========================
   深悟笔记 · 文艺素雅米色主题
========================== */
:root {
    --primary: #995522;
    --primary-light: #b36b2e;
    --primary-dark: #6D4A22;
    --bg: #F5F0E8;
    --text: #4A3F35;
    --text-secondary: #7A6F63;
    --card: #FFFFFF;
    --border: #D9CFC0;
    --hover-bg: rgba(139, 90, 43, 0.05);
    --book-transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    --paper-texture: repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0, 0, 0, 0.01) 8px, rgba(0, 0, 0, 0.01) 16px);
    --spine-gradient: linear-gradient(90deg, #6D4A22 0%, #995522 30%, #7A6040 70%, #5D4A20 100%);
    --spine-edge-gradient: linear-gradient(90deg, #4A3F35 0%, #6D4A22 50%, #4A3F35 100%);
    --pages-gradient: linear-gradient(90deg, #F8F5F0 0%, #EEE9E0 50%, #E6E0D5 100%);
}

/* ==========================
   基础样式
========================== */
body {
    font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;
    background: var(--bg);
    background-image: linear-gradient(45deg, rgba(201, 138, 87, 0.03) 25%, transparent 25%, transparent 50%, rgba(201, 138, 87, 0.03) 50%, rgba(201, 138, 87, 0.03) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    color: var(--text);
    margin: 0;
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-light);
}

.container {
    display: flex;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
header {
    background: var(--card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    position: sticky;
    top: 0;
    z-index: 999;
}
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}
.menu a {
    text-decoration: none;
    color: var(--text);
}
.menu a:hover {
    color: var(--primary);
}

/* ==========================
   卡片 & 文章列表
========================== */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(217, 207, 192, 0.3);
    max-width: 100%;
    flex-grow: 1;
    box-sizing: border-box;
    overflow-x: hidden;
}
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
/* 昵称 右对齐 */

h2.page-nickname {
    margin: 0 0 15px 0 !important;
    font-size: 1.2rem !important;
    float: right;
}
.page-main-title {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
}
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    min-height: 70px;
    
}
.post-item:last-child {
    border-bottom: none;
}



.post-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    width: 100%;
}
.post-title a {
    text-decoration: none;
    color: var(--text);
    display: block;
}
.post-title a:hover {
    color: var(--primary);
}
/* 文章图片 右对齐 */
.post-thumb {
    width: 70px;
    height: 70px;
    background-color: #f5f5f5;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    margin-left: 15px;
}
.post-thumb img {
    width: 100%;
    height: 100%;
    float:right;
    object-fit: cover;
    display: block;
}
.meta {
    display: none;
}
.no-content {
    color: #999;
    text-align: center;
}

.content p {
    text-indent: 2em; /* 首行缩进 2 个汉字 */
    line-height: 1.8;
    margin-bottom: 1em;
}

.content {
    font-size: 1.125rem;
    line-height: 1.8;
}
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ==========================
   按钮 & 分页
========================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.pagination-numbers {
    margin-bottom: 10px;
}
.pagination-numbers span,
.pagination-numbers a {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 6px;
    font-size: 0.95rem;
}
.pagination-active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.2);
}
.pagination-numbers a {
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}
.pagination-numbers a:hover {
    border-color: #7a6955;
    color: #7a6955;
    transition: 0.3s;
}
.pagination-form {
    margin: 0;
}
.pagination-input {
    width: 30px;
    padding: 10px;
    text-align: center;
}
.pagination-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.3s ease;
}
.pagination-btn:hover {
    opacity: 0.9;
    transition: 0.3s;
}

.page-item {
	padding:4px 10px;
	border:1px solid #ddd;
	border-radius:4px;
	text-decoration:none;
	
}

 
.btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
}
.btn:hover {
    opacity: 0.9;
    background: var(--primary-light);
}
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 50px;
    border-top: 1px solid var(--border);
    background: var(--card);
}
footer a{
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* ==========================
   侧边栏
========================== */
.post-sidebar {
    width: 300px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.post-sidebar.collapsed {
    width: 40px;
}
.post-sidebar.collapsed .sidebar-content {
    display: none;
}
.sidebar-toggle {
    width: 100%;
    padding: 8px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-bottom: 15px;
}
.sidebar-toggle:hover {
    background: var(--primary-light);
}
.sidebar-card {
    background: var(--card);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    margin-bottom: 25px;
    border: 1px solid rgba(217, 207, 192, 0.3);
    font-size: 1rem;
    color:#6b7280;
    line-height:1.5;
}
.sidebar-card img {
    border-radius: 8px;
    width: 100%;
}
.sidebar-card h3 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.sidebar-card p {
    margin: 5px 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.summary {
    margin-top:10px; 
    font-size:1rem; 
    color:#6b7280;
    line-height:1.5;
}
.qrcode {
  /* 删掉 float: left，改用 flex 布局，彻底解决浮动问题 */
  display: flex;
  justify-content: center; /* 水平居中 */
  align-items: center;
  max-width: 100%;
  overflow: hidden;
}

/* canvas 自适应：等比例缩放，不溢出 */
div.qrcode canvas {
  width: 100% !important;
  height: auto !important;
  max-width: 100px; /* 保持最大100px，和原尺寸一致 */
  display: block; /* 消除canvas默认的行内间隙 */
}


/* ==========================
   页面搜索
========================== */

.search-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}
#search-input {
  width: 100%;
padding: 10px 0px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
}
#search-input:focus {
  border-color: #666;
}
#search-result {
  margin-top: 1rem;
}
.search-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.search-item a {
  font-size: 16px;
  color: #2d6fe2;
  text-decoration: none;
}
.search-item a:hover {
  text-decoration: underline;
}
.search-item .desc {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}
.no-result {
  color: #999;
  padding: 1rem 0;
}


/* ==========================
   书籍效果（不动）
========================== */
.book-cover-pages {
    position: absolute;
    right: -4px;
    top: 2px;
    bottom: 2px;
    width: 6px;
    background: var(--pages-gradient) var(--paper-texture);
    border-radius: 0 3px 3px 0;
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.05);
    transform: skewY(0.5deg);
    z-index: 3;
}
.book-chapter {
    width: 100%;
    padding: 8px 10px;
    background: linear-gradient(rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    z-index: 4;
}
.book-title {
    width: 100%;
    padding: 12px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
    z-index: 4;
}
.book-cover .shadow {
    position: absolute;
    bottom: -8px;
    left: 10px;
    right: 0;
    height: 15px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    filter: blur(8px);
    z-index: -2;
}

/* ==========================
   菜单
========================== */
.menu-main { display: inline-block; margin:0; padding:0; }
.menu-main > ul { list-style: none; margin:0; padding:0; display: inline-flex; }
.menu-main li {
	position: relative; 
	margin-left: 10px; 
	}
.menu-main li a, .menu-main li span {
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
}
.menu-main li a:hover { color: var(--primary); }
.menu-main .submenu {
    display: none;
    position: absolute;
    top:100%; left:0;
    background: var(--card);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    padding: 10px 0;
    min-width: 180px;
    z-index: 999;
}
.menu-main .submenu li {
    margin:0; padding:0 15px;
}
.menu-main .submenu a {
    padding:8px 0;
    color: var(--text);
    font-size:0.875rem;
}
.menu-main .submenu a:hover {
    color: var(--primary);
    background: var(--hover-bg);
}
.menu-main li:hover .submenu { display:block; }

/* ==========================
   友情链接
========================== */
.friend-links {
    margin:20px auto;
    max-width:900px;
    padding:0 20px;
}
.friend-links h3 {
    font-size:1rem;
    color: var(--text);
    text-align:center;
}
.friend-links ul {
    list-style:none; padding:0; margin:0;
    display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
}
.friend-links li a {
    color: var(--primary);
    font-size:0.875rem;
    text-decoration:none;
}
.friend-links li a:hover {
}

/* ==========================
   侧边菜单
========================== */
.sidebar { max-width:900px; margin:0 auto 30px; padding:0 20px; }

.side-menu {
background: var(--card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(217, 207, 192, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.side-menu h3 {
    font-size:1rem;
    color: var(--text);
    border-bottom:1px solid var(--border);
    padding-bottom:8px;
}
.side-menu ul {
    list-style:none; padding:0; margin:0;
    display:flex; flex-wrap:wrap; gap:8px 16px;
}
.side-menu li a {
    color: var(--text);
    font-size:1rem;
    text-decoration:none;
}
.side-menu li a:hover {
    color: var(--primary);
}
.side-menu .submenu {
    padding-left:15px;
    border-left:2px solid var(--primary);
    opacity:0.6;
}



/* ==========================
   工具类
========================== */
.book-cover-link { display:block; text-decoration:none; }
.full-width-card { width:100%; box-sizing:border-box; }

/* ==========================
   响应式
========================== */
@media (max-width: 768px) {
    .container { flex-direction: column-reverse; }
    .post-sidebar { width:100%; }
    .sidebar-toggle { display:none; }
    .book-cover-spine {
        width:25px; left:-12px;
        transform:rotateY(90deg) skewX(-4deg) skewY(1.5deg) translateZ(1px);
    }
    .book-cover-pages { right:-3px; width:5px; }
    .book-chapter { font-size:0.7rem; padding:6px 8px; }
    .book-title { font-size:0.8rem; padding:10px 8px 6px; }

}