/* ------------------------------------
 * Typecho Default Theme - Optimized
 * 
 * @author  Typecho Team
 * @link    http://typecho.org/
 * @update  2013-10-28
 * --------------------------------- */

/* ------------------
 * CSS Variables & Reset
 * --------------- */
:root {
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --text-color: #444;
  --text-light: #999;
  --text-lighter: #666;
  --bg-color: #f5f6f9;
  --bg-light: #f6f6f6;
  --bg-lighter: #f3f3f3;
  --border-color: #eee;
  --border-light: #f0f0f0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.08);
  --radius: 4px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ------------------
 * Global Styles
 * --------------- */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  font-size: 87.5%;
  line-height: 1.6;
}

/* 汉堡按钮样式 */
.mobile-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    cursor: pointer;
    margin-bottom: 8px;
     margin-right: 15px;
  
}
.mobile-hamburger span {
    display: block;
    height: 3px;
    background-color: #000; /* 或你主题的主色 */
    border-radius: 2px;
}

/* 移动端菜单面板 */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -260px; /* 初始隐藏 */
    width: 98px;
    height: 70vh;
    background-color: #fff; /* 必须设背景色！否则透明/黑色看不清 */
    z-index: 1000;
    transition: right 0.3s ease;
    padding-top: 40px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

/* 菜单头部（关闭按钮） */
.mobile-menu-header {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    padding: 10px 10px 5px 40px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.mobile-menu-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #333;
}

/* 菜单链接 */
.mobile-menu-link {
    display: block;
    margin-top: 10px;
    margin-left: 30px;
    text-decoration: none;
    color: #333; /* 关键：确保文字可见！ */
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}
.mobile-menu-link:hover {
    background-color: #f9f9f9;
}

/* 遮罩层 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}


/* ------------------
 * Layout Components
 * --------------- */
.single-column-main,
.single-column-main1 {
  max-width: 688px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.single-column-main {
  padding: 20px;
}

.single-column-main1 {
  padding: 0;
}

.font-size-controls {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}
.font-btn {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-left: 3px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}
.font-btn:hover {
    background: #e8e8e8;
    border-color: #bbb;
}
.font-btn:active {
    transform: translateY(1px);
}


/* 移动端文章页头部样式 */
.mobile-post-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1px 0;
    background: #f5f6fa;
    border-bottom: 1px solid #eee;
}

.mobile-logo-center {
    text-align: center;
}

.mobile-logo-center img {
    max-height: 50px; /* 调整logo高度 */
    width: auto;
}

/* 确保移动端文章页头部不会太大 */
@media (max-width: 768px) {
    .mobile-post-header {
        height: 50px; /* 固定高度 */
    }
}

/* 可选：隐藏其他移动端文章页不需要的元素 */
.mobile-post-page .nav-container,
.mobile-post-page .site-search {
    display: none;
}

/* 可选：如果是移动端文章页，给body添加特殊class */
body.mobile-post-page {
    padding-top: 0; /* 调整页面顶部间距 */
}

/* ------------------
 * Article & Content Styles
 * --------------- */
.post-article,
.post {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.post-article:hover,
.post:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.post-title {
  margin: 0 0 15px;
  font-size: 1.5em;
  line-height: 1.3;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", 
               "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft Yahei", sans-serif;
  color: #2c3e50;
}

.post-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: var(--primary-color);
}

/* Post Meta Information */
.post-meta-container {
  margin-bottom: 2px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-light);
}

.post-meta-table {
  width: 100%;
  border-collapse: collapse;
}

.post-meta-table td {
  padding: 0 8px 0 0;
  font-size: 10px;
  color: var(--text-light);
  white-space: nowrap;
}

.post-meta-table td:first-child { padding-left: 0; }
.post-meta-table td:last-child { padding-right: 0; }

.post-meta-table a {
  color: var(--text-light);
  text-decoration: none;
}

.post-meta-table a:hover {
  color: var(--text-lighter);
  text-decoration: underline;
}

.post-meta {
  margin-top: -0.5em;
  padding: 0;
  color: #999;
  font-size: .92857em;
  list-style: none;
}

.post-meta li {
  display: inline-block;
  margin: 0 8px 0 0;
  padding-left: 12px;
  border-left: 1px solid #EEE;
}

.post-meta li:first-child {
  margin-left: 0;
  padding-left: 0;
  border: none;
}

/* Images Grid */
.images-row {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.image-column {
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
}


.font-size-controls {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}
.font-btn {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-left: 3px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}
.font-btn:hover {
    background: #e8e8e8;
    border-color: #bbb;
}
.font-btn:active {
    transform: translateY(1px);
}



.image-column img {
  display: block;
  max-width: 60%;
  height: auto;
  max-height: 128px;
  object-fit: cover;
  width: 100%;
margin-right: auto; /* 添加这一行 */
}

/* Image count responsive styles */
.image-count-1 .image-column { width: 60%; }
.image-count-2 .image-column { width: 35%; }
.image-count-3 .image-column { width: 30%; }

@media (min-width: 769px) {
  .image-count-1 .image-column { width: 60%; }
  .image-count-2 .image-column { width: 38%; }
  .image-count-3 .image-column { width: 28%; }
}

@media (max-width: 768px) {
  .image-count-1 .image-column { width: 60%; }
  .image-count-2 .image-column { width: 40%; }
  .image-count-3 .image-column { width: 28%; }
}

@media (max-width: 400px) {
  .image-count-1 .image-column { width: 65%; }
  .image-count-2 .image-column { width: 48%; }
  .image-count-3 .image-column { width: 31%; }
  .images-row { gap: 5px; }
}



/* Content Areas */
.post-content {
  line-height: 1.5;
  color: var(--text-color);
  font-size: 1.2em;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
/* 新增左右外边距 */
  margin-left: 10px !important;
  margin-right: 10px !important;
}

.post-content img,
.comment-content img,
.post-content video,
.comment-content video {
  max-width: 100%;
  height: auto;
  display: block;
}

.post-content a img,
.comment-content a img {
  background: var(--bg-color);
  position: relative;
  bottom: -4px;
}

/* Code & Tables */
.post-content pre,
.post-content table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

.post-content pre {
  background: var(--bg-lighter);
  padding: 8px;
  border-radius: var(--radius);
}

.post-content table {
  border: 1px solid #ddd;
  margin: 1em 0;
}

.post-content table th,
.post-content table td {
  padding: 5px 10px;
  border: 1px solid #eee;
}

.post-content table th {
  background: var(--bg-lighter);
}

/* Code & Preformatted */
pre, code {
  background: var(--bg-lighter);
  font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
  font-size: .92857em;
}

code {
  padding: 2px 4px;
  color: #B94A48;
  border-radius: 2px;
}

pre {
  padding: 8px;
  overflow: auto;
  max-height: 400px;
  border-radius: var(--radius);
}

pre code {
  padding: 3px;
  color: var(--text-color);
  background: transparent;
}

/* Links & Buttons */
a {
  color: #3354AA;
  text-decoration: none;
  transition: var(--transition);
}

a:hover, a:active {
  color: #444;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 5px;
  border: 1px solid #E9E9E9;
  width: 100%;
  border-radius: 2px;
  font-family: inherit;
  font-size: inherit;
}

textarea {
  resize: vertical;
}

/* ------------------
 * Header & Navigation
 * --------------- */
#header {
  padding-top: 0;
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: nowrap;
  padding: 15px 0;
  min-width: 0;

margin: 0px 0 -10px 0px;
}

.site-name {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  min-width: 0;
}

#logo {
  color: #333;
  font-size: 2.5em;
  margin: 0;
  display: flex;
  align-items: flex-end;
}

#logo img {
  width: 138px;
  height: 68px;
  object-fit: contain;
  max-height: 64px;
}

.description {
  margin: .5em 0 0;
  color: var(--text-light);
  font-style: italic;
}

.nav-container {
  display: flex;
  flex-wrap: wrap;  /* 主要换行属性 */
  gap: 16px;        /* 项目之间的间距 */
  justify-content: flex-start; /* 对齐方式 */
  align-items: flex-start;
}

#nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 5px;
}

#nav-menu a {
  text-decoration: none;
  color: #333;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
  white-space: wrap;
  font-size: 15px;
  display: flex;
  align-items: flex-end;
  min-height: 24px;
  flex-shrink: 0;
}

#nav-menu a:hover {
  background-color: #f0f0f0;
  color: #000;
}

#nav-menu a.current {
  background-color: #007cba;
  color: white;
}

/* Search */
#search {
  position: relative;
  margin-top: 15px;
}

#search input {
  padding-right: 30px;
}

#search button {
  position: absolute;
  right: 4px;
  top: 2px;
  border: none;
  padding: 0;
  width: 24px;
  height: 24px;
  background: transparent;
  direction: ltr;
  text-indent: -9999em;
}

/* ------------------
 * Comments
 * --------------- */
#comments {
  padding-top: 15px;
}

.comment-list,
.comment-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list li {
  padding: 14px;
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.comment-list li.comment-level-odd { background: #F6F6F3; }
.comment-list li.comment-level-even { background: var(--bg-color); }
.comment-list li.comment-by-author { background: #FFF9E8; }

.comment-meta a {
  color: #999;
  font-size: .92857em;
}

.comment-author {
  display: block;
  margin-bottom: 3px;
  color: #444;
}

.comment-author .avatar {
  float: left;
  margin-right: 10px;
}

.comment-author cite {
  font-weight: bold;
  font-style: normal;
}

/* ------------------
 * Widgets & Footer
 * --------------- */
#secondary {
  padding-top: 15px;
  word-wrap: break-word;
}

.widget {
  margin-bottom: 30px;
}

.widget-list {
  list-style: none;
  padding: 0;
}

.widget-list li {
  margin: 5px 0;
  line-height: 1.6;
}

.widget-list li ul {
  margin-left: 15px;
}

#footer {
  padding: 3em 0;
  line-height: 1.5;
  text-align: center;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
}

/* ------------------
 * Utility Classes
 * --------------- */


.post-near {
  list-style: none;
  margin: 30px 0;
  padding: 0;
  color: #999;
}

.post-near li {
  margin: 10px 0;
}

.aligncenter, div.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft { float: left; }
.alignright { float: right; }

img.alignleft { margin: 0 15px 0 0; }
img.alignright { margin: 0 0 0 15px; }

.hidden {
  display: none !important;
  visibility: hidden;
}

.sr-only {
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.invisible { visibility: hidden; }

/* Common Elements */
blockquote {
  margin: 1em 0;
  padding-left: 1.5em;
  border-left: 4px solid var(--border-color);
  color: var(--text-lighter);
  font-style: italic;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", 
               "Hiragino Sans GB", "WenQuanYi Micro Hei", "Microsoft Yahei", sans-serif;
}

.post-content h2, .comment-content h2 {
  font-size: 1.28571em;
}

.post-content hr, .comment-content hr {
  margin: 2em auto;
  width: 100px;
  border: 1px solid #E9E9E9;
  border-width: 2px 0 0 0;
}

/* Link styles */
.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid var(--border-color);
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: transparent;
}

.tags {
  margin: 20px 0 0;
  color: var(--text-light);
  font-size: 0.9em;
}

/* ------------------
 * Responsive Design
 * --------------- */
@media (max-width: 767px) {
  body {
    font-size: 81.25%;
  }
  
  .single-column-main {
    width: 100%;
    padding: 15px;
  }
  
  .single-column-main1 {
    width: 100%;
    padding: 0 15px;
    overflow-x: hidden;
  }
  
  .post-article, .post {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
  }
  
  .post-content {
    font-size: 1.1em;
    padding: 0;
  }
  
  .post-meta-table td {
    font-size: 9px;
    padding-right: 6px;
  }
  
  /* Header & Navigation Mobile */
  .header-container {
    flex-direction: row;
    padding: 10px 0;
    align-items: flex-end;
    gap: 8px;
  }
  
  .site-name {
    flex: 0 0 auto;
  }
  
  .nav-container {
     display: flex;
  flex-wrap: wrap;  /* 主要换行属性 */
  gap: 16px;        /* 项目之间的间距 */
  justify-content: flex-start; /* 对齐方式 */
  align-items: flex-start;
  }
  
  #nav-menu {
    justify-content: flex-end;
    gap: 3px;
  }
  
  #nav-menu a {
    padding: 3px 8px;
    font-size: 13px;
    min-height: 22px;
  }
  
  #logo img {
    width: 110px;
    height: 55px;
  }
  
  .site-search {
    display: none !important;
  }
  
  #header,
  .post-title,
  .post-meta {
    text-align: center;
  }
  
  .post-content pre {
    padding: 6px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .single-column-main {
    padding: 10px;
  }
  
  .single-column-main1 {
    padding: 0;
  }
  
  .post-article, .post {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
  }
  
  .post-title {
    font-size: 1.3em;
  }
  
  .post-content {
    font-size: 1.2em;
  }
  
  .post-meta {
    font-size: 0.85em;
  }
  
  .post-meta li {
    display: block;
    margin: 5px 0;
    padding-left: 0;
    border-left: none;
    text-align: center;
  }
  
  .post-content table {
    font-size: 0.9em;
  }
  
  .post-content table th,
  .post-content table td {
    padding: 3px 6px;
  }
  
  /* Ultra small screens */
  #logo img {
    width: 118px;
    height: 58px;
  }
  
  #nav-menu a {
    padding: 1px 4px;
    font-size: 14px;
    min-height: 14px;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .header-container {
    padding: 12px 0;
  }
  
  #nav-menu a {
    padding: 9px 10px;
    font-size: 16px;
  }
  
  #logo img {
    width: 125px;
    height: 62px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .container {
    max-width: 952px;
  }
}

/* Print */
@media print {
  .single-column-main {
    max-width: none;
    padding: 0;
  }
  
  .post-article, .post {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  #header, #footer, .post-near, .read-more-container {
    display: none;
  }
}

/* Page nav */

.page-navigator {
  list-style: none;
  margin: 25px 0;
  padding: 0;
  text-align: center;
}
.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}
.page-navigator a {
  display: inline-block;
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
}
.page-navigator a:hover {
  background: #EEE;
  text-decoration: none;
}

.page-navigator .current a {
  color: #444;
  background: #EEE;
}

/* 选择所有内容为空的p标签 */
p:empty {
    margin-top: 2em !important;
    margin-bottom: 2em !important;
    /* 调整 2em 这个值，直到空行高度符合你的预期 */
    height: 0; /* 可选，确保不产生额外高度 */
    display: block !important; /* 确保空标签仍以块级元素显示 */
}

/* 在现有CSS末尾添加 */
.post-content p {
    margin-top: 1em !important;
    margin-bottom: 1em !important;
    line-height: 1.7 !important;
}

/* 加强空行效果 */
.post-content p:empty {
    margin-top: 3em !important;
    margin-bottom: 3em !important;
    position: relative;
}