/* ==================== 志诚五金网站样式表 ==================== */
/* 统一管理所有页面的样式 */

/* ==================== CSS 变量 ==================== */
:root {
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --secondary-color: #2c3e50;
  --accent-color: #b0c4de;
  --background-light: #f4f7fb;
  --background-card: #fff;
  --text-dark: #333;
  --text-light: #555;
  --border-color: #ecf0f1;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
  --border-radius: 12px;
  --container-width: 1200px;
}

/* ==================== 全局重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* ==================== 容器 ==================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== 顶部栏 ==================== */
.top {
  background: #1e2b3a;
  color: #b0c4de;
  padding: 8px 0;
  font-size: 14px;
}

.top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.top a {
  color: #b0c4de;
  margin-left: 20px;
}

.top a:hover {
  color: #fff;
}

@media screen and (max-width: 768px) {
  .top .container {
    justify-content: center;
    text-align: center;
  }

  .top .t_l {
    margin-bottom: 5px;
    width: 100%;
  }

  .top .t_r {
    width: 100%;
  }

  .top a {
    margin: 0 10px;
  }
}

/* ==================== 头部 Logo ==================== */
#header {
  background: var(--background-card);
  box-shadow: var(--shadow-sm);
  padding: 20px 0;
}

#logo {
  text-align: center;
}

#logo img {
  max-height: 80px;
  margin: 0 auto;
}

@media screen and (max-width: 480px) {
  #logo img {
    max-height: 60px;
  }
}

/* ==================== 导航菜单 ==================== */
#nav {
  background: var(--secondary-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-x: auto;
}

#nav .container {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  overflow-x: auto;
}

#nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
}

#nav li {
  margin: 0;
}

#nav li a {
  display: block;
  padding: 16px 24px;
  color: #ecf0f1;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 15px;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
}

#nav li a:hover {
  background: rgba(52,73,94,0.3);
  border-bottom-color: var(--primary-color);
  color: #fff;
}

#nav li a.active {
  background: var(--primary-color);
  border-bottom-color: var(--primary-color);
  color: #fff;
}

@media screen and (max-width: 992px) {
  #nav li a {
    padding: 14px 18px;
    font-size: 14px;
  }
}

@media screen and (max-width: 768px) {
  #nav li a {
    text-align: center;
    border-bottom: none;
    padding: 14px 12px;
  }

  #nav li a.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.4);
  }
}

@media screen and (max-width: 480px) {
  #nav li a {
    padding: 12px 8px;
    font-size: 12px;
    letter-spacing: 0;
  }
}

/* ==================== Banner 轮播 ==================== */
.MainBox {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: #ecf0f1;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  z-index: 1;
}

.bannerBox {
  position: relative;
  width: 100%;
  height: 260px;
}

.banner_list {
  position: absolute;
  width: 100%;
  height: 260px;
  top: 0;
  left: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: none;
}

.banner_list_1 {
  display: block;
  background-image: url(../pic/bgpic.jpg);
}

.banner_list_2 {
  background-image: url(../pic/bgpic.jpg);
}

.banner_list::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
  pointer-events: none;
}

.banner_ico_warpper {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
}

.banner_ico {
  display: inline-flex;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  border-radius: 30px;
  padding: 8px 15px;
}

.banner_ico li {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  margin: 0 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
}

.banner_ico li.active,
.banner_ico li:hover {
  opacity: 1;
  transform: scale(1.2);
  background: var(--primary-color);
}

@media screen and (max-width: 768px) {
  .MainBox {
    height: 200px;
    border-radius: 0 0 12px 12px;
  }

  .bannerBox {
    height: 200px;
  }

  .banner_list {
    height: 200px;
  }
}

/* ==================== 主内容区域 ==================== */
#main {
  padding: 50px 0;
  background: var(--background-light);
}

#main .container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

/* 左侧边栏 */
#left {
  flex: 0 0 280px;
  background: var(--background-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  align-self: start;
}

#left_t {
  background: var(--secondary-color);
  color: #fff;
  padding: 18px 20px;
  font-size: 20px;
  font-weight: 500;
}

#left_t span {
  font-size: 14px;
  font-weight: 300;
  margin-left: 10px;
  color: #b0c4de;
}

#left_c .li {
  border-bottom: 1px solid var(--border-color);
}

#left_c .li:last-child {
  border-bottom: none;
}

#left_c .li a {
  display: block;
  padding: 15px 20px;
  color: #34495e;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
}

#left_c .li a:hover {
  background: #f8f9fa;
  color: #2980b9;
  padding-left: 25px;
}

#left_c .li a::before {
  content: "›";
  font-size: 18px;
  position: absolute;
  left: 5px;
  opacity: 0;
  transition: 0.3s;
  color: #3498db;
}

#left_c .li a:hover::before {
  opacity: 1;
  left: 10px;
}

#left_c .li a.active {
  background: #f8f9fa;
  color: #2980b9;
}

/* 右侧内容区 */
#right {
  flex: 1;
  background: var(--background-card);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-md);
  min-width: 0;
}

#p {
  font-size: 26px;
  font-weight: 500;
  color: var(--secondary-color);
  padding-bottom: 15px;
  margin-bottom: 25px;
  border-bottom: 3px solid var(--primary-color);
  display: inline-block;
}

#right_c {
  color: var(--text-light);
  font-size: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

#right_c p {
  margin-bottom: 15px;
}

#right_c p:first-of-type {
  margin-top: 0;
}

@media screen and (max-width: 992px) {
  #main .container {
    flex-direction: column;
  }

  #left {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  #main {
    padding: 30px 0;
  }

  #right {
    padding: 20px;
  }

  #p {
    font-size: 22px;
  }

  #right_c {
    font-size: 15px;
  }
}

@media screen and (max-width: 480px) {
  #p {
    font-size: 20px;
  }
}

/* ==================== 通用卡片组件 ==================== */
.contact-info,
.contact-card,
.notice-text {
  background: #f8fafd;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 4px solid var(--primary-color);
}

.contact-info p,
.contact-card p {
  margin-bottom: 8px;
}

.contact-info strong,
.contact-card strong {
  color: var(--secondary-color);
  min-width: 70px;
  display: inline-block;
}

/* 联系信息卡片 - 联系方式页 */
.contact-card {
  padding: 30px;
  border-radius: var(--border-radius);
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e6ecf5;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  width: 40px;
  font-size: 24px;
  color: var(--primary-color);
  text-align: center;
}

.contact-content {
  flex: 1;
  font-size: 16px;
}

.contact-content strong {
  color: var(--secondary-color);
  font-weight: 600;
}

@media screen and (max-width: 480px) {
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .contact-icon {
    width: auto;
    margin-bottom: 5px;
  }
}

/* 公告说明文字 */
.notice-text {
  padding: 25px;
  margin-bottom: 30px;
  max-width: 100%;
  overflow-x: auto;
}

.notice-text p {
  margin-bottom: 15px;
  word-wrap: break-word;
}

.notice-text img {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.contact-signature {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.contact-signature p {
  margin-bottom: 5px;
}

/* 招聘信息占位卡片 */
.recruitment-placeholder {
  background: #f8fafd;
  border-radius: var(--border-radius);
  padding: 50px 30px;
  text-align: center;
  border: 2px dashed #d0ddee;
}

.placeholder-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.placeholder-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.placeholder-text {
  color: #6c8598;
  margin-bottom: 30px;
}

.placeholder-btn {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 30px;
  border-radius: 30px;
  font-weight: 500;
  transition: 0.3s;
}

.placeholder-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52,152,219,0.3);
}

/* ==================== 图片网格 ==================== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin: 20px 0;
}

.image-item {
  background: var(--background-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.image-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.image-item .caption {
  padding: 15px;
  font-weight: 500;
  color: var(--secondary-color);
  background: #fafafa;
}

@media screen and (max-width: 992px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .image-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== 公告卡片组件 ==================== */
.table-container {
  margin-top: 30px;
}

.announcement-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--background-card);
  border-radius: var(--border-radius);
  padding: 16px 24px;
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.announcement-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 60%;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  transition: transform 0.25s ease;
}

.announcement-card:hover {
  transform: translateX(6px);
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.12);
  border-color: rgba(52, 152, 219, 0.3);
  background: linear-gradient(135deg, #f8fafd 0%, #fff 100%);
}

.announcement-card:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.announcement-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.announcement-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.announcement-content {
  flex: 1;
  min-width: 0;
}

.announcement-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.announcement-sub {
  font-size: 12px;
  color: #999;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.announcement-badge {
  flex-shrink: 0;
  background: #e8f4fd;
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.announcement-arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: #ccc;
  transition: all 0.2s ease;
}

.announcement-card:hover .announcement-arrow {
  fill: var(--primary-color);
  transform: translateX(3px);
}

/* 空状态 */
.announcement-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.announcement-empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.announcement-empty-text {
  font-size: 16px;
}

/* 加载动画 */
.announcement-loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

@media screen and (max-width: 768px) {
  .announcement-card {
    padding: 14px 18px;
    gap: 14px;
  }

  .announcement-title {
    font-size: 14px;
  }

  .announcement-icon {
    width: 36px;
    height: 36px;
  }

  .announcement-icon svg {
    width: 18px;
    height: 18px;
  }
}

@media screen and (max-width: 480px) {
  .announcement-badge {
    display: none;
  }
}

/* ==================== 分页组件 ==================== */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 15px;
}

.page-info {
  font-size: 14px;
  color: #888;
}

.page-buttons {
  display: flex;
  gap: 10px;
}

.page-btn {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn:disabled:hover {
  background: var(--background-card);
  border-color: var(--border-color);
  color: var(--text-dark);
}

@media screen and (max-width: 480px) {
  .pagination {
    flex-direction: column;
    align-items: center;
  }

  .page-btn {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 0;
    white-space: nowrap;
  }

  .page-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
}

/* ==================== 分页样式 ==================== */
.digg4 {
  padding: 20px 0;
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
}

.digg4 a {
  display: inline-block;
  border: 1px solid #ddd;
  padding: 6px 12px;
  margin: 0 4px;
  color: #555;
  border-radius: 4px;
  transition: all 0.3s;
}

.digg4 a:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #f0f7ff;
}

.digg4 span.current {
  display: inline-block;
  border: 1px solid var(--primary-color);
  padding: 6px 12px;
  margin: 0 4px;
  color: #fff;
  background: var(--primary-color);
  border-radius: 4px;
}

.digg4 span.disabled {
  display: inline-block;
  border: 1px solid #f3f3f3;
  padding: 6px 12px;
  margin: 0 4px;
  color: #ccc;
  border-radius: 4px;
}

/* ==================== 底部 ==================== */
#footer {
  background: #1e2b3a;
  color: #b0c4de;
  padding: 40px 0 30px;
  text-align: center;
}

#footer .f p {
  margin: 8px 0;
  font-size: 14px;
}

#footer .f a {
  color: #b0c4de;
}

#footer .f a:hover {
  color: #fff;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

.slide-in {
  animation: slideIn 0.4s ease forwards;
}

/* ==================== 加载状态 ==================== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== 图片懒加载 ==================== */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

img.lazy.loaded {
  opacity: 1;
}

/* ==================== 触摸设备优化 ==================== */
@media (hover: none) and (pointer: coarse) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  a:focus {
    outline: none;
  }

  .touch-target {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  #nav, #footer, .bannerBox, .top, .MainBox {
    display: none;
  }

  body {
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  #main {
    padding: 20px 0;
  }

  #right {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
