/* ========================================
   全局样式 - 灵感来源于天涯社区
   ======================================== */

:root {
  /* 主色调 */
  --primary: #5a9a6f;
  --primary-hover: #4a8a5f;
  --primary-active: #3a7a4f;
  --primary-light: #f0f7f2;

  /* 强调色 */
  --accent: #f60;
  --accent-hover: #e55a00;

  /* 背景色 */
  --bg-page: #e8f5e9;
  --bg-header: #eef7ef;
  --bg-card: #f9fdf9;
  --bg-card-alt: #e0efe2;
  --bg-table-stripe: #f6fbf7;
  --bg-table-sticky: #f2f9f3;
  --bg-table-header: #edf6ef;
  --bg-quote: #dceee0;
  --bg-sub-comments: #e8efe9;

  /* 边框 */
  --border-light: #eef2f5;
  --border-accent: #c1ecf8;
  --border-input: #d9d9d9;
  --border-card: #e8e8e8;

  /* 文字颜色 */
  --text-primary: #1a1a1a;
  --text-regular: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --text-link: #4a8a5f;
  --text-link-hover: #3a7a4f;

  /* 状态色 */
  --color-success: #24be58;
  --color-danger: #f5222d;
  --color-danger-hover: #e74c3c;
  --color-info: #1677ff;
  --color-warning: #ff7300;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* 字体 */
  --font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --line-height: 1.7;

  /* 布局 */
  --page-width: 1000px;
  --sidebar-width: 150px;
  --header-height: 46px;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  line-height: var(--line-height);
  color: var(--text-regular);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
  padding: 0;
}

input, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ========================================
   布局容器
   ======================================== */
#doc {
  width: var(--page-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#bd {
  width: var(--page-width);
  display: flex;
  margin-top: 56px;
  flex: 1;
}

#left {
  width: var(--sidebar-width);
  margin-right: 10px;
  flex-shrink: 0;
}

#main {
  flex: 1;
  min-width: 0;
}

/* ========================================
   顶部导航 Header
   ======================================== */
.ty-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  min-width: var(--page-width);
}

.ty-header-inner {
  width: var(--page-width);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ty-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ty-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.ty-logo:hover {
  text-decoration: none;
}

.ty-logo-text {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ty-nav {
  display: flex;
  gap: 0;
}

.ty-nav-item {
  display: inline-block;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.ty-nav-item:hover,
.ty-nav-item.active {
  color: var(--primary);
  text-decoration: none;
}

.ty-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.ty-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ty-search-box {
  display: flex;
  align-items: center;
  gap: 0;
}

.ty-search-input {
  width: 160px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-input);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  outline: none;
  font-size: var(--font-size-sm);
  transition: border-color 0.2s;
}

.ty-search-input:focus {
  border-color: var(--primary);
}

.ty-search-btn {
  height: 28px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: background 0.2s;
}

.ty-search-btn:hover {
  background: var(--primary-hover);
}

/* ========================================
   侧边栏 Sidebar
   ======================================== */
.ty-sidebar {
  padding-top: 0;
}

.ty-sidebar-section {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ty-sidebar-title {
  padding: 10px 14px;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-regular);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-light);
}

.ty-sidebar-menu {
  padding: 4px 0;
}

.ty-menu-item {
  display: block;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  transition: all 0.2s;
}

.ty-menu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.ty-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.ty-tag-cloud {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ty-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 11px;
  transition: all 0.2s;
}

.ty-tag:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* ========================================
   版块头部
   ======================================== */
.ty-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.ty-board-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.ty-board-stats {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ========================================
   表格 - 文章列表
   ======================================== */
.bbs-table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bbs-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.bbs-table thead {
  background: var(--bg-table-header);
}

.bbs-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.bbs-table td {
  padding: 9px 12px;
  font-size: var(--font-size-sm);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.bbs-table tbody tr:hover {
  background-color: var(--primary-light);
}

.bbs-table tbody tr:nth-child(even) {
  background-color: var(--bg-table-stripe);
}

.bbs-table tbody tr:nth-child(even):hover {
  background-color: var(--primary-light);
}

.bbs-table tbody tr.sticky-post {
  background-color: var(--bg-table-sticky);
}

.col-type { width: 30px; text-align: center; }
.col-title { }
.col-author { width: 70px; text-align: center; }
.col-reply { width: 50px; text-align: center; }
.col-time { width: 130px; text-align: center; }

.post-type-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
}

.post-type-icon.original { background: var(--primary); }
.post-type-icon.repost { background: var(--color-warning); }
.post-type-icon.pinned { background: var(--color-danger); }
.post-type-icon.featured { background: var(--color-success); }

.post-title-link {
  color: var(--text-link);
  font-size: var(--font-size-base);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post-title-link.pinned {
  font-weight: 700;
}

.post-author-link {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.post-author-link:hover {
  color: var(--primary);
}

.post-reply-count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.post-reply-count.has-replies {
  color: var(--primary);
  font-weight: 700;
}

.post-time {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ========================================
   分页器
   ======================================== */
.ty-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.ty-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.ty-page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.ty-page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

.ty-page-btn.disabled {
  color: var(--text-muted);
  border-color: var(--border-light);
  cursor: not-allowed;
  pointer-events: none;
}

.ty-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.ty-page-jump {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.ty-page-jump-input {
  width: 44px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: var(--font-size-sm);
}

.ty-page-jump-input:focus {
  border-color: var(--primary);
}

.ty-page-jump-btn {
  height: 28px;
  padding: 0 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.2s;
}

.ty-page-jump-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========================================
   按钮
   ======================================== */
.ty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.5;
}

.ty-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ty-btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.ty-btn-cancel {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border-input);
}

.ty-btn-cancel:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ty-btn-confirm {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}

.ty-btn-confirm:hover {
  background: #1fa84a;
}

.ty-btn-danger {
  background: #fff;
  color: var(--color-danger-hover);
  border-color: var(--border-input);
}

.ty-btn-danger:hover {
  color: #fff;
  background: var(--color-danger-hover);
  border-color: var(--color-danger-hover);
}

.ty-btn-sm {
  padding: 3px 10px;
  font-size: 11px;
}

/* ========================================
   文章详情页布局
   ======================================== */
.ty-post-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.ty-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ty-post-not-found {
  text-align: center;
  padding: 80px 20px;
}

.ty-not-found-content h2 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.ty-not-found-content p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* 文章头部 */
.ty-post-header {
  padding: 16px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.ty-post-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
}

.ty-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.ty-post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 阅读工具栏 */
.ty-reading-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-header);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.ty-toolbar-left,
.ty-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ty-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.ty-toolbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ty-toolbar-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.ty-font-size-selector {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ty-font-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-right: 4px;
}

.ty-font-btn {
  padding: 3px 8px;
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.ty-font-btn:first-of-type {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.ty-font-btn:last-of-type {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.ty-font-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ty-font-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 页面内分页导航 */
.ty-page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ty-page-nav .ty-page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 11px;
}

/* ========================================
   帖子楼层卡片
   ======================================== */
.post-floor-card {
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.post-floor-card.main-post-card {
  background: #f5f7fa;
  border: 1px solid var(--border-accent);
}

.floor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.floor-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.floor-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floor-author-info {
  flex: 1;
}

.floor-author-name {
  display: block;
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--primary);
}

.floor-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.floor-num {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  background: #fff;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
}

.floor-content {
  font-size: var(--font-size-md);
  line-height: 1.8;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 字体大小变体 */
.floor-content.font-medium { font-size: 15px; }
.floor-content.font-large { font-size: 17px; }
.floor-content.font-xlarge { font-size: 19px; }

.floor-content p {
  margin-bottom: 12px;
}

.floor-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 8px 0;
}

.floor-content blockquote {
  background: var(--bg-quote);
  border-left: 3px solid var(--primary);
  margin: 12px 0;
  padding: 10px 14px;
  color: var(--text-secondary);
}

.floor-content pre {
  background: #282c34;
  color: #abb2bf;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}

.floor-content code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.floor-content :not(pre) > code {
  background: var(--bg-quote);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--color-danger);
}

/* 引用回复块 */
.quoted-reply-box {
  background: var(--bg-quote);
  border: 1px dashed #b5b5b5;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.quoted-reply-box .quote-author {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

/* 楼层操作按钮 */
.floor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-input);
}

.floor-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}

.floor-action-btn:hover {
  color: var(--primary);
}

/* 子评论区 */
.floor-sub-comments-zone {
  background: var(--bg-sub-comments);
  border-left: 3px solid #9fb1b5;
  padding: 12px;
  margin-top: 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 已删除楼层占位 */
.deleted-floor-placeholder {
  background: #fef0f0;
  border: 1px dashed var(--color-danger);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: var(--font-size-sm);
}

/* ========================================
   回复区域
   ======================================== */
.ty-replies-section {
  margin-top: 20px;
}

.ty-replies-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
}

.ty-quick-reply {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ty-reply-form-title {
  padding: 10px 16px;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-regular);
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-light);
}

.ty-reply-form {
  padding: 16px;
}

.ty-reply-textarea {
  width: 100%;
  height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  resize: vertical;
  font-size: var(--font-size-base);
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ty-reply-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(90, 154, 111, 0.15);
}

.ty-reply-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.ty-reply-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================
   Toast 提示
   ======================================== */
.bbs-toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
}

.bbs-toast-layer {
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  white-space: nowrap;
  animation: toast-fade-in 0.25s ease;
}

@keyframes toast-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   对话框
   ======================================== */
.dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: 90vw;
  animation: dialog-slide-down 0.25s ease;
}

@keyframes dialog-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dialog-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.dialog-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.dialog-body {
  padding: 20px;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

.dialog-footer {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-light);
}

/* ========================================
   回到顶部
   ======================================== */
.ty-back-to-top {
  position: fixed;
  bottom: 60px;
  right: 30px;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.ty-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.ty-back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   底部 Footer
   ======================================== */
.ty-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  min-width: var(--page-width);
  margin-top: 30px;
  padding: 20px 0;
  text-align: center;
}

.ty-footer-inner p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.8;
}

.ty-footer-inner span {
  color: var(--text-secondary);
}

.ty-footer-inner a {
  color: var(--text-link);
}

.ty-footer-inner a:hover {
  color: var(--accent);
}

/* ========================================
   Typecho 文章内容增强
   ======================================== */
.ty-post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
  border-radius: var(--radius-sm);
}

.ty-post-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.ty-post-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 10px;
}

.ty-post-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-regular);
  margin: 14px 0 8px;
}

.ty-post-content ul, .ty-post-content ol {
  margin: 10px 0;
  padding-left: 24px;
}

.ty-post-content ul { list-style: disc; }
.ty-post-content ol { list-style: decimal; }

.ty-post-content li {
  margin-bottom: 4px;
  line-height: 1.7;
}

.ty-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.ty-post-content table th,
.ty-post-content table td {
  border: 1px solid var(--border-input);
  padding: 6px 10px;
  text-align: left;
}

.ty-post-content table th {
  background: var(--bg-table-header);
  font-weight: 700;
}

.ty-post-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}

.ty-post-content a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.ty-post-content a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 文章标签 */
.ty-post-tags a {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 4px;
  transition: all 0.2s;
  text-decoration: none;
  border-bottom: none;
}

.ty-post-tags a:hover {
  background: var(--primary);
  color: #fff;
  border-bottom: none;
}

/* 上一篇/下一篇导航 */
.ty-post-nav a {
  color: var(--text-link);
  text-decoration: none;
  font-size: 13px;
}

.ty-post-nav a:hover {
  color: var(--accent);
}

/* 评论表单输入框 */
.ty-reply-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(90, 154, 111, 0.15) !important;
}

/* ========================================
   独特面板 (装饰元素)
   ======================================== */
.ty-unique-panel {
  width: 130px;
  float: left;
  margin-right: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.ty-unique-panel .panel-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 24px;
  font-weight: 700;
}

.ty-unique-panel .panel-name {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.ty-unique-panel .panel-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   响应式设计
   ======================================== */
@media screen and (max-width: 480px) {
  :root {
    --page-width: 100%;
    --sidebar-width: 0;
  }

  #doc {
    width: 100%;
  }

  #bd {
    width: 100%;
    flex-direction: column;
    margin-top: 0;
    padding: 10px;
  }

  #left {
    display: none;
  }

  #main {
    width: 100%;
  }

  .ty-header {
    position: relative;
    min-width: auto;
    height: auto;
  }

  .ty-header-inner {
    width: 100%;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }

  .ty-header-left {
    flex-direction: column;
    gap: 8px;
  }

  .ty-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .ty-nav-item {
    padding: 6px 10px;
    font-size: var(--font-size-sm);
  }

  .ty-search-box {
    width: 100%;
  }

  .ty-search-input {
    flex: 1;
    width: auto;
  }

  .ty-footer {
    min-width: auto;
  }

  .bbs-table th.col-author,
  .bbs-table td.col-author,
  .bbs-table th.col-reply,
  .bbs-table td.col-reply {
    display: none;
  }

  .post-title-link {
    max-width: 220px;
  }

  .ty-reading-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ty-back-to-top {
    right: 12px;
    bottom: 40px;
  }

  .dialog-box {
    width: 90vw;
  }
}
