/* 
  全局视觉设计说明：
  - 背景：暖调米白 (#FAF9F6)，模拟纸张质感
  - 文字：油墨黑 (#1A1A1A)，高对比度锐度
  - 点缀色：暗林绿 (#4F6F52)，仅用于必要强调
  - 风格：硬核纸质杂志感，直角、细边框、强调排版
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #1a1a1a;
  background-color: #faf9f6;
}

.page-article {
  padding-top: 70px;
}
body {
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* 头部：去 AI 化处理，移除模糊，改用实体边框 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #1a1a1a;
  background: #faf9f6;
}

.site-header-minimal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

a.brand-block {
  text-decoration: none;
  color: inherit;
}

a.admin-home-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.brand-mark {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  padding: 2px 6px;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 11px;
  opacity: 0.7;
}

.brand-compact {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 2px solid #1a1a1a;
}

/* 导航交互组件 */

.mobile-menu-toggle {
  display: none; /* 默认隐藏，仅在移动端显示 */
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1100; /* 确保在菜单之上 */
}

.menu-bar {
  width: 24px;
  height: 2px;
  background-color: #1a1a1a;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* 汉堡菜单激活动画 (X 形状) */
.mobile-menu-toggle.active .menu-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.mobile-menu-toggle.active .menu-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 11px; /* 统一缩小，增加精致感 */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-links-wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  position: relative;
  padding-bottom: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link-button {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}

.user-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1a1a1a;
  border: 1.5px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
  padding: 6px 14px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}

/* 彻底移除异常字符方框，改用纯 CSS 绘制 (Auth Icon Fix) */
.user-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4f6f52; /* 暗林绿方块 */
  flex-shrink: 0;
  border-radius: 0;
}

.nav-user-name {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #1a1a1a;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* 状态灯容器优化 */
.nav-user {
  display: flex;
  align-items: center;
}

.user-badge:hover {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* 下拉菜单 (Menu Aesthetics Refined) */
.user-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  right: -1.5px;
  min-width: 180px;
  background-color: #faf9f6; /* 与主体卡片背景一致 */
  border: 2px solid #1a1a1a; /* 直角厚边框，与主体对齐 */
  box-shadow: 12px 12px 0 #1a1a1a; /* 极厚的阴影，体现最高悬浮层级 */
  display: none;
  flex-direction: column;
  z-index: 2000; /* 确保高于页面上所有卡片 (.section-expert) */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}

/* 修复交互死区：透明桥接层 */
.user-dropdown::before {
  content: "";
  position: absolute;
  top: -15px; /* 向上延伸覆盖空隙 */
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
}

/* 使用 .active 类名控制显示，配合 JS 优化 */
.user-badge.active .user-dropdown {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* 兼容 hover 状态 (可选，但建议保留以增强体验) */
.user-badge:hover .user-dropdown {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #e0e0e0;
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.1s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #1a1a1a;
  color: #faf9f6;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #1a1a1a;
  transition: width 0.1s;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link-accent {
  color: #4f6f52;
}

/* 页面结构与留白 */

.site-main {
  padding: 60px 20px 80px;
}

.section {
  padding: 32px 0 48px;
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.section-about {
  padding-top: 40px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 40px;
}

.about-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 42px;
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 600;
}

.about-body {
  font-size: 16px;
  line-height: 1.8;
  max-width: 680px;
  margin: 0 0 20px;
}

.section-header-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 8px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-caption {
  font-size: 12px;
  opacity: 0.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

/* 文章列表重构：杂志级分栏 */

.article-grid {
  display: grid;
  grid-template-columns: 1fr; /* 每个卡片单独一行 */
  gap: 24px;
}

/* 首篇文章置顶 */
.article-grid .article-card:first-child {
  grid-column: auto;
  display: flex;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid #1a1a1a;
  border-radius: 0;
  box-shadow: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.article-grid .article-card:first-child .article-card-title {
  font-size: 36px;
  line-height: 1.1;
}

.article-grid .article-card:first-child .article-card-summary {
  font-size: 16px;
  margin-top: 12px;
}

.article-card {
  background: none;
  border-radius: 0;
  border: none;
  border-top: 1px solid #1a1a1a;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #1a1a1a;
  background-color: #ffffff;
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
}

.article-card-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
}

.article-card-summary {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.article-card-meta {
  font-size: 12px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: auto;
  opacity: 0.9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-card-category {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-empty {
  margin-top: 24px;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.article-card-loading {
  pointer-events: none;
  min-height: 188px;
}

.article-card.article-card-loading:hover {
  transform: none;
  box-shadow: 0 0 0 #1a1a1a;
}

.article-loading-cover,
.article-loading-line,
.article-loading-meta span {
  position: relative;
  overflow: hidden;
  background: #ece7de;
  border: 1px solid rgba(26, 26, 26, 0.12);
}

.article-loading-cover::after,
.article-loading-line::after,
.article-loading-meta span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: articleSkeletonShimmer 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .article-loading-cover::after,
  .article-loading-line::after,
  .article-loading-meta span::after {
    animation: none;
  }
}

.article-loading-cover {
  width: 100%;
  height: 160px;
}

.article-grid .article-card-loading:first-child .article-loading-cover {
  flex: 0 0 220px;
  height: 160px;
}

.article-loading-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-loading-line {
  width: 100%;
  height: 13px;
}

.article-loading-title {
  width: 70%;
  height: 24px;
}

.article-loading-short {
  width: 52%;
}

.article-loading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.article-loading-meta span {
  display: block;
  width: 72px;
  height: 18px;
}

@keyframes articleSkeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* 表单与按钮：触感信纸风格 */

.ticket-form,
.admin-form {
  max-width: 680px;
}

.form-row {
  margin-bottom: 24px;
}

.form-row-inline {
  display: flex;
  align-items: center;
  gap: 24px;
}

.form-label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #1a1a1a;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  background: transparent;
  font-size: 15px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-textarea:focus {
  background-color: #f0f0f0;
  border: 1px solid #1a1a1a;
  padding-left: 12px;
  padding-right: 12px;
  outline: none;
}

.form-textarea {
  line-height: 1.6;
}

.form-textarea.monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
}

.form-checkbox {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.form-status {
  font-size: 13px;
  color: #333;
  font-style: italic;
}

.btn-primary,
.btn-ghost {
  border-radius: 0;
  font-size: 13px;
  padding: 8px 20px;
  border: 1px solid #1a1a1a;
  cursor: pointer;
  background: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.1s;
}

.btn-primary {
  background: #1a1a1a;
  color: #faf9f6;
}

.btn-primary:hover {
  background: #4f6f52;
  border-color: #4f6f52;
}

.btn-ghost {
  color: #1a1a1a;
}

.btn-ghost:hover {
  background: #1a1a1a;
  color: #faf9f6;
}

/* 工单提交成功状态 */
.ticket-success-card {
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-icon {
  font-size: 48px;
  color: #4f6f52;
  margin-bottom: 20px;
  display: block;
}

.success-title {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.success-body {
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  max-width: 400px;
  margin: 0 auto 32px;
}

/* 项目展示 (The Works Grid) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.project-item {
  background: #faf9f6;
  border: 2px solid #1a1a1a;
  padding: 24px;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.project-featured {
  grid-column: 1 / -1;
  background-color: #ffffff;
}

.project-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a1a1a;
}

.project-name {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
}

.project-featured .project-name {
  font-size: 32px;
}

.project-pain {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0;
  font-style: italic;
}

/* 交互式履历时间轴 (Hardcore Timeline) */
.timeline-container {
  position: relative;
  padding-left: 32px;
  margin-top: 24px;
}

.timeline-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #1a1a1a;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: #faf9f6;
  border: 1px solid #1a1a1a;
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-item.active::before {
  background: #4f6f52; /* 暗绿色指示灯 */
  border-color: #4f6f52;
  box-shadow: 0 0 0 4px #faf9f6, 0 0 0 5px #4f6f52;
  width: 8px;
  height: 8px;
}

.timeline-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.timeline-event {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.timeline-desc {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* 社交与代码平台锚点 (Trust Anchors) */
.social-links {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  vertical-align: middle;
}

.social-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  transition: all 0.2s;
  padding: 5px;
}

.social-anchor svg {
  width: 100%;
  height: 100%;
}

.social-anchor:hover {
  background-color: #1a1a1a;
  color: #faf9f6;
  transform: translateY(-2px);
}

/* 页脚 */

.site-footer {
  border-top: 1px solid #1a1a1a;
  padding: 32px 20px 48px;
  background: #faf9f6;
}

.site-footer-minimal {
  border-top: none;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-separator {
  opacity: 0.3;
}

.link-muted {
  font-size: 13px;
  color: #1a1a1a;
  text-decoration: underline;
}

.link-muted:hover {
  color: #4f6f52;
}

/* 文章阅读：杂志级排版 */

.article-main {
  padding: 48px 20px 80px;
}

.article-container {
  max-width: 680px;
  margin: 0 auto;
}

.article-layout-narrow {
  max-width: 580px;
}

.article-layout-wide {
  max-width: 800px;
}

.article-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 48px;
  line-height: 1.1;
  margin: 12px 0 20px;
  font-weight: 600;
}

.article-meta {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 0;
  margin-bottom: 32px;
}

.article-meta-separator {
  opacity: 0.3;
}

.article-like-btn,
.article-share-btn {
  font-size: 11px;
  padding: 4px 12px;
}

.article-content {
  margin-top: 0;
  font-size: 17px;
  line-height: 1.8;
  color: #1a1a1a;
}

/* 首字下沉 Drop Cap */
.article-content > p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  float: left;
  font-size: 4.5rem;
  line-height: 1;
  margin: 0.5rem 0.75rem 0 0;
  font-weight: 600;
  color: #1a1a1a;
}

.article-content p {
  margin: 0 0 20px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  font-family: "Playfair Display", "Times New Roman", serif;
  margin: 40px 0 16px;
  font-weight: 600;
  line-height: 1.2;
}

.article-content h1 {
  font-size: 32px;
}

.article-content h2 {
  font-size: 26px;
}

.article-content h3 {
  font-size: 20px;
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 14px;
  background: #f0f0f0;
  padding: 2px 4px;
}

.article-content pre {
  padding: 20px;
  border-radius: 0;
  background: #1a1a1a;
  color: #faf9f6;
  overflow-x: auto;
  font-size: 14px;
  margin: 24px 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 24px;
}

.article-content blockquote {
  margin: 32px 0;
  padding: 0 24px;
  border-left: 3px solid #1a1a1a;
  color: #333;
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
}

.article-content a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.article-content a:hover {
  color: #4f6f52;
}

/* 评论区域 */

.article-comments {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 2px solid #1a1a1a;
}

.comment-list {
  margin-bottom: 32px;
}

.comment-item {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #1a1a1a;
  background: #ffffff;
  box-shadow: 4px 4px 0 #1a1a1a;
}

.comment-item-child {
  margin-top: 16px;
  margin-bottom: 0;
  box-shadow: 2px 2px 0 #1a1a1a;
  background: #faf9f6;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid #1a1a1a;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-content-wrap {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.comment-content {
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  word-wrap: break-word;
}

.comment-actions {
  margin-top: 12px;
}

.comment-actions button {
  background: none;
  border: none;
  color: #4f6f52;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.comment-actions button:hover {
  color: #1a1a1a;
}

.comment-children {
  margin-top: 20px;
  width: 100%;
  flex-basis: 100%;
  padding-left: 56px;
  box-sizing: border-box;
}

/* 后台布局 (Modular Refactor) */

.page-admin {
  background-color: #faf9f6;
}

.admin-shell {
  max-width: 1300px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

.admin-panel {
  max-width: 400px;
  margin: 0 auto;
  background: #faf9f6;
  border: 2px solid #1a1a1a;
  padding: 32px;
  box-shadow: 8px 8px 0 #1a1a1a;
}

.admin-title {
  font-size: 24px;
  margin: 0 0 32px;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-main-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.admin-layout-modular {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.admin-sidebar {
  padding: 24px 16px;
  background: #ffffff;
}

.admin-content-area {
  display: flex;
  flex-direction: column;
}

.admin-tab {
  display: none;
  padding: 32px;
  background: #ffffff;
  min-height: 600px;
}

.admin-tab-active {
  display: block;
}

.admin-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 16px;
}

.module-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-nav-item {
  border: 1.5px solid #1a1a1a;
  background: #ffffff;
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.1s;
  box-shadow: 2px 2px 0 #1a1a1a;
}

.admin-nav-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #1a1a1a;
}

/* 友链页面 */
.page-links .section-links {
  padding: 40px 20px 80px;
}
.page-links .site-header {
  border-bottom: none; /* 去掉 YUAN 底部横线 */
}
.page-links .section-header-line {
  border-bottom: none; /* 去掉标题行下横线 */
}
.link-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr; /* 一行一个 */
  gap: 16px;
}
.oneline-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.header-page-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 2px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  padding: 14px;
  color: #1a1a1a;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.link-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #1a1a1a;
}
.link-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid #1a1a1a;
  background: #faf9f6;
}
.link-info { flex: 1; min-width: 0; }
.link-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.link-tagline {
  font-size: 12px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ----- 文章页：单栏布局与互动操作（扁平风格） ----- */
.page-article .article-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: block;
}
.page-article .article-sidebar { display: none; }
.article-back {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-bottom: 8px;
  position: relative;
}
.slide-out-right {
  animation: slideOutRight 260ms ease forwards;
}
@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(140px); opacity: 0; }
}

.article-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
}
.btn-flat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #1a1a1a;
  background: #ffffff;
  color: #1a1a1a;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden; /* 用于悬停填充效果 */
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
  min-width: 112px; /* 保持按钮尺寸统一 */
  height: 38px;
  justify-content: center;
}
.btn-flat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #d23c3c; /* 默认用于点赞 */
  transition: width 260ms ease;
  z-index: 0;
}
.btn-flat:hover::before { width: 100%; }
.btn-flat:hover { color: #fff; border-color: #d23c3c; } /* 点赞悬停变红 */
.btn-flat > * { position: relative; z-index: 1; }

.like-btn .like-icon {
  display: inline-block;
  font-weight: 700;
  font-size: 12px;
  width: auto;
  height: auto;
  line-height: 1;
  white-space: nowrap;
}

.like-btn #like-count {
  display: inline-block;
  min-width: 1.6em; /* 保持位数变化时不抖动 */
  text-align: right;
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.like-btn.is-active .like-icon,
.like-btn.is-active {
  color: #d23c3c;
}

/* 点击像素碎片粒子 */
.pixel-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #d23c3c;
  opacity: 1;
  will-change: transform, opacity;
}


.share-btn::before { background: #1a1a1a; }
.share-btn:hover { border-color: #1a1a1a; color: #ffffff; }

.article-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}
.article-sidebar {}
.sidebar-sticky {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.meta-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.meta-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a1a;
}
.btn-link-minimal {
  background: none;
  border: none;
  padding: 0;
  color: #4f6f52;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
}
.sidebar-like-btn,
.sidebar-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: transform 80ms ease, box-shadow 80ms ease, color 120ms ease, border-color 120ms ease;
}
.sidebar-like-btn:hover,
.sidebar-share-btn:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #1a1a1a;
}
.sidebar-like-btn.is-pressing {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a1a;
}
.sidebar-like-btn .like-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  color: #1a1a1a;
  transform-origin: center;
  transition: transform 120ms ease, color 120ms ease;
}
.sidebar-like-btn.is-active .like-icon {
  color: #d23c3c;
  transform: scale(1.15);
}
.sidebar-like-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ink-splatter {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #d23c3c;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
@keyframes splatter-anim {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.8); opacity: 0; }
}

.admin-nav-item-active {
  background: #1a1a1a;
  color: #faf9f6;
  transform: translate(1px, 1px);
  box-shadow: none !important;
}

.admin-content {
  border: none;
  padding: 0;
}

/* 投票页面 (Polls) */
.polls-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}
.poll-card {
  background: #fff;
  border: 1px solid #1a1a1a;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: all 0.2s;
}
.poll-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 #1a1a1a;
}
.poll-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #1a1a1a;
}
.poll-description {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}
.poll-options {
  margin-bottom: 20px;
}
.poll-option {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #eee;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.poll-option:hover {
  background: #f9f9f9;
  border-color: #1a1a1a;
}
.poll-option.selected {
  border-color: #1a1a1a;
  background: #f0f0f0;
}
.poll-option-result {
  margin-bottom: 20px;
  padding: 10px 0;
}
.poll-voted-badge {
  font-size: 0.85rem;
  color: #4f6f52;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border: 1px solid #4f6f52;
}
.poll-option input {
  margin-right: 15px;
}
.poll-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.vote-btn {
  background: #1a1a1a;
  color: #faf9f6;
  border: none;
  padding: 10px 25px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}
.vote-btn:hover {
  opacity: 0.9;
}
.vote-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.poll-meta {
  font-size: 0.85rem;
  color: #888;
}
.login-tip {
  color: #d23c3c;
  font-size: 0.9rem;
  margin-top: 10px;
  font-weight: 500;
}
.result-bar-container {
  height: 8px;
  background: #eee;
  margin-top: 8px;
  overflow: hidden;
}
.result-bar {
  height: 100%;
  background: #1a1a1a;
  width: 0;
  transition: width 1s ease-out;
}
.option-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 5px;
}

.admin-toolbar {
  margin-bottom: 0;
}

.admin-split {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
}

.admin-list,
.admin-list-full {
  border: 1px solid #1a1a1a;
  background: transparent;
}

.admin-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.1s;
}

.admin-list-item-active {
  background: #f0f0f0;
}

/* 后台列表行内删除按钮 */
.admin-row-del-btn {
  padding: 2px 10px;
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 8px;
}

.admin-editor-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Magazine Editor - Modernized Integration */
.magazine-editor {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 10px 0;
  border: 2px solid #1a1a1a;
  box-shadow: 4px 4px 0 #faf9f6, 8px 8px 0 #1a1a1a;
  background: #faf9f6;
}

.editor-menu-bar {
  display: flex;
  padding: 8px 16px;
  border-bottom: 1px solid #1a1a1a;
  background: #f0efeb;
  gap: 20px;
}

.menu-item {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
}

.menu-item:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #faf9f6;
  border: 2px solid #1a1a1a;
  box-shadow: 4px 4px 0 #1a1a1a;
  z-index: 10;
  min-width: 150px;
}

.menu-item:hover .menu-dropdown {
  display: flex;
  flex-direction: column;
}

.menu-dropdown button {
  background: none;
  border: none;
  border-bottom: 1px solid #eee;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0;
}

.menu-dropdown button:hover {
  background: #1a1a1a;
  color: #faf9f6;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid #1a1a1a;
  background: #fff;
}

.btn-tool {
  background: none;
  border: 1px solid transparent;
  padding: 4px 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.1s;
  border-radius: 0;
}

.btn-tool:hover {
  border-color: #1a1a1a;
  background: #f0f0f0;
}

.editor-paper {
  padding: 40px;
  min-height: 500px;
  background: #faf9f6;
  cursor: text;
}

.editor-canvas {
  outline: none;
  min-height: 400px;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
}

.editor-canvas[contenteditable]:empty:before {
  content: attr(placeholder);
  color: #aaa;
  font-style: italic;
}

.editor-canvas h1, .editor-canvas h2 {
  font-family: "Playfair Display", serif;
}

.editor-canvas pre {
  font-family: ui-monospace, monospace;
  background: #1a1a1a;
  color: #faf9f6;
  padding: 16px;
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #f0efeb;
  border-top: 1px solid #1a1a1a;
}

.editor-breadcrumbs {
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.1em;
  color: #666;
}

.editor-word-count {
  font-size: 11px;
  color: #666;
}

.admin-editor-preview-pane {
  border-radius: 0;
  border: 1px solid #1a1a1a;
  background: #faf9f6;
  padding: 16px;
}

.admin-editor-upload-btn {
  border-radius: 0;
  border: 1px solid #1a1a1a;
  background: #faf9f6;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* 认证模态框与 Toast */

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.auth-modal-open {
  display: flex;
}

.auth-modal-dialog {
  width: 100%;
  max-width: 400px;
  background: #faf9f6;
  border: 2px solid #1a1a1a;
  border-radius: 0;
  padding: 32px;
  box-shadow: 12px 12px 0 #1a1a1a;
  position: relative;
}

.auth-modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  border: none;
  background: none;
  font-size: 24px;
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal-header {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.auth-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}

.auth-tab-active {
  border-bottom: 2px solid #1a1a1a;
}

.auth-form {
  margin-top: 12px;
}

.input-with-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-button .form-input {
  flex: 1;
}

.btn-text-small {
  background: none;
  border: 1px solid #1a1a1a;
  color: #1a1a1a;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-text-small:hover {
  background: #1a1a1a;
  color: #faf9f6;
}

.btn-text-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: none;
  color: #666;
  border-color: #ccc;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #faf9f6;
  border-radius: 0;
  padding: 8px 20px;
  font-weight: 500;
  border: 1px solid #faf9f6;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.profile-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: flex-end;
  z-index: 100;
}

.profile-panel-inner {
  width: 400px;
  max-width: 100%;
  background: #faf9f6;
  border-left: 2px solid #1a1a1a;
  box-shadow: none;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.profile-title {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  border: none;
  padding: 0;
}

.profile-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #1a1a1a;
  line-height: 1;
  padding: 0;
}

.profile-section {
  border-top: 1px solid #e0e0e0;
  padding: 24px 0;
}

.profile-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.profile-section-title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: #4f6f52;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-text:hover {
  color: #1a1a1a;
}

.form-input-readonly {
  font-size: 15px;
  padding: 8px 0;
  color: #666;
  border-bottom: 1px solid #e0e0e0;
}

/* 个人信息表单滑出动画 (Slide Animation) */
.profile-form-container {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.profile-form-container.active {
  grid-template-rows: 1fr;
  margin-top: 16px;
}

.profile-form-inner {
  min-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.profile-form-container.active .profile-form-inner {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

/* 自定义文件上传重构 (Upload UI Fix) */
.avatar-upload-row {
  margin-bottom: 24px;
}

.custom-file-upload {
  display: flex;
  flex-direction: column; /* 垂直排列，防止 Flex 挤压 */
  gap: 12px;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 32px 16px;
  border: 1px dashed #1a1a1a; /* 虚线矩形区域 */
  background: rgba(26, 26, 26, 0.02);
  transition: all 0.2s;
  text-align: center;
}

.file-upload-label:hover {
  background: rgba(26, 26, 26, 0.05);
}

.file-upload-label::before {
  content: "投递稿件 / 选择文件";
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.file-name-display {
  font-size: 12px;
  color: #666;
  font-style: italic;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* 个人资料面板头像上传样式优化 */
.profile-avatar-container {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}

.profile-avatar-preview {
  width: 80px;
  height: 80px;
  border: 1.5px solid #1a1a1a;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 249, 246, 0.8);
  display: none;
  align-items: flex-end;
}

.avatar-progress-bar {
  width: 0;
  height: 4px;
  background: #4f6f52;
  transition: width 0.3s ease;
}

.profile-avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 密码强度进度条样式 */
.password-strength-container {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.password-strength-text {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  display: block;
}

.strength-weak { background-color: #ff4d4d; width: 33.33% !important; }
.strength-medium { background-color: #ffcc00; width: 66.66% !important; }
.strength-strong { background-color: #4f6f52; width: 100% !important; }

/* 专家级报刊栅格系统布局 - 最终版 (Refactored) */

.brutal-card {
  background: #faf9f6; /* 纸张色 */
  border: 2px solid #1a1a1a; /* 油墨黑 */
  box-shadow: 4px 4px 0 #faf9f6, 8px 8px 0 #1a1a1a; /* 双层投影 */
  position: relative;
  border-radius: 0 !important;
}

/* Quill Brutalist 重构 (Quill UI Reset) */
.ql-toolbar.ql-snow {
  border: none !important;
  border-bottom: 1.5px solid #1a1a1a !important;
  background-color: #faf9f6 !important;
  padding: 12px !important;
}

.ql-container.ql-snow {
  border: none !important;
  font-family: "Inter", sans-serif !important;
  font-size: 16px !important;
  min-height: 400px;
}

.ql-editor {
  padding: 40px !important;
  line-height: 1.8 !important;
  background-color: #faf9f6 !important;
}

/* 移除所有圆角 */
.ql-snow *, .ql-snow::before, .ql-snow::after {
  border-radius: 0 !important;
}

/* 工具栏按钮定制 */
.ql-snow .ql-toolbar button, 
.ql-snow.ql-toolbar button {
  border: 1px solid transparent !important;
  margin-right: 4px !important;
  transition: all 0.1s !important;
}

.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow.ql-toolbar button.ql-active {
  border-color: #1a1a1a !important;
  background-color: #1a1a1a !important;
  color: #faf9f6 !important;
}

.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke {
  stroke: #faf9f6 !important;
}

.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill {
  fill: #faf9f6 !important;
}

/* 内容仿真：首字下沉与标题 */
.ql-editor h1, .ql-editor h2, .ql-editor h3 {
  font-family: "Playfair Display", serif !important;
  font-weight: 600 !important;
  margin-top: 1.5em !important;
  margin-bottom: 0.5em !important;
  color: #1a1a1a !important;
}

.ql-editor p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  float: left;
  font-size: 3.5rem;
  line-height: 1;
  margin: 0.5rem 0.75rem 0 0;
  font-weight: 600;
  color: #1a1a1a;
}

/* 修复编辑器弹出层（链接/图片） */
.ql-snow .ql-tooltip {
  background-color: #faf9f6 !important;
  border: 2px solid #1a1a1a !important;
  box-shadow: 8px 8px 0 #1a1a1a !important;
  padding: 15px !important;
  z-index: 2000 !important;
}

.ql-snow .ql-tooltip input[type=text] {
  border: none !important;
  border-bottom: 1.5px solid #1a1a1a !important;
  background: transparent !important;
  font-family: "Inter", sans-serif !important;
}

.upper-tier-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* 1.5 : 1 比例 */
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto 60px;
  align-items: stretch; /* 强制等高对齐 */
}

.lower-tier-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* 居中对齐 */
  padding-bottom: 80px;
}

.section-expert {
  background: #faf9f6; /* 纸张色 */
  border: 2px solid #1a1a1a; /* 油墨黑 */
  box-shadow: 4px 4px 0 #faf9f6, 8px 8px 0 #1a1a1a; /* 双层投影 */
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-inner {
  padding: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-inner-large {
  padding: 40px; /* 模拟正式书信的留白感 */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 上层卡片特定样式 */
.tech-stack-card,
.articles-preview-card {
  height: 100%; /* 配合 stretch */
}

/* 占位符美化: 虚线边框 */
.article-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #1a1a1a;
  margin-top: 24px;
  min-height: 200px;
  color: #666;
  font-style: italic;
  background: rgba(26, 26, 26, 0.02);
}

/* 下层工单卡片收缩 */
.ticket-card-final {
  width: 100%;
  max-width: 850px; /* 限制在 850px */
}

/* 工单表单精修 */
.ticket-form-final {
  width: 100%;
  margin: 0 auto;
}

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

.btn-primary-expert {
  background: #1a1a1a;
  color: #faf9f6;
  border: 2px solid #1a1a1a;
  padding: 12px 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-expert:hover {
  background: #faf9f6;
  color: #1a1a1a;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #1a1a1a;
}

/* 导航栏认证模块美化 (Refactored v4) */

.nav-auth-badge {
  background: #ffffff;
  color: #1a1a1a;
  border: 1.5px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
  padding: 6px 14px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-auth-badge:hover,
.user-badge:hover {
  transform: translate(1px, 1px);
  box-shadow: none !important;
}

/* 响应式布局适配系统 (Refactored v4) */

/* 1. 桌面端 (Desktop > 1024px) */
@media (min-width: 1025px) {
  .header-inner {
    max-width: 1200px; /* 与 site-main 保持一致 */
    padding: 24px 20px;
    display: grid; /* 采用与主体一致的栅格 */
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: center;
  }

  .nav-main {
    justify-content: flex-start; /* 让导航从右侧分栏的起始线对齐 */
    margin-left: 12px;
  }

  .site-main {
    max-width: 1200px; /* 稍微放宽一点点 */
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* 左右分栏 1.2 : 0.8 */
    gap: 32px;
    padding: 60px 20px 80px;
    align-items: stretch; /* 核心：强制所有网格项拉伸对齐 */
  }

  .section-intro {
    grid-column: 1 / -1;
  }

  .tech-stack-card,
  .articles-preview-card {
    height: 100%; /* 配合 grid 的 stretch 使卡片填满高度 */
    display: flex;
    flex-direction: column;
  }

  .section-expert {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .card-inner {
    flex: 1; /* 确保内部容器也填满 */
    display: flex;
    flex-direction: column;
  }

  .ticket-card-final {
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 100%;
    margin: 40px auto;
  }
}

/* 2. 平板端 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-main {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 1:1 对等分栏 */
    gap: 20px;
    padding: 40px 20px;
  }

  .section-intro, .ticket-card-final {
    grid-column: 1 / -1;
  }

  .nav-main {
    font-size: 11px;
  }
}

/* 3. 移动端 (Mobile < 768px) */
@media (max-width: 767px) {
  body {
    overflow-x: hidden; /* 全局防止横向滚动 */
  }

  .about-title {
    font-size: 1.8rem !important; /* 限制 H1 标题字号最大为 1.8rem */
  }

  .site-main {
    display: block; /* 流式堆叠 */
    padding: 20px;
  }

  .section-expert {
    margin-bottom: 20px; /* 间距缩小至 20px */
    /* 修正: 移动端阴影防溢出补丁 */
    box-shadow: 2px 2px 0 #faf9f6, 4px 4px 0 #1a1a1a; 
  }

  .card-inner, .card-inner-large {
    padding: 20px; /* Padding 降至 20px */
  }

  /* 导航侧边栏化 */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-links-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: #faf9f6;
    border-left: 2px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-links-wrapper.active {
    right: 0;
  }

  .nav-link, 
   .nav-user-name,
   .user-badge,
   .nav-auth-badge {
     font-size: 14px !important; /* 移动端增大字号，确保大小相等 */
     letter-spacing: 0.1em;
   }

  /* 表单优化 */
  .form-input, .form-textarea {
    font-size: 16px;
  }

  /* 项目网格移动端塌陷 */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-name {
    font-size: 20px;
  }

  .project-featured .project-name {
    font-size: 24px;
  }
}

/* 交互反馈：按压感 */
.section-expert:active,
.btn-primary:active,
.btn-primary-expert:active,
.user-badge:active,
.nav-auth-badge:active {
  transform: translate(2px, 2px);
  box-shadow: none !important;
}

/* 确保所有元素无圆角 */
*, *::before, *::after {
  border-radius: 0 !important;
}

.form-input, .form-textarea {
  border: none;
  border-bottom: 1px solid #1a1a1a;
  background: transparent;
  outline: none;
}

/* 其余装饰性样式保留 */
.card-footer-decoration {
  margin-top: auto;
  padding-top: 24px;
}

.motto-horizontal {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #999;
}

.motto-line-short {
  flex: 1;
  height: 1px;
  background: #eee;
}

.article-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-placeholder-expert {
  border: 2px dashed #1a1a1a;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 16px;
  opacity: 0.4;
  flex: 1; /* 填充卡片高度 */
  min-height: 120px;
}

.placeholder-tag {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.placeholder-main {
  font-family: "Playfair Display", serif;
  font-weight: bold;
  font-size: 14px;
}

/* 首字下沉与文字排版 */

.drop-cap p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  float: left;
  font-size: 3.5rem;
  line-height: 1;
  margin: 0.5rem 0.75rem 0 0;
  font-weight: 600;
  color: #1a1a1a;
}

.tech-stack-content p {
  font-size: 15px;
  line-height: 2.0; /* 增加行高，提升呼吸感 */
  margin-bottom: 24px;
  color: #333;
}

/* 标签优化：打字机/索引卡风格 */

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

.tech-tag {
  font-size: 11px;
  padding: 5px 12px;
  border: 1px solid #1a1a1a; /* 统一使用油墨黑 */
  background: transparent;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
  cursor: default;
}

.tech-tag:hover {
  background: #1a1a1a;
  color: #faf9f6;
}

/* 技术栈内容增强样式 */
.tech-group {
  margin-top: 24px;
}

.tech-group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  color: #1a1a1a;
  text-transform: uppercase;
}

.group-separator {
  margin: 20px 0;
  opacity: 0.3;
}

/* 熟练度指示器 */
.tech-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #1a1a1a;
  margin-right: 8px;
  vertical-align: middle;
  opacity: 0.3;
}

.tech-tag[data-level="2"]::before {
  opacity: 0.6;
}

.tech-tag[data-level="3"]::before {
  opacity: 1;
  background: #4f6f52; /* 高熟练度使用品牌绿 */
}

/* 质检合格盖章 */
.quality-stamp {
  position: absolute;
  top: 60px;
  right: 20px;
  border: 2px dashed #1a1a1a;
  padding: 8px 16px;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: rotate(15deg);
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* 邮件编辑器首字不放大 */
#mail-quill-editor .ql-editor p:first-child::first-letter {
  font-size: inherit;
  font-weight: normal;
  float: none;
  margin: 0;
}

/* 修复邮件编辑器溢出问题，确保按钮可见 */
#send-mail-form .magazine-editor {
  overflow: visible !important;
  margin-bottom: 24px;
}

#send-mail-form .form-footer {
  margin-top: 24px;
  clear: both;
}

/* 最新文章网格律动感 */

.article-grid-rhythm {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* 非对称布局 */
  gap: 32px;
}

.article-card {
  background: #fff;
  border: 1px solid #1a1a1a;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 0 0 #1a1a1a; /* 初始无阴影 */
}

/* 纸张浮动交互：向左上方轻微位移 2px，并显示实色底部投影 */
.article-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #1a1a1a;
  opacity: 1; /* 覆盖之前的 opacity 0.8 */
}

/* 头条模式 (Headline Mode) */
.article-card-headline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 32px;
  border-width: 2px;
}

.article-card-headline .article-card-title {
  font-size: 32px;
  line-height: 1.1;
  grid-column: 1;
}

.article-card-headline .article-card-summary {
  grid-column: 2;
  font-size: 16px;
  -webkit-line-clamp: 5; /* 头条摘要允许更长 */
}

.article-card-headline .article-card-meta {
  grid-column: 1 / -1;
  margin-top: 12px;
  border-top: 1px dashed #e0e0e0;
  padding-top: 16px;
}

.article-card-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  color: #1a1a1a;
}

/* 卡片内容包装层（首页横向紧凑卡片 / 文章列表竖排通用） */
.article-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 文字溢出处理：限制在 3 行以内 */
.article-card-summary {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-card-meta {
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* 索引卡式日期 */
.article-date-box {
  border: 1px solid #1a1a1a;
  padding: 2px 6px;
  background: #faf9f6;
  font-family: ui-monospace, monospace;
}

/* 分类标签视觉化 */
.article-card-category {
  color: #4f6f52;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* 阅读进度预测 */
.article-read-time {
  color: #999;
  font-weight: 500;
}

.article-more-link {
  margin-left: auto;
  color: #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
}

/* 占位状态的 UI 补偿 (UNDER CONSTRUCTION) */
.article-placeholder {
  grid-column: span 1;
  height: 200px;
  border: 1px dashed #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
}

.placeholder-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.placeholder-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #1a1a1a;
}

.placeholder-line {
  width: 40px;
  height: 1px;
  background: #1a1a1a;
}

.placeholder-sub {
  font-size: 10px;
  color: #999;
  letter-spacing: 0.1em;
}

/* 响应式适配 */

@media (max-width: 1024px) {
  .article-grid-rhythm {
    grid-template-columns: 1fr;
  }

  .article-card-headline {
    grid-template-columns: 1fr;
  }

  .article-card-headline .article-card-title,
  .article-card-headline .article-card-summary {
    grid-column: 1;
  }

  .index-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .asymmetric-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tech-stack-right {
    border-left: none;
    border-top: 1px dashed #ccc;
    padding-left: 0;
    padding-top: 20px;
  }

  .motto-vertical {
    writing-mode: horizontal-tb;
    flex-direction: row;
  }

  .motto-line {
    width: 40px;
    height: 1px;
  }
}

@media (max-width: 768px) {
  .profile-panel-inner {
    width: 100%;
    height: 100%;
    border-left: none;
    padding: 24px;
  }

  .profile-title {
    font-size: 20px;
  }

  .file-name-display {
    max-width: 120px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card:first-child {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    margin-top: 24px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-split {
    grid-template-columns: 1fr;
  }
}

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.toast-visible {
  opacity: 1;
}

/* ============================================================
   文章编辑器专业化升级（Word 级工具栏 / 设置面板 / 排版预览）
   ============================================================ */

/* --- 工具栏：自定义字体下拉显示中文名 --- */
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="songti"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="songti"]::before {
  content: "宋体";
  font-family: "宋体", SimSun, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="heiti"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="heiti"]::before {
  content: "黑体";
  font-family: "黑体", SimHei, sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="yahei"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="yahei"]::before {
  content: "微软雅黑";
  font-family: "微软雅黑", "Microsoft YaHei", sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="kaiti"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="kaiti"]::before {
  content: "楷体";
  font-family: "楷体", KaiTi, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="fangsong"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="fangsong"]::before {
  content: "仿宋";
  font-family: "仿宋", FangSong, serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
  content: "衬线体";
  font-family: Georgia, "Times New Roman", serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="sans"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="sans"]::before {
  content: "无衬线体";
  font-family: Arial, Helvetica, sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="mono"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="mono"]::before {
  content: "等宽";
  font-family: "Courier New", monospace;
}

/* --- 工具栏：字号下拉直接显示数值 --- */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
  content: attr(data-value);
}

/* --- 编辑器正文：自定义字体类 --- */
.ql-editor .ql-font-songti { font-family: "宋体", SimSun, serif; }
.ql-editor .ql-font-heiti { font-family: "黑体", SimHei, sans-serif; }
.ql-editor .ql-font-yahei { font-family: "微软雅黑", "Microsoft YaHei", sans-serif; }
.ql-editor .ql-font-kaiti { font-family: "楷体", KaiTi, serif; }
.ql-editor .ql-font-fangsong { font-family: "仿宋", FangSong, serif; }
.ql-editor .ql-font-serif { font-family: Georgia, "Times New Roman", serif; }
.ql-editor .ql-font-sans { font-family: Arial, Helvetica, sans-serif; }
.ql-editor .ql-font-mono { font-family: "Courier New", monospace; }

/* 撤销/重做按钮（若主题图标缺失则显示文字符号） */
.ql-toolbar .ql-undo::after,
.ql-toolbar .ql-redo::after {
  display: none;
}
.ql-toolbar .ql-undo:empty::after,
.ql-toolbar .ql-redo:empty::after {
  display: block;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}
.ql-toolbar .ql-undo:empty::after { content: "↶"; }
.ql-toolbar .ql-redo:empty::after { content: "↷"; }

/* --- 编辑器子选项卡 --- */
.article-subtabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 0;
  border-bottom: 2px solid #1a1a1a;
}
.article-subtab {
  background: #f0efeb;
  border: 2px solid #1a1a1a;
  border-bottom: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  color: #1a1a1a;
  margin-bottom: -2px;
}
.article-subtab:hover {
  background: #e3e1db;
}
.article-subtab-active {
  background: #faf9f6;
  border-bottom-color: #faf9f6;
  box-shadow: 0 -2px 0 #1a1a1a inset;
}
.article-subtab-panel {
  padding: 16px 0;
}

/* --- 文档级排版变量：编辑器所见即所得 --- */
#tab-articles .magazine-editor {
  --doc-font: "Inter", sans-serif;
  --doc-font-size: 16px;
  --doc-line-height: 1.8;
  --doc-paragraph: 20px;
  --doc-align: left;
  --doc-indent: 0;
  --doc-text-color: #1a1a1a;
  --doc-bg-color: #faf9f6;
}
#tab-articles .magazine-editor .ql-editor {
  font-family: var(--doc-font) !important;
  font-size: var(--doc-font-size) !important;
  line-height: var(--doc-line-height) !important;
  color: var(--doc-text-color) !important;
  background-color: var(--doc-bg-color) !important;
  text-align: var(--doc-align) !important;
  transition: font-family 0.2s ease, font-size 0.2s ease, color 0.2s ease,
    background-color 0.2s ease;
}
#tab-articles .magazine-editor .ql-editor p {
  margin-bottom: var(--doc-paragraph) !important;
  text-indent: var(--doc-indent) !important;
}
#tab-articles .magazine-editor .ql-editor h1,
#tab-articles .magazine-editor .ql-editor h2,
#tab-articles .magazine-editor .ql-editor h3,
#tab-articles .magazine-editor .ql-editor h4 {
  color: var(--doc-text-color) !important;
}

/* --- 排版设置面板 --- */
.typo-section {
  border: 1px solid #e0e0e0;
  padding: 16px;
  margin-bottom: 16px;
}
.typo-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.typo-live-hint {
  font-size: 10px;
  font-weight: 400;
  color: #888;
  border: 1px solid #ddd;
  padding: 1px 6px;
  text-transform: none;
  letter-spacing: 0;
}
.color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.color-input-wrap input[type="color"] {
  width: 44px;
  height: 36px;
  border: 1px solid #1a1a1a;
  padding: 2px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.color-input-wrap .form-input {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  flex: 1;
}

/* --- 封面图预览 --- */
.article-cover-preview {
  margin-top: 8px;
  border: 2px solid #1a1a1a;
  padding: 8px;
  background: #fff;
  display: inline-block;
  max-width: 100%;
}
.article-cover-preview img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  object-fit: cover;
  margin-bottom: 8px;
}
.form-hint {
  font-size: 12px;
  color: #888;
  margin: 6px 0 0;
}

/* --- 后台列表置顶徽章 --- */
.admin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}
.admin-badge-top {
  background: #1a1a1a;
  color: #faf9f6;
  border: 1px solid #1a1a1a;
}

/* ============================================================
   前台文章页：排版设置 / 封面 / 标签 / 阅读体验
   ============================================================ */

/* --- 文档级排版变量（由后端 typography 覆盖） --- */
.article-container {
  --doc-font: "Inter", sans-serif;
  --doc-font-size: 17px;
  --doc-line-height: 1.8;
  --doc-paragraph: 20px;
  --doc-align: left;
  --doc-indent: 0;
  --doc-text-color: #1a1a1a;
  --doc-bg-color: #ffffff;
}
.article-content-body {
  font-family: var(--doc-font);
  font-size: var(--doc-font-size);
  line-height: var(--doc-line-height);
  color: var(--doc-text-color);
  text-align: var(--doc-align);
  transition: font-size 0.2s ease;
}
.article-content-body p {
  margin-bottom: var(--doc-paragraph);
  text-indent: var(--doc-indent);
}
.article-content-body h1,
.article-content-body h2,
.article-content-body h3,
.article-content-body h4,
.article-content-body blockquote,
.article-content-body pre,
.article-content-body ul,
.article-content-body ol {
  color: var(--doc-text-color);
}
/* 正文标题 / 代码 / 引用基础排版（与编辑器风格一致） */
.article-content-body h1,
.article-content-body h2,
.article-content-body h3,
.article-content-body h4 {
  font-family: "Playfair Display", "Times New Roman", serif;
  margin: 40px 0 16px;
  font-weight: 600;
  line-height: 1.2;
  text-indent: 0;
}
.article-content-body h1 { font-size: 32px; }
.article-content-body h2 { font-size: 26px; }
.article-content-body h3 { font-size: 20px; }
.article-content-body h4 { font-size: 17px; }
.article-content-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  background: #f0f0f0;
  padding: 2px 4px;
}
.article-content-body pre {
  padding: 20px;
  border-radius: 0;
  background: #1a1a1a;
  color: #faf9f6;
  overflow-x: auto;
  font-size: 0.85em;
  margin: 24px 0;
  text-indent: 0;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
}
.article-content-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* --- 代码块复制按钮 --- */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(250, 249, 246, 0.12);
  color: #aaa;
  border: 1px solid rgba(250, 249, 246, 0.2);
  padding: 4px 10px;
  font-size: 11px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 2;
}
.code-copy-btn:hover {
  background: rgba(250, 249, 246, 0.22);
  color: #faf9f6;
}
.article-content-body ul,
.article-content-body ol {
  margin: 0 0 20px 24px;
  padding-left: 0;
}
.article-content-body blockquote {
  margin: 32px 0;
  padding: 0 24px;
  border-left: 3px solid var(--doc-text-color, #1a1a1a);
  color: #555;
  font-style: italic;
  font-size: 1.1em;
  line-height: 1.6;
  text-indent: 0;
}
.article-content-body a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.article-content-body a:hover {
  color: #4f6f52;
}
.article-content-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  margin: 12px 0;
}
.article-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95em;
}
.article-content-body th,
.article-content-body td {
  border: 1px solid #1a1a1a;
  padding: 8px 12px;
  text-align: left;
}
.article-content-body th {
  background: #f0efeb;
  font-weight: 700;
}

/* --- 封面图 --- */
.article-cover-wrap {
  margin: 0 0 20px;
}
.article-cover {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border: 2px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  background: #f0efeb;
}

/* --- 标签 --- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.article-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid #1a1a1a;
  padding: 2px 10px;
  background: #faf9f6;
  color: #1a1a1a;
}

/* --- 阅读工具条 --- */
.reading-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 0 12px;
  margin-bottom: 8px;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}
.reading-chip {
  font-size: 12px;
  color: #666;
  letter-spacing: 0.03em;
}
.reading-label {
  font-size: 12px;
  color: #666;
}
.font-adjust-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-font-adjust {
  border: 1px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.4;
}
.btn-font-adjust:hover {
  background: #1a1a1a;
  color: #faf9f6;
}

/* --- 自动翻译提示条 --- */
/* 与阅读工具条同一套视觉语言：细边框 + 硬阴影，避免额外引入新的样式风格 */
.translate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #1a1a1a;
  background: #f2f0ea;
  padding: 8px 12px;
  margin: 0 0 18px;
  box-shadow: 3px 3px 0 #1a1a1a;
}
.translate-bar-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #444;
}
.translate-bar.is-busy .translate-bar-label {
  opacity: 0.6;
}
.translate-bar-btn {
  border: 1px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.4;
}
.translate-bar-btn:hover {
  background: #1a1a1a;
  color: #faf9f6;
}
.translate-bar-btn[disabled] {
  cursor: default;
  opacity: 0.5;
}

/* --- 文章目录 --- */
.article-toc {
  border: 1px solid #1a1a1a;
  background: #faf9f6;
  padding: 12px 16px;
  margin: 0 0 16px;
  box-shadow: 4px 4px 0 #1a1a1a;
  max-height: 320px;
  overflow-y: auto;
}
.toc-link {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: #1a1a1a;
  text-decoration: none;
  padding: 2px 0;
}
.toc-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toc-level-1 { padding-left: 0; font-weight: 700; }
.toc-level-2 { padding-left: 16px; }
.toc-level-3 { padding-left: 32px; color: #555; }

/* --- 阅读进度条 --- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 999;
}
.reading-progress-fill {
  height: 100%;
  width: 0;
  background: #d23c3c;
  transition: width 0.1s linear;
}

/* --- 列表卡片：封面 / 标签 / 置顶 --- */
.article-card-cover {
  position: relative;
  overflow: hidden;
  border: 1px solid #1a1a1a;
}
.article-card-cover img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.article-card:hover .article-card-cover img {
  transform: scale(1.02);
}
.article-top-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: #1a1a1a;
  color: #faf9f6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 1px solid #1a1a1a;
}
.article-top-badge-inline {
  position: static;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 4px;
}
.article-card-tag {
  color: #666;
  border: 1px solid #ccc;
  padding: 1px 8px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* --- 首页最新文章：紧凑横向卡片（保证整体不高于发展历程卡片） --- */
#articles-preview .article-card {
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
}
#articles-preview .article-card-cover {
  flex: 0 0 110px;
  align-self: stretch;
  display: flex;
  min-height: 96px;
}
#articles-preview .article-card-cover img {
  width: 110px;
  height: 100%;
  object-fit: cover;
}
#articles-preview .article-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#articles-preview .article-card-title {
  font-size: 17px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#articles-preview .article-card-summary {
  -webkit-line-clamp: 2;
}
#articles-preview .article-card-meta {
  font-size: 10px;
  gap: 10px;
  margin-top: auto;
}
#articles-preview .article-card-tag {
  display: none; /* 窄栏省略标签，避免元信息换行 */
}
#articles-preview .article-stack {
  gap: 14px;
}

#articles-preview .article-card-loading {
  min-height: 126px;
}

#articles-preview .article-loading-cover {
  flex: 0 0 110px;
  width: 110px;
  height: auto;
  min-height: 96px;
}

#articles-preview .article-loading-title {
  height: 20px;
}

/* --- 移动端文章阅读体验：微信公众号风格 --- */
@media (max-width: 768px) {
  /* 布局全宽 */
  .article-layout {
    padding: 16px 12px 60px;
  }

  /* 文章容器：取消固定宽度，充分利用屏幕 */
  .article-container,
  .article-layout-narrow,
  .article-layout-wide {
    max-width: 100%;
    padding: 0;
  }

  /* 标题：更大更易读 */
  .article-title {
    font-size: 28px !important;
    margin: 0 0 12px;
    line-height: 1.25;
  }

  /* 返回按钮：顶部全宽栏，拇指易点 */
  .article-back {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 12px;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: none;
  }

  /* 封面图：撑满宽度，高度自适应 */
  .article-cover-wrap {
    margin: 0 -12px 16px;
  }
  .article-cover {
    width: 100vw;
    max-width: 100%;
    max-height: none;
    height: auto;
    object-fit: contain;
    border: none;
    box-shadow: none;
    margin: 0;
    display: block;
  }

  /* 正文阅读体验：微信公众号风格（大字、大行距、适中字重） */
  /* 注意：直接设置 font-size/line-height 而非仅改变量，确保 JS applyTypography 不影响手机端 */
  .article-content-body {
    font-size: 17px !important;
    line-height: 1.9 !important;
    padding: 0 2px;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
      "微软雅黑", "Inter", sans-serif !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    /* 同步更新容器的 CSS 变量，防止其他 CSS 依赖变量 */
    --doc-font-size: 17px !important;
    --doc-line-height: 1.9 !important;
    --doc-paragraph: 28px !important;
  }

  /* 段落间距：微信公众号风格 */
  .article-content-body p {
    margin-bottom: 28px !important;
    text-indent: 0 !important;
  }

  /* 标题层级：缩小以适应手机屏 */
  .article-content-body h1 {
    font-size: 22px !important;
    margin: 36px 0 14px !important;
  }
  .article-content-body h2 {
    font-size: 19px !important;
    margin: 28px 0 12px !important;
  }
  .article-content-body h3 {
    font-size: 17px !important;
    margin: 22px 0 10px !important;
  }
  .article-content-body h4 {
    font-size: 16px !important;
  }

  /* 首字下沉：手机不显示 */
  .article-content-body > p:first-of-type::first-letter {
    float: none !important;
    font-size: inherit !important;
    margin: 0 !important;
    line-height: inherit !important;
  }

  /* 引用：简洁样式 */
  .article-content-body blockquote {
    margin: 24px 0 !important;
    padding: 12px 16px !important;
    border-left-width: 4px !important;
    background: #f7f8fa;
    border-radius: 0 4px 4px 0;
    font-size: 16px !important;
  }

  /* 代码块：可横滑，不破坏布局 */
  .article-content-body pre {
    padding: 14px 12px !important;
    margin: 20px 0 !important;
    border-radius: 6px;
    font-size: 13px !important;
  }
  .article-content-body code {
    font-size: 14px !important;
    background: #f0f0f0 !important;
    border-radius: 3px;
    padding: 1px 5px !important;
  }

  /* 图片：撑满宽度，圆角 */
  .article-content-body img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border: none;
    border-radius: 6px;
    margin: 16px 0;
    display: block;
  }

  /* 列表 */
  .article-content-body ul,
  .article-content-body ol {
    margin: 0 0 20px 20px !important;
    padding-left: 8px !important;
  }
  .article-content-body li {
    margin-bottom: 8px;
  }

  /* 表格：可横滑 */
  .article-content-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 14px;
  }

  /* 阅读工具条：单行紧凑 */
  .reading-toolbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 4px;
    font-size: 13px;
  }
  .btn-font-adjust {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* 阅读进度条：顶部固定，高对比 */
  .reading-progress-bar {
    position: sticky;
    top: 0;
  }

  /* 点赞 / 分享：底部全宽操作栏 */
  .article-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 24px 0 16px;
    padding: 12px 16px;
    background: rgba(250, 249, 246, 0.95);
    border-top: 1px solid #e0e0e0;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* 评论区域 */
  .comments-area {
    padding: 20px 0;
  }
  .section-subtitle {
    font-size: 16px;
    margin-bottom: 16px;
  }
  .comment-item {
    padding: 14px;
    margin-bottom: 16px;
  }
  .comment-children {
    padding-left: 52px;
  }
  .comment-avatar {
    width: 36px;
    height: 36px;
  }
  .comment-meta {
    font-size: 12px;
  }
  .comment-content {
    font-size: 15px;
  }

  /* 评论表单 */
  .comment-post-box textarea {
    font-size: 15px;
    padding: 12px;
  }
  .comment-post-box .btn-primary {
    font-size: 15px;
    padding: 12px 24px;
  }
}

/* --- 后台错误提示弹窗（保存失败等） --- */
.admin-alert {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-alert-box {
  background: #faf9f6;
  border: 2px solid #1a1a1a;
  box-shadow: 8px 8px 0 #1a1a1a;
  padding: 24px;
  max-width: 460px;
  width: 100%;
}
.admin-alert-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-alert-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-alert-box .btn-primary {
  width: 100%;
  justify-content: center;
}

/* --- 文章加载骨架屏 --- */
.article-loading-skeleton {
  padding: 24px;
}
.skeleton-line {
  background: linear-gradient(90deg, #e8e6e1 25%, #f0efeb 50%, #e8e6e1 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 2px;
  margin-bottom: 12px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- 文章加载提示条 --- */
.article-loading-bar {
  padding: 10px 16px;
  background: #f0efeb;
  border-bottom: 1px solid #1a1a1a;
  font-size: 13px;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --- 评论区：提交框与评论列表分隔 --- */
.comment-post-box {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #1a1a1a;
}
.comment-post-box textarea {
  min-height: 100px;
}
.comments-list {
  padding-top: 8px;
}

/* --- 回复指示器（抖音风格） --- */
.reply-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 10px;
  background: #1a1a1a;
  color: #faf9f6;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
}
.reply-to-text {
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.reply-user-name {
  color: #faf9f6;
  font-weight: 600;
}
#cancel-reply-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  margin-left: auto;
  transition: color 0.15s;
}
#cancel-reply-btn:hover {
  color: #faf9f6;
}

/* ============================================================
   Frontend design refresh: preserve content, unify the public UI
   ============================================================ */
:root {
  --paper: #f7f3ea;
  --paper-soft: #eee7da;
  --ink: #171717;
  --muted: #6f6a60;
  --line: rgba(23, 23, 23, 0.18);
  --accent: #416750;
  --accent-soft: #dfe8dc;
  --surface: rgba(255, 255, 255, 0.66);
  --shadow: rgba(23, 23, 23, 0.12);
  --measure: 1120px;
}

html,
body {
  background:
    linear-gradient(180deg, #fbf8f0 0%, var(--paper) 46%, #f3eee4 100%);
  color: var(--ink);
}

body:not(.page-admin) {
  min-height: 100vh;
}

body:not(.page-admin)::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 23, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 78%);
  z-index: -1;
}

.site-header {
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-inner {
  max-width: var(--measure);
  min-height: 72px;
  padding: 14px 24px;
  display: flex;
  gap: 28px;
}

.brand-block {
  min-width: 0;
}

.brand-mark {
  /* 用 min-* + padding 而不是写死 36px：方块里放的是单个汉字，
     但只要内容变长（比如换成拉丁字母的站名）固定宽度就会把字裁掉。
     这样常态下仍是 36×36 的方块，内容超出时自动横向长一点。 */
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 3px 3px 0 var(--accent-soft);
}

.brand-title {
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: var(--muted);
  opacity: 1;
}

.nav-main {
  margin-left: auto;
  justify-content: flex-end;
}

.nav-links-wrapper {
  gap: 18px;
}

.nav-link {
  padding: 7px 0;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.18s ease;
}

.nav-link:hover,
.nav-active {
  color: var(--ink);
}

.nav-link::after {
  height: 1px;
  background: var(--accent);
}

.nav-auth-badge,
.user-badge,
.btn-primary,
.btn-primary-expert,
.btn-ghost,
.btn-flat,
.btn-font-adjust,
.btn-text-small {
  border: 1px solid var(--ink) !important;
  box-shadow: none !important;
  background: var(--surface);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.user-badge {
  padding: 8px 13px;
  background: var(--ink);
  color: var(--paper);
}

.user-badge .nav-user-name {
  color: var(--paper);
}

.nav-auth-badge {
  padding: 8px 13px;
  background: #fff;
  color: var(--ink);
}

.btn-primary,
.btn-primary-expert {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

.btn-primary:hover,
.btn-primary-expert:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

.nav-auth-badge:hover,
.user-badge:hover,
.btn-primary-expert:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent) !important;
}

.site-main,
.article-main,
.article-layout {
  width: min(var(--measure), calc(100% - 48px));
  margin: 0 auto;
}

.site-main {
  padding: 56px 0 84px;
}

.section-intro {
  min-height: clamp(360px, 58vh, 600px);
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.55fr);
  align-items: end;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(42px, 8vw, 84px) 0 clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
}

.about-title {
  max-width: 820px;
  margin: 0 0 22px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.about-body {
  max-width: 62ch;
  color: #302d28;
  font-size: 17px;
  line-height: 1.85;
}

.about-visual {
  margin: 0;
  justify-self: end;
  width: min(100%, 320px);
  aspect-ratio: 4 / 5;
  border: 1px solid var(--ink);
  overflow: hidden;
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: none;
}

.section-expert,
.brutal-card,
.auth-modal-dialog,
.article-container,
.link-card,
.article-card,
.project-item,
.ticket-success-card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 18px 45px var(--shadow) !important;
}

.section-expert {
  overflow: hidden;
}

.card-inner,
.card-inner-large {
  padding: clamp(24px, 4vw, 42px);
}

.section-header-line {
  align-items: end;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  padding-bottom: 12px;
}

.section-title {
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0;
  text-transform: none;
}

.section-caption {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.quality-stamp,
.card-footer-decoration {
  display: none;
}

.tech-stack-content p {
  color: #302d28;
  line-height: 1.85;
}

.tech-tags {
  gap: 8px;
}

.tech-tag,
.article-tag,
.article-card-tag {
  border-color: var(--line) !important;
  background: rgba(65, 103, 80, 0.08);
  color: #284835;
  letter-spacing: 0.02em;
}

.projects-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
}

.project-featured {
  grid-row: span 2;
  min-height: 260px;
}

.project-item {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-item:hover,
.article-card:hover,
.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(23, 23, 23, 0.16) !important;
}

.project-name {
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.05;
}

.project-pain,
.timeline-desc,
.article-card-summary {
  color: var(--muted);
}

.timeline-line {
  background: var(--line);
}

.timeline-item::before {
  background: var(--paper);
  border-color: var(--accent);
}

.timeline-item.active::before {
  background: var(--accent);
}

.article-card {
  border-color: var(--line) !important;
  padding: 18px !important;
  gap: 16px;
}

.article-card:hover {
  margin-left: 0;
  margin-right: 0;
}

.article-grid {
  gap: 18px;
}

.article-grid .article-card:first-child {
  border: 1px solid var(--line) !important;
  padding: clamp(22px, 4vw, 34px) !important;
  gap: 22px;
  background: rgba(255, 255, 255, 0.74) !important;
}

.article-grid .article-card:first-child .article-card-title {
  font-size: clamp(32px, 5vw, 54px);
}

.article-card-cover {
  border-color: var(--line);
  background: var(--paper-soft);
}

.article-card-cover img,
.article-cover {
  filter: saturate(0.9) contrast(1.03);
}

.article-empty {
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 48px 0 84px;
}

.article-container {
  max-width: 820px;
  padding: clamp(28px, 5vw, 56px);
}

.article-title {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.article-back {
  color: var(--muted);
}

.article-content-body,
.article-content {
  color: #282520;
  font-size: 17px;
  line-height: 1.9;
}

.article-content-body h1,
.article-content-body h2,
.article-content-body h3,
.article-content h2,
.article-content h3 {
  letter-spacing: 0;
}

.article-actions,
.reading-toolbar,
.comment-post-box {
  border-color: var(--line);
}

.form-input,
.form-textarea {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.34);
  padding: 12px 0;
}

.form-input:focus,
.form-textarea:focus {
  border-bottom-color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-inner {
  width: min(var(--measure), calc(100% - 48px));
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
}

.social-anchor svg {
  width: 18px;
  height: 18px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.link-card {
  padding: 20px;
}

@media (min-width: 1025px) {
  .header-inner {
    max-width: var(--measure);
    padding: 14px 24px;
    display: flex;
    grid-template-columns: none;
  }

  .site-main {
    max-width: var(--measure);
    width: min(var(--measure), calc(100% - 48px));
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.62fr);
    gap: 24px;
    padding: 56px 0 84px;
  }

  body:not(.page-root) .site-main {
    display: block;
  }

  .page-root .site-main {
    display: grid;
    grid-auto-flow: dense;
  }

  .section-intro,
  .ticket-card-final {
    grid-column: 1 / -1;
  }

  .projects-grid-container,
  .timeline-card {
    grid-column: 1 / 2;
  }

  .tech-stack-card,
  .articles-preview-card {
    grid-column: 2 / 3;
  }
}

@media (max-width: 900px) {
  .section-intro,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-visual {
    justify-self: stretch;
    width: 100%;
    max-height: 260px;
    aspect-ratio: 16 / 8;
  }

  .project-featured {
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .header-inner,
  .site-main,
  .article-main,
  .article-layout,
  .footer-inner {
    width: min(100% - 32px, var(--measure));
  }

  .header-inner {
    min-height: 64px;
    padding: 12px 0;
  }

  .site-main {
    padding: 28px 0 64px;
  }

  .section-intro {
    min-height: 0;
    padding: 36px 0 32px;
  }

  .about-title {
    font-size: clamp(34px, 12vw, 52px) !important;
  }

  .about-body {
    font-size: 16px;
  }

  .nav-links-wrapper {
    width: min(84vw, 360px);
    background: var(--paper);
    border-left: 1px solid var(--line);
    box-shadow: -22px 0 60px rgba(23, 23, 23, 0.14);
  }

  .nav-link,
  .nav-user-name,
  .user-badge,
  .nav-auth-badge {
    font-size: 13px !important;
  }

  .card-inner,
  .card-inner-large,
  .article-container {
    padding: 22px;
  }

  .section-expert {
    margin-bottom: 16px;
  }

  #articles-preview .article-card,
  .article-grid .article-card:first-child,
  .article-card {
    flex-direction: column;
  }

  #articles-preview .article-card-cover,
  #articles-preview .article-card-cover img,
  .article-card-cover img {
    width: 100%;
    height: 180px;
    min-height: 0;
  }

  .article-title {
    font-size: clamp(31px, 10vw, 42px) !important;
  }

  .form-footer-final,
  .footer-inner {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ===== 登录 / 注册弹窗优化 ===== */
.auth-modal {
  background: rgba(23, 23, 23, 0.62);
}

.auth-modal .auth-modal-dialog,
.auth-modal-dialog {
  max-width: 420px;
  padding: 26px 28px 32px;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  background: #fbf8f0 !important;
  box-shadow: 0 24px 60px rgba(23, 23, 23, 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.auth-modal .auth-modal-dialog * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.auth-modal .auth-modal-close {
  top: 14px;
  right: 18px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-modal .auth-modal-close:hover {
  background: rgba(23, 23, 23, 0.07);
  color: var(--ink);
}

/* 分段切换：登录 / 注册 */
.auth-modal .auth-modal-header {
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.06);
}

.auth-modal .auth-tab {
  border: none;
  border-bottom: none;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-modal .auth-tab:not(.auth-tab-active):hover {
  color: var(--ink);
}

.auth-modal .auth-tab-active {
  border: none;
  border-bottom: none;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(23, 23, 23, 0.14);
}

/* 表单：框式输入、清晰焦点 */
.auth-modal .form-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  margin-bottom: 6px;
}

.auth-modal .form-row {
  margin-bottom: 16px;
}

.auth-modal .form-input,
.auth-modal .form-textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-modal .form-input:focus,
.auth-modal .form-textarea:focus {
  border-color: var(--accent);
  padding: 11px 14px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(65, 103, 80, 0.14);
}

.auth-modal .input-with-button {
  gap: 10px;
}

.auth-modal .btn-text-small {
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 11px 14px;
  letter-spacing: 0.02em;
}

.auth-modal .btn-text-small:hover {
  background: #33513f;
  color: #fff;
}

.auth-modal .btn-text-small:disabled {
  background: rgba(23, 23, 23, 0.06);
  color: var(--muted);
  border-color: var(--line);
  opacity: 1;
}

/* 提交按钮：整行易点 */
.auth-modal .form-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
}

.auth-modal .auth-form .btn-primary {
  width: 100%;
  padding: 12px 0;
  font-size: 14px;
  letter-spacing: 0.12em;
  border-radius: 10px;
}

.auth-modal .form-status {
  min-height: 16px;
  font-style: normal;
  text-align: center;
}

@media (max-width: 480px) {
  .auth-modal .auth-modal-dialog {
    margin: 0 14px;
    padding: 22px 20px 26px;
  }
}


/* ================== AI 对话模块（WhatsApp 风格） ==================
   使用场景：首页 #ai-chat 内嵌版（.wa-chat-embed）与 /chat 整屏版（.wa-chat-full）共用同一套类名。
   视觉取 WhatsApp 的会话骨架（顶栏 + 壁纸底会话流 + 胶囊输入条），
   配色换成站点的纸色与暗林绿，避免与整站的纸质杂志风冲突。 */

/* 仅供屏幕阅读器使用的标签（视觉上隐藏但仍可被读出） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wa-chat {
  --wa-out: #d8ebd6; /* 自己发出的气泡（呼应 WhatsApp 绿） */
  --wa-in: #ffffff; /* 对方气泡 */
  --wa-panel: #efe8dc; /* 会话区背景 */
  --wa-bar: #f6f2ea; /* 顶栏与输入条背景 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line, rgba(23, 23, 23, 0.18));
  border-radius: 14px;
  background: var(--wa-bar);
}

/* 整屏版（/chat）：占满页头以下的全部空间，只有会话流内部滚动，
   不做卡片化（无外框、无圆角、无阴影），看起来就是一个完整的聊天应用界面。
   高度由 .page-chat 的 flex 列布局分配，不写死「视口高度减页头」——
   页头高度随断点和换行变化，算式早晚会错位。 */
.wa-chat-full {
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--wa-bar);
}

/* 首页内嵌版：高度更矮，去掉外框，交给外层 .section-expert 承担边框 */
.wa-chat-embed {
  height: 460px;
}

/* ---------- 顶栏 ---------- */
.wa-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--wa-bar);
  border-bottom: 1px solid var(--line, rgba(23, 23, 23, 0.18));
  flex: none;
}

.wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #416750);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wa-peer {
  min-width: 0;
  flex: 1;
}

.wa-peer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
  line-height: 1.3;
}

.wa-peer-status {
  font-size: 12px;
  color: var(--muted, #6f6a60);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-peer-status.is-busy {
  color: var(--accent, #416750);
}

.wa-peer-status.is-error {
  color: #b4453a;
}

.wa-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.wa-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #6f6a60);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.wa-icon-btn svg {
  width: 17px;
  height: 17px;
}

.wa-icon-btn:hover {
  background: rgba(23, 23, 23, 0.07);
  color: var(--ink, #1a1a1a);
}

/* ---------- 会话流 ---------- */
.wa-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--wa-panel);
  /* 极淡的斜向纹理，模拟 WhatsApp 聊天壁纸，不用图片资源 */
  background-image: repeating-linear-gradient(
    45deg,
    rgba(23, 23, 23, 0.022) 0 2px,
    transparent 2px 12px
  );
  scroll-behavior: smooth;
}

.wa-stream.is-dropping {
  outline: 2px dashed var(--accent, #416750);
  outline-offset: -6px;
}

.wa-empty {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.wa-day-divider {
  display: flex;
  justify-content: center;
}

.wa-day-divider span {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted, #6f6a60);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.08);
}

.wa-welcome {
  margin: 0;
  max-width: 40ch;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--wa-in);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink, #1a1a1a);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.1);
}

.wa-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
}

.wa-suggestion {
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  max-width: 100%;
  padding: 8px 13px;
  cursor: pointer;
  border: 1px solid var(--accent, #416750);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent, #416750);
  transition: background 0.18s ease, color 0.18s ease;
}

.wa-suggestion:hover {
  background: var(--accent, #416750);
  color: #fff;
}

/* ---------- 气泡 ---------- */
.wa-row {
  display: flex;
  max-width: 100%;
}

.wa-row-out {
  justify-content: flex-end;
}

.wa-row-in {
  justify-content: flex-start;
}

.wa-bubble {
  position: relative;
  max-width: min(76%, 560px);
  padding: 7px 10px 6px;
  border-radius: 10px;
  background: var(--wa-in);
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.13);
  animation: wa-pop 0.16s ease-out;
}

/* 小尾巴：用两个三角贴在气泡侧边，还原 WhatsApp 的指向感 */
.wa-bubble::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.wa-row-in .wa-bubble {
  border-top-left-radius: 3px;
}

.wa-row-in .wa-bubble::after {
  left: -7px;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.wa-row-out .wa-bubble {
  background: var(--wa-out);
  border-top-right-radius: 3px;
}

.wa-row-out .wa-bubble::after {
  right: -7px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

@keyframes wa-pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wa-bubble-error {
  background: #fdecea !important;
  color: #b4453a;
}

.wa-text {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink, #1a1a1a);
  word-break: break-word;
  white-space: pre-wrap;
}

.wa-row-in .wa-text {
  white-space: normal;
}

.wa-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted, #6f6a60);
  line-height: 1;
}

.wa-ticks {
  color: #4a90a4;
  letter-spacing: -2px;
}

/* ---------- 气泡内图片 ---------- */
.wa-gallery {
  display: grid;
  gap: 3px;
  margin-bottom: 5px;
  border-radius: 7px;
  overflow: hidden;
}

.wa-gallery-multi {
  grid-template-columns: 1fr 1fr;
}

.wa-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  background: rgba(23, 23, 23, 0.05);
}

.wa-gallery:not(.wa-gallery-multi) .wa-image {
  max-width: 260px;
  object-fit: contain;
}

/* ---------- 代码块 ---------- */
.wa-code {
  margin: 8px 0 2px;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 7px;
  background: #1f2a24;
  color: #eef3ee;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}

.wa-code code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.wa-inline-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

/* AI 气泡里的 Markdown 结构：标题、列表、段落都紧凑一些，别用正文页的大留白 */
.wa-bubble p,
.wa-bubble h1,
.wa-bubble h2,
.wa-bubble h3,
.wa-bubble h4,
.wa-bubble ul,
.wa-bubble ol {
  margin: 0.35em 0;
  line-height: 1.55;
}

.wa-bubble p:first-child,
.wa-bubble h1:first-child,
.wa-bubble h2:first-child,
.wa-bubble h3:first-child,
.wa-bubble h4:first-child,
.wa-bubble ul:first-child,
.wa-bubble ol:first-child {
  margin-top: 0;
}

.wa-bubble p:last-child,
.wa-bubble ul:last-child,
.wa-bubble ol:last-child {
  margin-bottom: 0;
}

.wa-bubble h1 { font-size: 1.25em; }
.wa-bubble h2 { font-size: 1.15em; }
.wa-bubble h3 { font-size: 1.08em; }
.wa-bubble h4 { font-size: 1.02em; }

.wa-bubble ul,
.wa-bubble ol {
  padding-left: 1.35em;
}

.wa-bubble li + li {
  margin-top: 0.15em;
}

.wa-bubble hr {
  border: none;
  border-top: 1px solid var(--line, #e0dbce);
  margin: 0.6em 0;
}

.wa-bubble .wa-link {
  color: var(--accent, #2f6d4f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wa-bubble .wa-link:hover {
  color: var(--ink, #171717);
}

.wa-bubble del {
  opacity: 0.65;
}

/* 等待首个 token 时的三点提示 */
.wa-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 3px 0;
}

.wa-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #6f6a60);
  animation: wa-typing-bounce 1.2s ease-in-out infinite;
}

.wa-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.wa-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wa-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ---------- 未登录提示条 ---------- */
.wa-login-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted, #6f6a60);
  background: #fdf6e6;
  border-top: 1px solid var(--line, rgba(23, 23, 23, 0.18));
}

.wa-login-btn {
  font: inherit;
  font-size: 13px;
  padding: 5px 14px;
  cursor: pointer;
  border: 1px solid var(--accent, #416750);
  border-radius: 999px;
  background: var(--accent, #416750);
  color: #fff;
}

.wa-login-btn:hover {
  background: #33513f;
}

/* ---------- 待发送图片预览 ---------- */
.wa-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--wa-bar);
  border-top: 1px solid var(--line, rgba(23, 23, 23, 0.18));
}

.wa-pending {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line, rgba(23, 23, 23, 0.18));
}

.wa-pending img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wa-pending-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 23, 23, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.wa-pending-remove:hover {
  background: #b4453a;
}

/* ---------- 输入条 ---------- */
.wa-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--wa-bar);
  border-top: 1px solid var(--line, rgba(23, 23, 23, 0.18));
  flex: none;
}

.wa-attach-btn,
.wa-send-btn {
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.wa-attach-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #6f6a60);
}

.wa-attach-btn svg {
  width: 20px;
  height: 20px;
}

.wa-attach-btn:hover:not(:disabled) {
  background: rgba(23, 23, 23, 0.07);
  color: var(--ink, #1a1a1a);
}

/* 联网搜索开关：与回形针同尺寸，三档状态用颜色区分（默认灰、常开强调色、关闭划掉） */
.wa-search-btn {
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #6f6a60);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.wa-search-btn svg {
  width: 20px;
  height: 20px;
}

.wa-search-btn:hover:not(:disabled) {
  background: rgba(23, 23, 23, 0.07);
  color: var(--ink, #1a1a1a);
}

.wa-search-btn.is-always {
  color: var(--accent, #416750);
  background: rgba(65, 103, 80, 0.12);
}

.wa-search-btn.is-off {
  opacity: 0.55;
}

/* 关闭档位画一条斜线，让状态在不看 tooltip 时也能分辨 */
.wa-search-btn.is-off::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}

.wa-search-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 参考来源：跟在回答气泡正文之后，用细分隔线与正文区分 */
.wa-sources {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(23, 23, 23, 0.18);
}

.wa-sources-label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #6f6a60);
  margin-bottom: 3px;
}

.wa-sources-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
}

.wa-sources-list a {
  color: var(--accent, #416750);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.wa-sources-list a:hover {
  text-decoration: underline;
}

/* 站点名跟在标题后面，弱化显示：读者扫一眼就知道这条出自哪家 */
.wa-sources-site {
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--muted, #6f6a60);
  white-space: nowrap;
}

.wa-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 140px;
  padding: 10px 14px;
  resize: none;
  overflow-y: auto;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink, #1a1a1a);
  border: 1px solid var(--line, rgba(23, 23, 23, 0.18));
  border-radius: 20px;
  background: #fff;
}

.wa-input:focus {
  outline: none;
  border-color: var(--accent, #416750);
  box-shadow: 0 0 0 3px rgba(65, 103, 80, 0.14);
}

.wa-input:disabled {
  background: rgba(23, 23, 23, 0.05);
  cursor: not-allowed;
}

.wa-send-btn {
  border: 1px solid var(--accent, #416750);
  background: var(--accent, #416750);
  color: #fff;
}

.wa-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.wa-send-btn:hover:not(:disabled) {
  background: #33513f;
}

.wa-attach-btn:disabled,
.wa-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wa-stop-btn {
  font: inherit;
  font-size: 12.5px;
  flex: none;
  height: 40px;
  padding: 0 14px;
  cursor: pointer;
  border: 1px solid var(--line, rgba(23, 23, 23, 0.18));
  border-radius: 20px;
  background: #fff;
  color: var(--ink, #1a1a1a);
}

.wa-stop-btn:hover {
  border-color: #b4453a;
  color: #b4453a;
}

.wa-disclaimer {
  margin: 0;
  padding: 8px 14px 10px;
  background: var(--wa-bar);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted, #6f6a60);
}

/* 整屏页没有独立页脚（会撑出第二个滚动条），必要链接并到这一行右侧 */
.wa-chat-full .wa-disclaimer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
  flex-wrap: wrap;
}

.wa-disclaimer-links {
  display: inline-flex;
  gap: 14px;
  flex: none;
}

.wa-disclaimer-links a:hover {
  color: var(--accent, #416750);
}

/* .page-root .site-main 在宽屏是两列栅格：首页 AI 模块要通栏，
   否则会被挤进左侧列只剩一半宽度 */
@media (min-width: 1024px) {
  .page-root .site-main .ai-home-card {
    grid-column: 1 / -1;
  }
}

/* 整屏版在宽屏下会把气泡拉到很左、右侧留一大片空白。
   用左右内边距把会话流、输入条、免责声明的内容收在同一条居中的量度里，
   气泡自身的百分比宽度也就跟着这条量度走，而背景仍然通栏。 */
@media (min-width: 900px) {
  .wa-chat-full .wa-topbar,
  .wa-chat-full .wa-stream,
  .wa-chat-full .wa-composer,
  .wa-chat-full .wa-previews,
  .wa-chat-full .wa-login-notice,
  .wa-chat-full .wa-disclaimer {
    padding-left: max(14px, calc((100% - 900px) / 2));
    padding-right: max(14px, calc((100% - 900px) / 2));
  }
}

/* ---------- /chat 整屏页的骨架 ---------- */
/* 页面本身不滚动：滚动只发生在 .wa-stream 内部，符合聊天应用的手感。
   100dvh 适配移动端地址栏收缩，不支持 dvh 的浏览器回退到前一行的 100vh。 */
.page-chat {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-chat .site-header {
  flex: none;
  position: static; /* 整屏不滚动，sticky 无意义 */
}

/* 这一页不要站点的通用留白与栅格：main 吃掉页头以下的剩余高度 */
.page-chat .site-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
}

@media (max-width: 767px) {
  .wa-chat-embed {
    height: 420px;
  }

  .wa-chat-full .wa-disclaimer {
    justify-content: flex-start;
  }

  .wa-bubble {
    max-width: 85%;
  }

  .wa-stream {
    padding: 12px 10px 8px;
  }

  .wa-composer {
    padding: 8px 10px;
  }

  /* 窄屏输入条要塞下回形针 + 地球 + 输入框 + 发送，两个图标按钮收窄一点 */
  .wa-attach-btn,
  .wa-search-btn {
    width: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-bubble,
  .wa-typing i {
    animation: none;
  }

  .wa-stream {
    scroll-behavior: auto;
  }
}
