/* ------------------------------------
 * Typecho Default Theme
 *
 * @author  Typecho Team
 * @link    http://typecho.org/
 * @update  2013-10-28
 * --------------------------------- */

/* ============================================
 * 1. GLOBAL STYLES
 * ============================================ */

body {
  background-color: #FFF;
  color: #666;
  font-family: "Inter", "system-ui", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 87.5%;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* 关键：确保body至少占满整个视口高度 */
}

a {
  color: #444;
  text-decoration: none;
}
a:hover, a:active {
  color: #707070;
}

pre, code { 
  background: #F7F7F7;
  font-family: Menlo, Monaco, Consolas, "Lucida Console", "Courier New", monospace;
  font-size: .92857em;
}
code { 
  padding: 2px 4px; 
  color: #B94A48; 
}
pre {
  padding: 8px;
  overflow: auto;
  max-height: 400px;
}
pre code {
  padding: 3px;
}

blockquote {
  margin: 1em 0;
  padding-left: 1.5em;
  border-left: 4px solid #eee;
  color: #666;
}

table {
  border: 1px solid #ddd;
  width: 100%;
}
table th,
table td {
  padding: 5px 10px;
  border: 1px solid #eee;
}
table th {
  background: #F7F7F7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei","Microsoft Yahei", sans-serif;
}

input[type="text"]:not(.nav-search-input),
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
  padding: 5px;
  border: 1px solid #EEE;
  width: 100%;
  border-radius: 2px;
  box-sizing: border-box;
  background: #E7E7E7;
  color: #666;
}
textarea {
  resize: vertical;
}

/* ============================================
 * 2. FIXED NAVIGATION BAR
 * ============================================ */

/* 固定导航栏容器 */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    padding: 12px 0;
    padding-left: 60px;
    padding-right: 60px;
    border-bottom: 0px solid transparent;
    transition: border-bottom 0.3s ease;
}

/* 滚动时添加边框 */
.fixed-nav.scrolled {
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 导航栏内部容器（三栏布局） */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

/* 左侧：首页链接 */
.nav-left {
    flex: 0 0 auto;
    min-width: 120px;
}

.home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 32px;
    max-width: 120px;
    object-fit: contain;
}

.nav-site-title {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
}

/* 中间：搜索栏 */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

#nav-search {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-width: 200px;
}

.nav-search-input {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border: 1px solid #EEE;
    border-radius: 20px;
    background: #F7F7F7 !important;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.nav-search-input:focus {
    outline: none;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.nav-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.nav-search-btn:hover {
    color: #666;
    background: #f0f0f0;
}

.nav-search-btn svg {
    width: 18px;
    height: 18px;
}

/* 右侧：用户信息 */
.nav-right {
    flex: 0 0 auto;
    min-width: 120px;
    display: flex;
    justify-content: flex-end;
}

/* 登录前样式 */
.user-auth {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-auth a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.user-auth a:hover {
    background: #E7E7E7;
}

/* 登录后样式 */
.user-info {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.user-avatar-container:hover {
    background: #f8f9fa;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-info:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

/* ============================================
 * 3. HEADER & SITE IDENTITY
 * ============================================ */

#header {
  padding-top: 60px;
  border-bottom: 1px solid #EEE;
}

#logo {
  color: #333;
  font-size: 2.5em;
}
#logo img {
    max-height: 64px;
}

.description {
  margin: .5em 0 0;
  color: #333;
  font-style: italic;
}

/* ============================================
 * 4. NAVIGATION MENU
 * ============================================ */

#nav-menu {
  margin: 10px 0 0;
  padding: 0;
}
#nav-menu a {
  display: block;
  margin-right: -1px;
  padding: 0 20px;
  border-bottom: none;
  height: 32px;
  line-height: 32px;
  color: #666;
  float: left;
  border-bottom: 2px solid transparent;
}
#nav-menu a:hover,
#nav-menu .current {
  color: #333;
  border-bottom: 2px solid #333333;
}

/* ============================================
 * 5. MAIN CONTENT AREA
 * ============================================ */

/* 基础文章样式 */
.post {
  padding: 15px 0 20px;
  border-bottom: 1px solid #EEE;
}

/* 有封面图片的文章布局 */
.post.has-cover {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.post-frame {
  margin: 30px 0;
  padding: 20px;
  background: #ffffff;
  border: 20px solid #F7F7F7;
}

.post-title {
  margin: .83em 0;
  font-size: 1.4em;
}

.post-meta {
  margin-top: -0.5em;
  padding: 0;
  color: #999;
  font-size: .92857em;
}
.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;
}

.post-content {
  font-size: 16px;
  line-height: 1.6;
}

.post .tags {
  clear: both;
}

/* ============================================
 * 6. ARTICLE COVER IMAGE STYLES
 * ============================================ */

.post-cover {
    flex-shrink: 0;
    width: 300px;
}

.post-cover img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-cover img:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-content-wrapper {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

/* ============================================
 * 7. ARCHIVE & PAGINATION
 * ============================================ */

.archive-title {
  margin: 1em 0 -1em;
  padding-top: 20px;
  color: #999;
  font-size: 1em;
}

.post-near {
  list-style: none;
  margin: 30px 0;
  padding: 0;
  color: #999;
}
.post-near li {
  margin: 10px 0;
}

.more {
  text-align: center;
}
.more a {
  border: none;
}

/* 分页导航 */
.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 {
  background: #EEE;
}

/* ============================================
 * 8. COMMENTS SECTION
 * ============================================ */

#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 #EEE;
}
.comment-list li.comment-level-odd {
  background: #F6F6F3;
}
.comment-list li.comment-level-even {
  background: #FFF;
}
.comment-list li.comment-by-author {
  background: #FFF9E8;
}
.comment-list li .comment-reply {
  text-align: right;
  font-size: .92857em;
}

.comment-meta a {
  color: #999;
  font-size: .92857em;
}

.comment-author {
  display: block;
  margin-bottom: 3px;
}
.comment-author .avatar {
  float: left;
  margin-right: 10px;
}
.comment-author cite {
  font-weight: bold;
  font-style: normal;
}

/* 评论回复 */
.comment-list .respond {
  margin-top: 15px;
  border-top: 1px solid #EEE;
}
.respond .cancel-comment-reply {
  float: right;
  margin-top: 15px;
  font-size: .92857em;
}

#comment-form label {
  display: block;
  margin-bottom: .5em;
  font-weight: bold;
}
#comment-form .required:after {
  content: " *";
  color: #333;
}

/* ============================================
 * 9. CATEGORIES & TAGS
 * ============================================ */

/* 分类列表样式 */
.simple-subcats {
    margin-top: 40px;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid #EEE;
}

.simple-subcats .label {
    display: inline-block;
    margin: 0 10px 0 0;
    padding: 2px 8px;
    background: #454545;
    color: #FFFFFF;
    text-decoration: none;
}

.simple-subcats a {
    display: inline-block;
    margin: 0 10px 10px 0;
    padding: 2px 8px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.simple-subcats a:hover {
    border-bottom: 1px solid #333333;
}

.simple-subcats a.current {
    border-bottom: 1px solid #454545;
    font-weight: bold;
}

/* 标签样式 */
.simple-tag {
    margin-top: 20px;
    font-size:0.9em;
    line-height: 1.6;
}

.simple-tag .simple-link {
    display: inline-block;
    margin: 0 10px 0 0;
    padding: 2px 8px;
    text-decoration: none;
    color: #999;
}

.simple-tag .simple-link:hover {
    color: #666; 
    text-decoration: none;
}

.simple-tag .simple-link.current {
    color: #333;
    font-weight: bold;
    text-decoration: none;
}

/* 文章标签 */
.post-tags a {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 5px;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

.post-tags a:hover {
    background: #eee;
    color: #333;
}

/* ============================================
 * 10. SIDEBAR & WIDGETS
 * ============================================ */

#secondary {
  padding-top: 15px;
  word-wrap: break-word;
  border-left: 1px solid #EEE;
}

.widget .widget-title {
  padding-bottom:5px;
  border-bottom: 1px solid #EEE;
}

.widget {
  margin-bottom: 30px;
}

.widget-list {
  list-style: none;
  padding: 0;
  line-height: 1.6;
}

.widget-list li {
  padding: 0 5px;
  display: flex;
  align-items: center;
}

.widget-list li i {
  margin-right: 8px;
  min-width: 16px;
  text-align: center;
  vertical-align: middle;
}

.widget-list li a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  padding: 5px;
}

.widget-list a.current {
  color: #FFF;
  background: #454545;
  border-radius: 0.2rem;
}

.widget-list .ulist {
  border-bottom: 1px solid #EEE;
}

.widget-list a:hover {
  color: #FFF;
  background-color: #454545;
  display: block;
  border-radius: 0.2rem;
}

/* ============================================
 * 11. FOOTER
 * ============================================ */

#footer {
  padding: 3em 0;
  line-height: 1.5;
  text-align: center;
  color: #999;
  border-top: 1px solid #EEE; 
}

/* ============================================
 * 12. SPECIAL PAGES
 * ============================================ */

.error-page {
  margin-top: 100px;
  margin-bottom: 100px;
}

.protected .text {
  width: 50%;
}

/* ============================================
 * 13. CONTENT FORMATTING
 * ============================================ */

.post-content, .comment-content {
  line-height: 1.5;
  word-wrap: break-word;
}

.post-content h2, .comment-content h2 {
  font-size: 1.28571em;
}

.post-content img, .comment-content img,
.post-content video, .comment-content video {
  max-width: 100%;
}

.post-content a img,
.comment-content a img {
  background: #FFF;
  position: relative;
  bottom: -4px;  /* hidden img parent link border  */
}

.post-content hr, .comment-content hr {
  margin: 2em auto;
  width: 100px;
  border: 1px solid #E9E9E9;
  border-width: 2px 0 0 0;
}

/* ============================================
 * 14. SPECIAL LINK STYLES
 * ============================================ */

.post-meta a,
.post-content a,
.widget a,
.comment-content a {
  border-bottom: 1px solid #EEE;
}

.post-meta a:hover,
.post-content a:hover,
.widget a:hover,
.comment-content a:hover {
  border-bottom-color: transparent;
}

/* ============================================
 * 15. ALIGNMENT & FLOATS
 * ============================================ */

.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;
}

/* ============================================
 * 16. ACCESSIBILITY & UTILITY CLASSES
 * ============================================ */

.hidden {
  display: none !important;
  visibility: hidden;
}

.sr-only {
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  width: auto;
}

.invisible {
  visibility: hidden;
}

/* ============================================
 * 17. FIXED CONTENT IMAGE ADAPTIVE
 * ============================================ */

.post-content img,
.comment-content img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 20px auto;
}

.post-content figure.image,
.comment-content figure.image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px auto !important;
}

.post-content figure.image img,
.comment-content figure.image img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 0 auto;
}

.post-content img[style*="width"],
.post-content img[style*="height"],
.comment-content img[style*="width"],
.comment-content img[style*="height"] {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
}

.post-content img[style*="aspect-ratio"],
.comment-content img[style*="aspect-ratio"] {
    aspect-ratio: unset !important;
}

/* ============================================
 * 18. RESPONSIVE DESIGN
 * ============================================ */

/* 导航栏响应式 */
@media (max-width: 992px) {
    .nav-container {
        padding: 0 15px;
        gap: 15px;
    }
    
    #nav-search {
        max-width: 400px;
    }
    
    .user-name {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
        gap: 10px;
    }
    
    .nav-center {
        display: flex;
    }
    
    #nav-search {
        max-width: 300px;
        min-width: 150px;
    }
    
    .user-name {
        display: none;
    }
    
    .nav-site-title {
        font-size: 16px;
    }
    
    .user-auth a {
        padding: 4px 8px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .nav-left {
        min-width: auto;
    }
    
    .nav-site-title {
        font-size: 14px;
    }
    
    #nav-search {
        min-width: 120px;
    }
    
    .nav-search-input {
        padding: 6px 36px 6px 12px;
        font-size: 13px;
    }
    
    .user-auth {
        gap: 8px;
    }
    
    .user-auth a {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
}

/* 基础响应式 */
@media (max-width: 767px) {
  body {
    font-size: 81.25%;
  }
  #nav-menu a {
    float: none;
    display: inline-block;
    margin: 0 -2px;
  }
}

@media (max-width: 768px) {
  #header,
  .post-title,
  .post-meta {
    text-align: center;
  }
}

/* 文章封面图片响应式 */
@media (max-width: 992px) {
    .post-cover {
        width: 280px;
    }
    
    .post-cover img {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .post.has-cover {
        flex-direction: column;
        gap: 20px;
    }
    
    .post-cover {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .post-cover img {
        height: 220px;
    }
    
    .post-content img,
    .comment-content img {
        margin: 15px auto;
    }
    
    .post-content figure.image,
    .comment-content figure.image {
        margin: 15px auto !important;
    }
}

@media (max-width: 480px) {
    .post-cover img {
        height: 180px;
    }
}

@media (min-width: 1200px) {
  .container {
    max-width: 952px;
  }
}

/* ============================================
 * 19. HIGH RESOLUTION DISPLAYS
 * ============================================ */

@media 
(-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 192dpi) {
  #search button {
    background-image: url(img/icon-search@2x.png) !important;
    background-size: 20px 20px !important;
  }
  
  .nav-search-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
 * 20. REMOVED STYLES (COMMENTED)
 * ============================================ */

/* 原有的 .user-widget 样式已被新固定导航栏替代 */