*{
    box-sizing: border-box;
}
html{
    background-color: rgb(255, 255, 255);
}

html, body {
    font-family: "FangSong", "仿宋", "STFangsong", serif;
}
body{
    margin: 0px;
    padding: 0px;
    background-color: rgb(212, 212, 212);
    width: 100vw;
    height: 100vh;
    gap: 10px;
}
.container{
    margin: 0px;
    height:100vh;
    width: 100vw;
    padding: 10px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    
}
.container > * {
    border-radius: 10px;
    /* overflow: hidden; */
}
.top{
    height: 5%;
    width: 100%;
    background-color: rgb(165, 165, 165);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}


/* 内容区域样式 */
.newscontent{
    padding: 5px;
    height: 80%;
    width: 100%;
    gap: 5px;
    background-color: rgb(231, 231, 231);
    display: flex;
    flex-direction: column;
    font-weight: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    min-height: 0;   /* 必须 */
    overflow: visible;   /* 重要 */
}
/* 如果内容区域过大，启用滚动条 */
.news-list{
  flex: 1;                 /* 占满剩余空间 */
  width:100%;
  overflow-y: auto;

  display:flex;
  flex-direction: column;
  gap:5px;

  padding-top: 10px;
  padding-bottom: 10px;

  min-height:0;

  justify-content: start; /* 内容少的时候用js居中 */
}

/*内容组合*/
.newscontent_pic_Combination{
    max-height:70%;
    flex-shrink:0;
    height: 80%;
    min-height: 40%;
    width: 100%;
    padding: 5px;
    gap: 5px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: rgb(231, 231, 231);
    min-height: 0; 
    min-width: 0;
}

/* 图片区域外部包裹 */
.newscontent_pic_warpper{
    padding: 5px;
    height: 100%;
    align-content: center;
    width: 40%;
    background-color: rgb(231, 231, 231);
    gap: 5px;
    min-height: 0; 
    min-width: 0;
}

.newscontent_pic {
    padding: 5px;
    height: 100%;
    width: 100%;
    background-color: rgb(231, 231, 231);
    display: grid;
    gap: 5px;
    /* overflow: hidden; */
    min-height: 0; 
    min-width: 0;
}

.newscontent_pic img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 10px;
    background-color: rgb(255, 255, 255);
    padding: 2px;
    box-shadow: 0px 4px 12px rgba(0,0,0,0.5);
    /* 核心修复：强制允许图片在高度不足时缩小 */
    min-height: 0; 
    min-width: 0;
}

.newscontent_pic.one{
    justify-items: center; 
    align-items: center;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}


/* 3. 两张图布局修复 */
.newscontent_pic.two {
    height: 100%;       /* 移除之前的 max-height: 50%，这里必须是 100% */
    width: 100%;
    justify-items: center; 
    align-items: center;   
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr; /* 这里两个 1fr 会平分容器的 height: 100% */
}

.newscontent_pic.two img {
    width: auto; 
    height: auto; 
    max-height: 90%;
    max-width: 90%;
}

.newscontent_pic.three img {
    justify-self: center;
    align-self: center;
    /* 确保三张图模式下的图片也能正常收缩 */
    width: auto;
    height: auto;
}

.newscontent_pic.three img:first-child {
    grid-column: span 2; 
}

.newscontent_pic.four{
    justify-items: center; 
    align-items: center;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}





.newscontent_text{
    height: 100%;
    width: 60%;
    padding: 5%;
    overflow-y: auto;
    
    background-color: rgb(240, 240, 240);
    display: flex;
    flex-direction: column;
    justify-content: start;
    color: rgb(22, 22, 22);
    border-radius: 10px;
    box-shadow: inset 0px 4px 12px rgba(0,0,0,0.5);
}

.timeline{
  position: relative;
  width: 100%;
  height: 80px;
  background: #5f2222;
  overflow: hidden;
}

.date-float{
  position:absolute;
  top:-0px;
  left:50%;
  transform:translateX(-50%);
  background: rgb(231, 231, 231);
  padding:3px 10px;
  border-radius:6px;
  font-weight:bold;
  color: #303030;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
  z-index: 20;
}

.timeline-center-line{
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: white;
  z-index: 10;
  pointer-events: none;
}

.timeline-track{

  display: flex; /* 关键修改 */
    flex-wrap: nowrap; /* 禁止换行 */
    height: 100%;
    cursor: grab;
}

.timeline-day{

  display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    user-select: none;
    
    /* 关键修改：防止 flex item 被压缩，确保 width 生效 */
    flex-shrink: 0; 
    box-sizing: border-box; /* 确保边框包含在宽度内 */
}
/* 新增：鼠标悬停时的样式 */
.timeline-day:hover {
  /* 使用半透明的黑色覆盖，视觉上就是“变暗”的效果 */
  background-color: rgba(0, 0, 0, 0.2); 
  /* 鼠标变成小手，提示用户这里是可以点击吸附的 */
  cursor: pointer; 
}



.yearline{
    height: 5%;
    width: 100%;
    background-color: rgb(165, 165, 165);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
/* 年份按钮样式 */
.year-btn {
    padding: 5px 15px;
    cursor: pointer;
    background: #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s;
}
.year-btn.active {
    background: #5f2222;
    color: white;
}
.year-btn:hover {
    background: #ccc;
}

/* 有事件的日期加粗显示 */
.timeline-day.has-event {
    font-weight: bold;
    color: #ffffff; /* 亮白色，突出显示 */
    background: rgba(255, 255, 255, 0.1);
}




/* 点击放大层 */
#imgModal{
  position: fixed;
  top: 0;
  left: 0;
  width:100vw;
  height:100vh;
  background: rgba(0,0,0,0.7);
  display: none;   /* 默认隐藏 */
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#imgModal img{
  max-width: 80%;
  max-height: 80%;
}




/* --- 新增：备注链接样式 --- */
.remark-area {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
}

.remark-link {
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
    font-style: italic;       /* 斜体 */
    text-decoration: underline; /* 下划线 */
    color: #5f2222;           /* 深红色，与主题呼应 */
    font-weight: bold;
    transition: color 0.2s;
}

.remark-link:hover {
    color: #ff0000;
}

/* --- 新增：备注弹窗样式 --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex; /* 默认隐藏，JS控制为flex */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.remark-card {
    background: #f0f0f0;
    width: 70%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    position: relative;
}

/* 左侧图片区域 */
.remark-img-box {
    flex: 1; /* 默认占1份 */
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.remark-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧文字区域 */
.remark-text-box {
    flex: 1; /* 默认占1份 */
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    overflow-y: auto;
}

.remark-text-box h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.remark-divider {
    height: 3px;
    width: 40px;
    background: #5f2222;
    margin: 15px 0;
}

.remark-text-box p {
    color: #666;
    line-height: 1.6;
    font-size: 1rem;
    white-space: pre-wrap; /* 保留换行符 */
}

/* --- 核心：无图模式 --- */
/* 当容器被标记为 no-image 时，隐藏图片框，文字框占满 */
.remark-card.no-image .remark-img-box {
    display: none;
}
.remark-card.no-image .remark-text-box {
    flex: 1;
    width: 100%;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .remark-card {
        flex-direction: column;
        width: 90%;
        height: 80vh;
    }
    .remark-img-box {
        height: 40%;
        flex: none;
    }
}