﻿/* ==========================================================================
   base.css — 全站公共基础样式（所有页面必须最先引入）
   --------------------------------------------------------------------------
   内容：1. 红色主题设计变量  2. 浏览器样式重置  3. 公共工具类  4. 跨页面公共组件
   引入顺序：base.css → header.css → footer.css → 页面级样式（如 index.css / page.css）
   ========================================================================== */

/* ------------------------------ 1. 主题变量 ------------------------------ */
:root {
  /* 红色主色系（纪检监察主题色） */
  --red-900: #720d12;                 /* 最深红：页脚、重装饰 */
  --red-800: #8c1016;                 /* 深红：导航当前项、按压态 */
  --red-700: #a6001a;                 /* 品牌主红 */
  --red-600: #c4222c;                 /* 悬停亮红 */
  --red-100: #f9e4e6;                 /* 浅红底 */
  --red-50:  #fcf2f3;                 /* 极浅红底 */

  /* 辅助色 */
  --gold: #c9a063;                    /* 金色点缀 */
  --gold-light: #e2c693;

  /* 中性色 */
  --ink-900: #2b2b2b;                 /* 标题 */
  --ink-700: #4d4d4d;                 /* 正文 */
  --ink-500: #7f7f7f;                 /* 次要文字 */
  --ink-400: #9c9c9c;                 /* 日期、说明文字 */
  --line: #e8e4e0;                    /* 分隔线 */
  --bg-page: #f7f5f2;                 /* 页面底色（浅暖灰） */
  --bg-card: #ffffff;                 /* 卡片底色 */

  /* 圆角 / 阴影 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .12);
  --shadow-red: 0 4px 12px rgba(166, 0, 26, .25);

  /* 版式 */
  --font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Heiti SC", sans-serif;
}

/* ---------------------------- 2. 浏览器样式重置 --------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-700);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

ul,
ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--red-700);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--ink-900);
}

::selection {
  background: var(--red-700);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ------------------------------ 3. 公共工具类 ----------------------------- */
/* 版心容器：全站统一内容宽度 */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 单行省略 */
.text-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 两行省略 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 清除浮动（兼容旧浮动布局的公共页面） */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 仅供屏幕阅读器（无障碍） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------ 4. 跨页面公共组件 ------------------------- */
/* 以下组件在首页与各内页（列表页/内容页/单篇页）之间复用，请勿在页面级样式重复定义 */

/* —— 白色卡片容器 —— */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* —— 栏目标题（红渐变题头 + 右侧“更多”链接） —— */
.home-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--line);
}

.home-title h3 {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  margin-bottom: -1px;              /* 压住面板分隔线 */
  background: linear-gradient(135deg, var(--red-700), var(--red-800));
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.home-title h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
}

.home-title .more {
  padding-bottom: 8px;
  font-size: 13px;
  color: var(--ink-500);
}

.home-title .more:hover {
  color: var(--red-700);
}

/* —— 日期方块（公告/列表条目左侧的红色日期块） —— */
.date-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--red-700), var(--red-800));
  color: #fff;
  line-height: 1.1;
  box-shadow: var(--shadow-red);
  transition: transform .2s ease;
}

.date-block strong {
  font-size: 26px;
  font-weight: 700;
}

.date-block em {
  margin-top: 3px;
  font-style: normal;
  font-size: 11px;
  opacity: .9;
  letter-spacing: .5px;
}

/* 条目链接挂 .link-block 即可联动日期块悬停上浮 */
.link-block:hover .date-block {
  transform: translateY(-2px);
}

/* —— 友情链接区（首页与各内页复用） —— */
.link-section {
  padding: 6px 0 56px;
}

.link-title {
  display: flex;
  align-items: center;
  margin: 0 0 18px;
  padding-left: 12px;
  border-left: 4px solid var(--red-700);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-900);
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.link-list li {
  flex: 1;
  min-width: 150px;
  max-width: 210px;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.link-list a:hover {
  transform: translateY(-4px);
  border-color: var(--red-600);
  box-shadow: var(--shadow-md);
}

.link-list img {
  height: 46px;
  width: auto;
  max-width: 86%;
  object-fit: contain;
}

/* —— 友情链接文字条目变体（挂 .link-list--text，条目为纯文字链接） —— */
.link-list--text a {
  height: 48px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--ink-700);
  white-space: nowrap;
}

.link-list--text a:hover {
  color: var(--red-700);
}

/* —— 回到顶部按钮（全站复用，显隐由 js/main.js 控制） —— */
.back-top {
  position: fixed;
  right: 26px;
  bottom: 36px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red-700);
  color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease,
              background-color .25s ease;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--red-600);
}

/* 公共组件响应式（友情链接 / 回到顶部） */
@media (max-width: 768px) {
  .link-section {
    padding: 4px 0 44px;
  }

  .link-list li {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .back-top {
    right: 16px;
    bottom: 24px;
    width: 42px;
    height: 42px;
  }
}