/**
 * ==============================================================================
 * CookieTune - 聚合门户首页专属样式表 (home.css)
 * 2.5D 鼠标多图层视差 Banner · 12 列 Bento Grid · 玻璃拟态模块化卡片 · Markdown 编辑器
 * ==============================================================================
 */

:root {
  --portal-bg: #0d0f18;
  --portal-card-bg: rgba(26, 29, 45, 0.65);
  --portal-card-border: rgba(255, 255, 255, 0.08);
  --portal-card-hover-border: rgba(255, 117, 140, 0.4);
  --portal-glow: rgba(255, 117, 140, 0.25);
  --portal-primary: #ff758c;
  --portal-secondary: #00cec9;
  --portal-accent: #ffeaa7;
  --portal-text-main: #ffffff;
  --portal-text-dim: rgba(255, 255, 255, 0.65);
  --portal-radius-lg: 20px;
  --portal-radius-md: 14px;
  --portal-radius-sm: 10px;
  --portal-radius-full: 9999px;
  --portal-font-title: 'Cinzel', 'Noto Serif SC', serif;
  --portal-font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 基础全局设定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.portal-body {
  background-color: var(--portal-bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(255, 117, 140, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(0, 206, 201, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(108, 92, 231, 0.08) 0%, transparent 50%);
  /* background-attachment: fixed; 已移除——此属性滚动时触发整页重绘，严重影响帧率 */
  color: var(--portal-text-main);
  font-family: var(--portal-font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* 顶部导航栏 (Navbar) */
.portal-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(13, 15, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  /* transition: all 0.3s ease; 已移除——transition:all 会对所有属性触发过渡，改为无过渡 */

.portal-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.logo-custom-img {
  height: 38px;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.portal-logo-text {
  font-family: var(--portal-font-title);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #ff758c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 国际化语言下拉菜单 */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: rgba(20, 14, 28, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--portal-radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 10000;
}

.lang-dropdown-wrapper.active .lang-dropdown-menu {
  display: flex;
  /* animation: fadeInDown 0.2s ease forwards; 已移除——菜单动画触发合成层重建，影响流畅性 */
}

.lang-opt-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--portal-radius-sm);
  color: var(--portal-text-dim);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.lang-opt-btn:hover, .lang-opt-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.portal-badge-pill {
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.2), rgba(0, 206, 201, 0.2));
  border: 1px solid rgba(255, 117, 140, 0.35);
  padding: 2px 10px;
  border-radius: var(--portal-radius-full);
  font-size: 11px;
  font-weight: 800;
  color: #ff758c;
  letter-spacing: 0.5px;
}

.portal-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--portal-radius-full);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.portal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  /* transform: translateY(-2px); 已移除——hover 位移动画触发重排，影响流畅性 */
}

.portal-nav-btn.primary {
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  border: none;
  box-shadow: 0 4px 16px rgba(255, 117, 140, 0.4);
}

.portal-nav-btn.primary:hover {
  /* transform: translateY(-2px) scale(1.03); 已移除 */
  box-shadow: 0 6px 24px rgba(255, 117, 140, 0.6);
}

/* ==============================================================================
   🌟 2.5D B站风 鼠标多图层视差 Banner (Parallax Header)
   ============================================================================== */
.portal-banner-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  margin-top: 64px;
  overflow: hidden;
  user-select: none;
  background: #0d0f18;
}

.parallax-stage {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* will-change: transform; 已移除——不做视差时不需要提升为合成层 */
  /* transition: transform 0.1s; 已移除——由 JS 直接控制，无需 CSS 过渡 */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 各图层背景与视觉素材 */
.layer-bg {
  background: 
    linear-gradient(180deg, rgba(13, 15, 24, 0.2) 0%, rgba(13, 15, 24, 0.9) 100%),
    radial-gradient(circle at 50% 30%, rgba(255, 117, 140, 0.35) 0%, rgba(108, 92, 231, 0.25) 50%, #0d0f18 100%);
}

.layer-mountains {
  background: radial-gradient(ellipse at 50% 120%, rgba(0, 206, 201, 0.2) 0%, transparent 70%);
}

.layer-mid-particles {
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 117, 140, 0.8), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 90px 40px, rgba(85, 239, 196, 0.8), rgba(0,0,0,0)),
    radial-gradient(3px 3px at 160px 120px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 240px 60px, rgba(255, 234, 167, 0.8), rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 300px 200px;
  opacity: 0.7;
}

.banner-center-content {
  position: relative;
  z-index: 10;
  text-align: center;
  pointer-events: auto;
  padding: 0 20px;
}

.banner-main-title {
  font-family: var(--portal-font-title);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 20%, #ffeaa7 60%, #ff758c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 16px rgba(255, 117, 140, 0.4));
}

.banner-sub-tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.banner-sub-tagline span.sep {
  opacity: 0.35;
}

/* 底部微光过渡遮罩 */
.banner-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--portal-bg));
  pointer-events: none;
}

/* ==============================================================================
   🎛️ 12 列 Bento Grid 容器与模块卡片系统
   ============================================================================== */
.portal-main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 64px 32px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  grid-auto-flow: dense;
}

.bento-card {
  background: var(--portal-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--portal-card-border);
  border-radius: var(--portal-radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  border-color: var(--portal-card-hover-border);
  /* transform: translateY(-3px); 已移除——卡片 hover 位移会触发所有子元素重排 */
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), 0 0 20px var(--portal-glow);
}

/* 跨列设定 */
.col-span-12 { grid-column: span 12; }
.col-span-8  { grid-column: span 8; }
.col-span-6  { grid-column: span 6; }
.col-span-4  { grid-column: span 4; }
.col-span-3  { grid-column: span 3; }

/* 模块头部 (Card Header) */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.card-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--portal-radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--portal-text-dim);
}

.card-badge.fire {
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.25), rgba(255, 71, 87, 0.2));
  color: #ff758c;
  border: 1px solid rgba(255, 117, 140, 0.35);
}

.card-badge.cyan {
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.2), rgba(85, 239, 196, 0.15));
  color: #00cec9;
  border: 1px solid rgba(0, 206, 201, 0.35);
}

.card-action-btn {
  background: none;
  border: none;
  color: var(--portal-text-dim);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-action-btn:hover {
  color: #fff;
}

/* ==============================================================================
   🎵 模块 1: 最新发布 (Latest Releases)
   ============================================================================== */
.latest-songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.song-mini-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--portal-radius-md);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.song-mini-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 117, 140, 0.4);
  /* transform: translateY(-2px); 已移除 */
}

.song-mini-cover {
  width: 52px;
  height: 52px;
  border-radius: var(--portal-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.song-mini-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-mini-title {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-mini-meta {
  font-size: 11.5px;
  color: var(--portal-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-play-icon-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 117, 140, 0.2);
  color: #ff758c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.song-mini-card:hover .song-play-icon-pill {
  background: var(--portal-primary);
  color: #fff;
  transform: scale(1.1);
}

/* ==============================================================================
   🔥 模块 2: 热播 & 点赞榜单 (Ranking List)
   ============================================================================== */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--portal-radius-sm);
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease;
}

.rank-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.rank-num {
  font-size: 15px;
  font-weight: 900;
  width: 24px;
  text-align: center;
  font-family: var(--portal-font-title);
  color: var(--portal-text-dim);
}

.rank-num.top1 { color: #ffeaa7; text-shadow: 0 0 10px rgba(255, 234, 167, 0.5); }
.rank-num.top2 { color: #dfe6e9; text-shadow: 0 0 8px rgba(223, 230, 233, 0.4); }
.rank-num.top3 { color: #fab1a0; text-shadow: 0 0 8px rgba(250, 177, 160, 0.4); }

.rank-cover {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.rank-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-count {
  font-size: 11px;
  color: var(--portal-text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==============================================================================
   📁 模块 3: 目录专区探索 (Category Hub)
   ============================================================================== */
.categories-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.category-tile {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--portal-radius-md);
  padding: 16px;
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-tile:hover {
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.15) 0%, rgba(0, 206, 201, 0.1) 100%);
  border-color: rgba(255, 117, 140, 0.4);
  /* transform: translateY(-2px); 已移除 */
}

.cat-tile-icon {
  font-size: 26px;
}

.cat-tile-name {
  font-size: 15px;
  font-weight: 800;
}

.cat-tile-count {
  font-size: 11.5px;
  color: var(--portal-text-dim);
}

/* ==============================================================================
   📝 模块 4: 博客手记专区 (Blog & Articles Studio)
   ============================================================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.blog-article-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--portal-radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.blog-article-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  /* transform: translateX(4px); 已移除 */
}

.blog-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--portal-text-dim);
}

.blog-tag {
  background: rgba(0, 206, 201, 0.15);
  color: #00cec9;
  border: 1px solid rgba(0, 206, 201, 0.3);
  padding: 1px 8px;
  border-radius: var(--portal-radius-full);
  font-weight: 700;
}

.blog-article-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.blog-article-excerpt {
  font-size: 13px;
  color: var(--portal-text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==============================================================================
   💬 模块 5: 社区心语墙 & 公告栏 (Community & Notice)
   ============================================================================== */
.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.comment-bubble {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--portal-radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.comment-bubble-user {
  font-weight: 800;
  color: #ffeaa7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-bubble-song {
  font-size: 11px;
  color: #ff758c;
  text-decoration: none;
  background: rgba(255, 117, 140, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.comment-bubble-text {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.notice-content {
  font-size: 13px;
  color: var(--portal-text-dim);
  line-height: 1.7;
}

.notice-content strong {
  color: #fff;
}

/* ==============================================================================
   🤖 模块 6: AI 创作导航 (AI Quick Launch Cards)
   ============================================================================== */
.ai-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.ai-link-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--portal-radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ai-link-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 117, 140, 0.4);
  /* transform: translateY(-2px); 已移除 */
}

.ai-link-icon {
  font-size: 24px;
}

.ai-link-title {
  font-size: 12.5px;
  font-weight: 800;
}

.ai-link-desc {
  font-size: 10.5px;
  color: var(--portal-text-dim);
}

/* ==============================================================================
   🔌 模块 7: 公共小插件 (Clock, Weather, Daily Poetry)
   ============================================================================== */
/* 赛博拟态时钟 */
.clock-widget-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 10px 0;
}

.clock-time-display {
  font-size: 32px;
  font-weight: 900;
  font-family: var(--portal-font-title);
  letter-spacing: 2px;
  background: linear-gradient(135deg, #55efc4, #00cec9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(85, 239, 196, 0.4);
}

.clock-date-display {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.clock-lunar-display {
  font-size: 11px;
  color: var(--portal-text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--portal-radius-full);
}

/* 天气微件 & 3天天气预报 */
.weather-widget-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.weather-current-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weather-temp-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-temp {
  font-size: 26px;
  font-weight: 900;
  color: #ffeaa7;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.weather-desc-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #55efc4;
}

.weather-city {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.weather-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 10px rgba(255, 234, 167, 0.4));
}

.weather-forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.forecast-day-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--portal-radius-sm);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.forecast-day-name {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--portal-text-dim);
}

.forecast-icon {
  font-size: 16px;
}

.forecast-temp-range {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
}

/* 每日一诗卡片 */
.poetry-widget-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poetry-verse {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.8;
  color: #ffeaa7;
  letter-spacing: 0.5px;
}

.poetry-author {
  font-size: 12px;
  color: var(--portal-text-dim);
  text-align: right;
}

/* ==============================================================================
   ⚙️ 自定义模块控制抽屉 (Widget Customizer Drawer)
   ============================================================================== */
.customizer-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.customizer-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.customizer-drawer {
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: rgba(18, 21, 35, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.customizer-drawer-overlay.active .customizer-drawer {
  transform: translateX(0);
}

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

.drawer-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--portal-text-dim);
  font-size: 20px;
  cursor: pointer;
}

.widget-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.widget-toggle-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--portal-radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-toggle-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
}

/* Switch Switcher */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #00cec9;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* ==============================================================================
   📝 在线 Markdown 文章编辑器与阅读弹窗 (Markdown Studio Modal)
   ============================================================================== */
.md-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.md-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.md-modal-window {
  width: 1100px;
  max-width: 95vw;
  height: 85vh;
  background: rgba(18, 21, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--portal-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.md-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.md-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.md-editor-toolbar {
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.md-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.md-tool-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.md-tool-btn.primary {
  background: linear-gradient(135deg, #00b894, #00cec9);
  border: none;
}

.md-editor-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.md-editor-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.md-title-input {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: inherit;
  outline: none;
}

.md-textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 20px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13.5px;
  color: #ffffff;
  line-height: 1.7;
  resize: none;
  outline: none;
}

.md-preview-pane {
  padding: 20px 24px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  color: #f1f2f6;
  font-size: 14px;
  line-height: 1.8;
}

.md-preview-pane h1, .md-preview-pane h2, .md-preview-pane h3 {
  margin: 16px 0 10px 0;
  color: #ffeaa7;
}

.md-preview-pane p {
  margin-bottom: 12px;
}

.md-preview-pane code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.md-preview-pane pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.md-preview-pane blockquote {
  border-left: 4px solid #ff758c;
  padding-left: 12px;
  color: var(--portal-text-dim);
  margin: 12px 0;
}

/* ==============================================================================
   👣 底部综合信息栏 (Footer Module)
   ============================================================================== */
.portal-footer {
  margin-top: 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 36px 32px;
  text-align: center;
  background: rgba(13, 15, 24, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-runtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 206, 201, 0.12);
  border: 1px solid rgba(0, 206, 201, 0.3);
  padding: 4px 16px;
  border-radius: var(--portal-radius-full);
  font-size: 12px;
  font-weight: 700;
  color: #00cec9;
}

.footer-runtime-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00cec9;
  box-shadow: 0 0 6px #00cec9;
  /* animation: pulse 1.5s infinite; 已移除——无限循环动画持续消耗 GPU 资源 */
}

/* @keyframes pulse 已移除 */

.footer-links-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  color: var(--portal-text-dim);
}

.footer-link {
  color: var(--portal-text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #ff758c;
}

.footer-copyright {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ==============================================================================
   📱 移动端与自适应断点 (Responsive Breakpoints)
   ============================================================================== */
@media (max-width: 1024px) {
  .col-span-8, .col-span-6, .col-span-4, .col-span-3 {
    grid-column: span 6;
  }
  .portal-navbar {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .col-span-12, .col-span-8, .col-span-6, .col-span-4, .col-span-3 {
    grid-column: span 12;
  }
  .portal-banner-wrapper {
    height: 180px;
  }
  .banner-main-title {
    font-size: 26px;
  }
  .portal-main-container {
    padding: 16px 16px 48px 16px;
  }
  .md-editor-split {
    grid-template-columns: 1fr;
  }
  .md-preview-pane {
    display: none;
  }
}
