/*
 * Author: 景昇
 * Email: uninto@icloud.com
 * Website: https://uninto.com/
 * GItHub: https://github.com/uninto/homePage
 * 请勿删除，感谢
*/

/* ========== 主题变量 - 液态玻璃 ========== */
:root {
  /* 背景 - 莫兰迪素雅 */
  --bg-grad: linear-gradient(135deg, #e8ecf1 0%, #dfe5ec 50%, #e9ecf0 100%);
  --bg-blob-1: radial-gradient(circle at 20% 30%, rgba(148, 163, 184, 0.15), transparent 50%);
  --bg-blob-2: radial-gradient(circle at 80% 70%, rgba(203, 213, 225, 0.12), transparent 50%);

  /* 玻璃质感 */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.68);
  --glass-blur: 28px;
  --glass-saturate: 180%;
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.03);
  --glass-shadow-strong: 0 16px 48px rgba(15, 23, 42, 0.1), 0 4px 16px rgba(15, 23, 42, 0.04);

  /* 文字 - 素雅灰系 */
  --text: #1a202c;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* 强调 - 不用鲜艳色，用深灰 */
  --accent: #475569;
  --accent-bg: rgba(71, 85, 105, 0.1);
  --accent-text: #334155;

  /* 卡片内部 */
  --card-inner: rgba(255, 255, 255, 0.42);
  --card-border: rgba(255, 255, 255, 0.5);

  /* 状态 */
  --success: #10b981;
  --danger: #ef4444;

  /* 图标 */
  --icon-filter: invert(35%) sepia(8%) saturate(400%) hue-rotate(180deg);

  /* 滚动条 */
  --scrollbar-thumb: rgba(100, 116, 139, 0.3);
}

[theme='dark'] {
  --bg-grad: linear-gradient(135deg, #0c0f14 0%, #11151c 50%, #161b24 100%);
  --bg-blob-1: radial-gradient(circle at 20% 30%, rgba(71, 85, 105, 0.2), transparent 50%);
  --bg-blob-2: radial-gradient(circle at 80% 70%, rgba(100, 116, 139, 0.12), transparent 50%);

  --glass-bg: rgba(22, 27, 34, 0.55);
  --glass-bg-hover: rgba(22, 27, 34, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  --glass-shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.25);

  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent: #cbd5e1;
  --accent-bg: rgba(203, 213, 225, 0.1);
  --accent-text: #e2e8f0;

  --card-inner: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.07);

  --icon-filter: invert(85%) sepia(8%) saturate(300%) hue-rotate(180deg);

  --scrollbar-thumb: rgba(148, 163, 184, 0.3);
}

/* ========== 基础重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'GenSenRounded', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.2s ease;
}

li {
  list-style: none;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px 16px 32px;
  background: var(--bg-grad);
  position: relative;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.6s ease;
}

/* 背景光晕 - 水润感 */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background: var(--bg-blob-1);
}

body::after {
  background: var(--bg-blob-2);
}

body > * {
  position: relative;
  z-index: 1;
}

/* ========== 顶部导航 - 液态玻璃胶囊 ========== */
nav {
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 48px;
  padding: 0 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
}

nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

nav a:hover {
  color: var(--text);
  background: var(--card-inner);
}

nav a.active {
  color: var(--text);
  background: var(--card-inner);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[theme='dark'] nav a.active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

nav img {
  width: 18px;
  height: 18px;
  filter: var(--icon-filter);
  cursor: pointer;
  padding: 9px;
  border-radius: 18px;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-sizing: content-box;
}

nav img:hover {
  background: var(--card-inner);
}

/* 搜索按钮 */
.nav-search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  background: transparent;
  border: none;
  flex-shrink: 0;
}

.nav-search-btn:hover {
  background: var(--card-inner);
  color: var(--text);
}

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

/* 搜索浮层 */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.search-box {
  width: 90%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow-strong), var(--glass-highlight);
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.show .search-box {
  transform: translateY(0);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
}

.search-input-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-close {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.search-close:hover {
  background: var(--card-inner);
  color: var(--text);
}

.search-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--card-inner);
}

.search-result-item .title {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.search-result-item .desc {
  font-size: 12px;
  color: var(--text-muted);
}

.search-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========== 主容器（小卡片） ========== */
main {
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 480px;
  margin-bottom: 16px;
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow-strong), var(--glass-highlight);
  scroll-snap-type: x mandatory;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}

section {
  width: 100%;
  flex-shrink: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

/* section 标题 */
.section-title {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== 首页 ========== */
#bg {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--card-inner);
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  position: absolute;
  top: 145px;
  border: 4px solid var(--glass-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

.info {
  width: 100%;
  flex-grow: 1;
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  color: var(--text);
  text-align: center;
}

.info h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.info h4 {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

#link {
  width: 100%;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

#link a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  transition: all 0.25s ease;
}

#link a:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
}

#link img {
  width: 21px;
  filter: var(--icon-filter);
}

/* ========== 关于页 ========== */
.item {
  width: 100%;
  flex-grow: 1;
  padding: 16px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  overflow-y: auto;
}

#project {
  flex-grow: 0;
  margin-top: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#project img {
  width: 20px;
  filter: var(--icon-filter);
  margin-left: 10px;
}

/* ========== 历程页 ========== */
#line {
  width: 100%;
  flex-grow: 1;
  padding-left: 12px;
  scroll-snap-type: y mandatory;
  overflow-y: auto;
}

#line li {
  position: relative;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--card-border);
  color: var(--text-muted);
  font-size: 12px;
  scroll-snap-align: start;
}

#line li:first-child {
  color: var(--accent);
  font-weight: 600;
}

#line li > div:nth-child(2) {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

.focus {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--card-border);
  border: 2px solid var(--glass-bg);
  position: absolute;
  left: -7px;
  top: 18px;
}

#line li:first-child .focus {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
  animation: focus 2.5s ease infinite;
}

/* ========== 站点页 ========== */
#site {
  width: 100%;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#site li {
  padding: 13px 15px;
  cursor: pointer;
  position: relative;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 13px;
  transition: all 0.25s ease;
  overflow: hidden;
}

#site li:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

#site li a {
  display: block;
}

.status {
  position: absolute;
  right: 13px;
  top: 13px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--glass-bg);
}

#site li a > span:nth-child(2) {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  padding-right: 48px;
}

#site li a > span:last-child {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

/* 站点卡片有背景图时 */
.site-link.has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  border-color: transparent;
}

.site-link.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 0;
  border-radius: inherit;
}

.site-link.has-bg > * {
  position: relative;
  z-index: 1;
}

.site-link.has-bg .site-name {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.site-link.has-bg .site-desc {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.site-link.has-bg .status {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

#site li:hover .site-link.has-bg::before {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* ========== 朋友圈 ========== */
.moments-list {
  width: 100%;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.moment-card {
  padding: 14px 16px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

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

.moment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.moment-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.moment-info {
  flex: 1;
  min-width: 0;
}

.moment-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.moment-time {
  font-size: 11px;
  color: var(--text-muted);
}

.moment-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 10px;
  word-break: break-word;
}

.moment-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.moment-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--card-inner);
  cursor: pointer;
}

.moment-images.single img {
  aspect-ratio: 16/10;
}

.moment-actions {
  display: flex;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

.moment-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.moment-action:hover {
  color: var(--text);
}

.moment-action svg {
  width: 15px;
  height: 15px;
}

/* 朋友圈 - 视频 */
.moment-video {
  margin-bottom: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.moment-video video {
  width: 100%;
  max-height: 280px;
  display: block;
}

.moment-video-hint {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* 朋友圈 - 文件 */
.moment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--accent-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--accent-text);
  font-size: 13px;
  transition: all 0.2s ease;
}

.moment-file:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.moment-file svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.moment-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 图片预览浮层 */
.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.image-preview-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  object-fit: contain;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 空状态 */
.empty-state {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  gap: 8px;
  padding: 32px;
  text-align: center;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

/* ========== 底部 - 不固定 ========== */
footer {
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 10px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== 首页合并区（关于 + 历程） ========== */
.home-content {
  width: 100%;
  flex-grow: 1;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}

.home-content::-webkit-scrollbar {
  width: 3px;
}

.home-content::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--scrollbar-thumb);
}

.about-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.block-title {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* home-content 内的 item 不再单独滚动，交给父级 */
.home-content .item {
  overflow: visible;
  flex-grow: 0;
}

/* home-content 内的 #line 不再单独滚动 */
.home-content #line {
  flex-grow: 0;
  overflow: visible;
  max-height: none;
}

/* ========== 字体 ========== */
@font-face {
  font-family: 'GenSenRounded';
  src: url('GenSenRounded-R.woff2');
}

/* ========== 动画 ========== */
@keyframes focus {
  0% { box-shadow: 0 0 0 0 var(--accent-bg); }
  50% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

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

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
  body {
    padding: 16px 12px 24px;
  }

  nav {
    height: 50px;
    padding: 0 10px;
    gap: 2px;
  }

  nav a {
    font-size: 13px;
    padding: 6px 8px;
  }

  nav img {
    width: 18px;
    height: 18px;
    padding: 6px;
  }

  main {
    height: 460px;
  }

  .avatar {
    width: 80px;
    height: 80px;
    top: 135px;
  }

  .info h2 {
    font-size: 17px;
  }

  .info h4 {
    font-size: 12px;
  }

  #link a {
    width: 40px;
    height: 40px;
  }

  .moment-images {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
}

/* ========== 大屏 ========== */
@media (min-width: 768px) {
  body {
    padding-top: 32px;
  }

  nav {
    width: 420px;
  }

  main {
    width: 420px;
    height: 520px;
  }

  #bg {
    height: 195px;
  }

  .avatar {
    top: 160px;
  }
}

/* ========== 首页 Tab 切换 ========== */
.home-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  flex-shrink: 0;
}

.home-tab {
  flex: 1;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.home-tab:hover {
  color: var(--text);
}

.home-tab.active {
  background: var(--glass-bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.tab-panel {
  display: none;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* tab 内的 #line 单独滚动 */
.tab-panel #line {
  flex-grow: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

/* ========== 朋友圈查看更多按钮 ========== */
.moments-more-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-inner);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.moments-more-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.moments-more-btn span {
  color: var(--accent);
  font-weight: 600;
}

/* ========== 朋友圈全屏浮层 ========== */
.moments-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-grad);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.moments-fullscreen.show {
  opacity: 1;
  pointer-events: auto;
}

.moments-fs-header {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.moments-fs-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.moments-fs-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  background: var(--card-inner);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.moments-fs-close:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}

.moments-fs-close svg {
  width: 18px;
  height: 18px;
}

.moments-fs-list {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.moments-fs-list::-webkit-scrollbar {
  width: 4px;
}

.moments-fs-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--scrollbar-thumb);
}

/* ========== 代码块 ========== */
.moment-code-wrap {
  margin-bottom: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1a1b26;
  position: relative;
}

.moment-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.moment-code-lang {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.moment-code-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.moment-code-tool,
.moment-code-copy {
  padding: 3px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.moment-code-tool:hover,
.moment-code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.moment-code-tool svg {
  width: 12px;
  height: 12px;
}

.moment-code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: #1a1b26;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  /* 默认折叠到约 6 行 */
  max-height: 9.9em;
  overflow-y: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.moment-code-wrap.expanded .moment-code {
  max-height: none;
}

/* 折叠时底部渐变遮罩 + 展开按钮 */
.moment-code-expand {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, #1a1b26 70%);
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 6px;
  cursor: pointer;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  z-index: 2;
}

.moment-code-wrap.foldable .moment-code-expand {
  display: flex;
}

.moment-code-wrap.expanded .moment-code-expand {
  display: none;
}

.moment-code code {
  background: transparent !important;
  padding: 0 !important;
}

/* 代码放大浮层（独立 overlay，避免父容器 backdrop-filter / transform 破坏 fixed 定位） */
.code-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  animation: codeZoomFadeIn 0.25s ease forwards;
}

@keyframes codeZoomFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.code-zoom-overlay .code-zoom-panel {
  width: 100%;
  max-width: 980px;
  height: 100%;
  max-height: 88vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: codeZoomPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 微妙的光晕装饰 */
.code-zoom-overlay::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 60%);
  pointer-events: none;
  animation: codeZoomGlow 4s ease-in-out infinite alternate;
}

@keyframes codeZoomPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes codeZoomGlow {
  from { opacity: 0.4; }
  to { opacity: 0.8; }
}

.code-zoom-overlay .moment-code-header {
  flex-shrink: 0;
  padding: 12px 18px;
}

.code-zoom-overlay .moment-code {
  flex: 1;
  max-height: none;
  overflow: auto;
  font-size: 14px;
  padding: 20px 24px;
}

/* 返回按钮：默认隐藏，在放大 overlay 里显示 */
.moment-code-back {
  display: none;
  padding: 3px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  align-items: center;
  gap: 3px;
}

.moment-code-back:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.moment-code-back svg {
  width: 12px;
  height: 12px;
}

.code-zoom-overlay .moment-code-back {
  display: inline-flex;
}

/* 代码预览浮层 */
.code-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: shareFadeIn 0.25s ease forwards;
}

.code-preview-panel {
  width: 100%;
  max-width: 900px;
  height: 80vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.code-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.code-preview-close {
  width: 28px;
  height: 28px;
  border: none;
  background: #e2e8f0;
  border-radius: 50%;
  font-size: 18px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.code-preview-close:hover {
  background: #cbd5e1;
}

.code-preview-iframe {
  flex: 1;
  border: none;
  background: #fff;
}

.code-preview-notice {
  padding: 40px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* ========== 移动端 - 全屏 & 代码 ========== */
@media (max-width: 480px) {
  .moments-fs-header {
    padding: 12px 16px;
  }

  .moments-fs-list {
    padding: 0 16px 24px;
  }

  .moment-code {
    font-size: 12px;
    padding: 12px;
  }
}

/* ========== 评论区 ========== */
.moment-comments {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

.moment-comments.show {
  display: block;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.comments-list::-webkit-scrollbar {
  width: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--scrollbar-thumb);
}

.comment-item {
  display: flex;
  gap: 8px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.comment-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.comment-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.comment-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.comment-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.comment-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

/* 评论项底部信息：时间 + 点赞按钮 */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 3px;
}

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 2px 5px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.comment-like-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
}

.comment-like-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.comment-like-btn.liked {
  color: var(--danger);
}

.comment-like-btn.liked svg {
  fill: var(--danger);
}

.comment-like-count {
  font-size: 11px;
  min-width: 8px;
}

/* 评论内图片：缩略图展示，点击放大 */
.comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.comment-images img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--card-border);
  transition: transform 0.2s;
}

.comment-images img:hover {
  transform: scale(1.03);
}

/* 查看全部评论 */
.comment-show-all {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px;
  margin-top: 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.comment-show-all:hover {
  background: var(--card-inner);
  color: var(--text);
}

/* ========== 评论输入区（重做版） ========== */
.comment-input-area {
  padding: 8px 4px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
}

.comment-input-top {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 6px;
}

.comment-input-top .comment-avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
  flex-shrink: 0;
}

.comment-input {
  flex: 1;
  border: 1px solid var(--card-border);
  background: var(--glass-bg);
  border-radius: 16px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  min-width: 0;
  transition: border-color 0.2s, background 0.2s;
}

.comment-input:focus {
  border-color: var(--accent);
  background: var(--glass-bg-hover);
}

.comment-input::placeholder {
  color: var(--text-muted);
}

.comment-input-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 0;
}

.comment-tool-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.comment-tool-btn svg {
  width: 17px;
  height: 17px;
}

.comment-tool-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}

.comment-send {
  margin-left: auto;
  padding: 6px 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  border-radius: 14px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: opacity 0.2s;
}

.comment-send:hover {
  opacity: 0.85;
}

.comment-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表情面板 */
.emoji-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 6px;
  margin: 6px 6px 0;
  background: var(--glass-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  max-height: 140px;
  overflow-y: auto;
}

.emoji-panel span {
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.emoji-panel span:hover {
  background: var(--card-inner);
  transform: scale(1.15);
}

/* 评论图片预览（上传缩略图） */
.comment-image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 6px 2px;
}

.comment-img-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--card-inner);
}

.comment-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-img-thumb.uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
}

.comment-img-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}

/* 点赞已激活 */
.moment-action.liked {
  color: var(--danger);
}

.moment-action.liked svg {
  fill: var(--danger);
}

/* 评论数量徽标 */
.comment-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== 分享面板 ========== */
.share-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  opacity: 0;
  animation: shareFadeIn 0.25s ease forwards;
}

@keyframes shareFadeIn {
  to { opacity: 1; }
}

.share-panel {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--glass-shadow-strong), var(--glass-highlight);
  transform: translateY(100%);
  animation: shareSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s forwards;
  overflow: hidden;
}

@keyframes shareSlideUp {
  to { transform: translateY(0); }
}

@media (min-width: 600px) {
  .share-panel-overlay {
    align-items: center;
    padding: 20px;
  }
  .share-panel {
    border-radius: 22px;
  }
}

.share-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.share-panel-close {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--card-inner);
  border-radius: 50%;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}

.share-panel-close:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}

.share-panel-body {
  padding: 20px;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border: none;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.share-item:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
}

.share-item span {
  font-size: 12px;
  color: var(--text-secondary);
}

.share-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.share-icon svg {
  width: 22px;
  height: 22px;
}

.share-icon.wechat { background: #07c160; }
.share-icon.weibo { background: #e6162d; }
.share-icon.qq { background: #12b7f5; }
.share-icon.qzone { background: #fece00; color: #1a1a1a; }
.share-icon.copy { background: var(--accent); }
.share-icon.qrcode { background: #475569; }

.share-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.share-link-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.share-link-copy {
  padding: 5px 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: opacity 0.2s;
}

.share-link-copy:hover {
  opacity: 0.85;
}

.share-qrcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  background: var(--card-inner);
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.share-qrcode-box canvas {
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}

.share-qrcode-tip {
  font-size: 12px;
  color: var(--text-muted);
}
