/*
  阅·峥嵘页面专属样式 (plaza.css) - 红色文化主题版
*/

/* --- 主布局 (保留原布局) --- */
.plaza-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .plaza-grid {
    /* 大屏幕：两列布局 */
    grid-template-columns: 2fr 1fr; 
    /* 定义网格区域：
       "article timeline" (第一行：微课 | 史实)
       "forum   forum"    (第二行：论坛全宽)
    */
    grid-template-areas: 
      "article timeline"
      "forum   forum";
  }
}

/* 指定各个模块的网格区域 */
.module-article { grid-area: article; }
.module-timeline { grid-area: timeline; }
.module-forum { grid-area: forum; }

/* --- (NEW) Modular Section Styles - Inner Module Header --- */

.plaza-card {
    padding: 0 !important; /* 关键：移除默认内边距，让标题栏贴边 */
    overflow: hidden;      /* 关键：保证标题栏圆角跟随卡片 */
    display: flex;
    flex-direction: column;
}

/* 红色标题栏 */
.plaza-header {
    background-color: var(--theme-red); /* 中国红背景 */
    padding: 1rem 1.5rem;
    border-bottom: 3px solid var(--theme-gold); /* 金色分割线 */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.plaza-title-text {
    color: white; /* 白字 */
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.05em;
}

/* 金色图标 */
.plaza-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #fde047; /* 亮金色 */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* 内容包裹区 (补回 Padding) */
.plaza-body {
    padding: 1.5rem;
    flex-grow: 1;
    background-color: #fff; /* 确保内容区是纯白 */
    display: flex;
    flex-direction: column;
}

/* --- 左侧：红歌微课 (Article List) --- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px; 
  overflow-y: auto;
  padding-right: 0.5rem;
}

.article-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.375rem;
  border: 1px solid var(--theme-border);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.article-item:hover {
  background-color: #FFFBF7; /* Light background on hover */
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.article-content {
    flex-grow: 1;
}

.article-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--theme-text);
  margin-bottom: 0;
}
.article-summary {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--theme-text-light);
}

/* --- 播放图标 --- */
.play-icon-wrapper {
    position: relative;
    flex-shrink: 0;
    margin-right: 0.75rem;
    width: 2rem; 
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-icon {
    height: 100%;
    width: 100%;
    color: var(--theme-red); /* Use theme color */
    transition: color 0.2s, transform 0.2s;
}
.article-item:hover .play-icon {
    color: var(--theme-red-dark);
    transform: scale(1.1);
}

.forum-container { display: flex; flex-direction: column; height: 500px; }
.forum-notice {
    background-color: #fff1f2; color: #9f1239; padding: 0.75rem; border-radius: 0.375rem;
    font-size: 0.875rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
    border: 1px solid #fecdd3;
}
.forum-posts { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; padding-right: 0.5rem; }
.forum-post-item {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem;
    display: flex; gap: 1rem; transition: all 0.2s;
}
.forum-post-item:hover { border-color: #fca5a5; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.post-main { flex-grow: 1; }
.post-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.85rem; color: #666; }
.post-user { font-weight: 700; color: var(--theme-red); }
.post-content { font-size: 1rem; color: #333; line-height: 1.6; }
.post-actions { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-left: 1rem; border-left: 1px dashed #eee; min-width: 4rem; }
.post-like-btn { border: none; background: none; cursor: pointer; color: #ccc; display: flex; flex-direction: column; align-items: center; transition: all 0.2s; }
.post-like-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}

.post-like-btn:hover { color: #ef4444; transform: scale(1.1); } 
.post-like-btn.liked { color: #ef4444; }
.post-delete-btn { font-size: 0.75rem; color: #999; margin-top: auto; cursor: pointer; background: none; border: none; }
.post-delete-btn:hover { color: #ef4444; text-decoration: underline; }

.forum-input-area { margin-top: 1rem; background: #f9fafb; padding: 1rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; }
.forum-input { width: 100%; border: 1px solid #d1d5db; border-radius: 0.375rem; padding: 0.75rem; min-height: 80px; margin-bottom: 0.75rem; resize: vertical; }
.forum-input:focus { outline: none; border-color: var(--theme-red); box-shadow: 0 0 0 2px rgba(193,44,31,0.1); }
.forum-submit-btn { width: 100%; background: var(--theme-red); color: white; padding: 0.75rem; border-radius: 0.375rem; border: none; cursor: pointer; font-weight: 600; transition: background-color 0.2s; }
.forum-submit-btn:hover { background: var(--theme-red-dark); }



/* --- 右侧：史实放映室 (Timeline) --- */
.timeline {
  position: relative;
  max-height: 500px;   /* 你想限制的高度 */
  overflow-y: auto;
  padding-right: 0.5rem;
  padding-left: 0;
  display: block;
}

/* 内层：绘制整条竖线（不受高度限制） */
.timeline-inner {
  position: relative;
}
/* Time line main vertical connector */
.timeline-inner::before {
    content: '';
    position: absolute;
    left: 1.5rem;      /* 竖线的位置 */
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #fce8e8;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 3.5rem; /* Space for dot and year */
}

/* ======================================================= */
/* ▼ 修改后的五角星样式 ▼ */
/* ======================================================= */
.timeline-dot {
  position: absolute;
  left: 1.5rem; 
  top: 0.25rem;
  height: 1.5rem; /* 容器大小，给五角星留出空间 */
  width: 1.5rem;
  background-color: transparent; 
  border: none; /* 移除圆点边框 */
  border-radius: 0; /* 移除圆点圆角 */
  z-index: 10;
  transform: translateX(-50%) rotate(0deg); /* 初始定位和旋转 */
  transition: transform 0.4s ease-in-out; /* 旋转动画 */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 使用 ::before 绘制五角星 */
.timeline-dot::before {
    content: '★'; /* Unicode 星形字符 */
    font-size: 1.25rem; /* 控制星形大小 */
    line-height: 1; /* 确保垂直居中 */
    color: var(--theme-red); /* 默认红色 */
    /* 增加一个细微的阴影或描边，使其更清晰 */
    text-shadow: 0 0 4px rgba(193, 44, 31, 0.4); 
    transition: color 0.3s;
}

/* 展开状态下的样式：五角星变为金色，并旋转 */
.timeline-item.is-expanded .timeline-dot {
    transform: translateX(-50%) rotate(360deg);
}

.timeline-item.is-expanded .timeline-dot::before {
    color: var(--theme-gold); /* 展开后改为金色 */
    text-shadow: 0 0 5px var(--theme-gold); /* 金色光晕 */
}
/* ======================================================= */
/* ▲ 修改后的五角星样式 ▲ */
/* ======================================================= */

.timeline-year {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--theme-red);
}
.timeline-description {
  margin-top: 0.25rem;
  color: var(--theme-text);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

/* Collapsible details */
.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, margin-top 0.4s ease-out;
    background-color: #FDFBF7;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
}
.timeline-item.is-expanded .timeline-details {
    max-height: 500px; /* Large enough to show content */
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--theme-border);
    border-left: 3px solid var(--theme-red);
}

/* --- 视频播放器弹窗样式 --- */
.video-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}
.video-modal-content {
    position: relative;
    background-color: #000;
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 56rem;
}
.close-modal-button {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.close-modal-button:hover {
    opacity: 1;
}
.video-player {
    width: 100%;
    border-radius: 0.5rem;
    display: block;
}
.hidden {
    display: none;
}
.bookmark-wrapper {
    position: fixed;
    top: 4rem; 
    right: 3rem; /* 向左挪一点 */
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.bookmark-pull {
    pointer-events: auto;
    background-color: #B91C1C; /* 更深的红色 */
    color: #FFD700; /* 更亮的金色 */
    width: 4rem; 
    height: 6rem; /* 初始长度 */
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end;
    padding-bottom: 1.2rem; 
    cursor: pointer;
    /* 弹性过渡效果 */
    transition: height 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s; 
    /* 底部切角 (书签形状) */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    border-top: 4px solid #D4AF37; /* 顶部金边 */
}

.bookmark-pull:hover {
    background-color: #DC2626;
    height: 6.5rem; /* 悬停微动 */
}

/* 延长状态 */
.bookmark-pull.extended {
    height: 12rem; /* 显著拉长 */
    background-color: #991B1B;
}

.bookmark-icon {
    width: 2rem; 
    height: 2rem; 
    transition: transform 0.5s;
}
.bookmark-pull.extended .bookmark-icon {
    transform: rotate(180deg); /* 倒转箭头 */
}

.bookmark-text {
    writing-mode: vertical-rl; 
    text-orientation: upright; 
    letter-spacing: 0.2rem;
    font-size: 1.1rem; 
    font-weight: 800; 
    margin-bottom: 0.5rem;
}