/*
Theme Name: 神州学校
Theme URI: https://example.com/shenzhou-school
Description: 神州学校官方门户网站 WordPress 主题，复刻自 Vue 3 + PHP 版本。
Author: ShenzhouDev
Version: 1.0.0
Text Domain: shenzhou-school
*/

/* ===== WordPress Reset - 对抗 WP 默认样式覆盖 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; height: 100%; }

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 重置 WordPress 默认标题/段落/列表/图块样式，与原版 Vue 全局重置一致 */
h1, h2, h3, h4, h5, h6 { margin: 0; padding: 0; font-size: inherit; font-weight: normal; }
p { margin: 0; padding: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
figcaption { margin: 0; }
blockquote { margin: 0; padding: 0; border: none; }
pre { margin: 0; }
table { border-collapse: collapse; border-spacing: 0; }
.entry-content p, .wp-block-columns { margin: 0; padding: 0; }

a { text-decoration: none; color: inherit; transition: color 0.3s; }
a:hover { color: #c00; }

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

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* 重置 WordPress 块库和 admin bar */
.wp-block { max-width: 100%; margin-left: 0; margin-right: 0; }
.wp-block-group { padding: 0; }
.wp-block-columns { margin: 0; }
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* ===== Layout ===== */
.sw-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.sw-header {
  background: #fff;
  position: relative;
  z-index: 100;
  width: 100%;
}

.sw-header-top {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

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

.sw-logo h1 {
  font-size: 28px;
  color: #17509D;
  font-weight: bold;
}

.sw-header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.sw-header-date { color: #666; font-size: 14px; }

.sw-header-icons { display: flex; gap: 15px; align-items: center; }

.sw-icon-item {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}
.sw-icon-item:hover { transform: translateY(-3px); }

.sw-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
  min-width: 180px;
  z-index: 1000;
}
.sw-icon-item:hover .sw-dropdown { display: block; }
.sw-dropdown p { margin: 5px 0; color: #666; }
.sw-dropdown .sw-phone-num { font-size: 18px; color: #515151; font-weight: bold; font-family: Arial, sans-serif; }
.sw-dropdown img { max-width: 128px; height: auto; }

/* ===== Main Nav ===== */
.sw-main-nav { background: #17509D; }

.sw-nav-list {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.sw-nav-item { position: relative; margin: 0 2px; }

.sw-nav-item > a {
  display: block;
  padding: 15px 25px;
  color: #fff;
  font-size: 16px;
  transition: background 0.3s;
}
.sw-nav-item > a:hover,
.sw-nav-item > a.active {
  background: rgba(255,255,255,0.2);
}

.sw-sub-nav {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 150px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
  list-style: none;
  padding: 10px 0;
}
.sw-nav-item:hover .sw-sub-nav { display: block; }
.sw-sub-nav a {
  display: block;
  padding: 10px 20px;
  color: #333;
  font-size: 14px;
  transition: all 0.3s;
}
.sw-sub-nav a:hover { background: #f5f5f5; color: #17509D; }

/* ===== Footer ===== */
.sw-footer {
  background: #2c2c2c;
  color: #fff;
  margin-top: 40px;
}

.sw-footer-top {
  padding: 30px 0;
  border-bottom: 1px solid #444;
}

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

.sw-footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 0;
}
.sw-footer-nav a { color: #ccc; font-size: 14px; transition: color 0.3s; }
.sw-footer-nav a:hover { color: #fff; }

.sw-footer-contact { text-align: right; }
.sw-footer-contact .sw-footer-phone { font-size: 24px; color: #c00; font-weight: bold; margin-bottom: 5px; font-family: Arial, sans-serif; }
.sw-footer-contact .sw-footer-icp { font-size: 12px; color: #999; }

.sw-footer-bottom { padding: 20px 0; }
.sw-footer-bottom .sw-container { flex-direction: column; gap: 15px; }

.sw-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 20px;
}
.sw-footer-links a { color: #ccc; font-size: 14px; transition: color 0.3s; }
.sw-footer-links a:hover { color: #fff; }

.sw-social-links { display: flex; gap: 20px; flex-wrap: wrap; }
.sw-social-links a {
  color: #999;
  font-size: 12px;
  transition: color 0.3s;
  padding: 5px 10px;
  border: 1px solid #666;
  border-radius: 3px;
}
.sw-social-links a:hover { color: #fff; border-color: #fff; }

.sw-copyright { text-align: center; width: 100%; }
.sw-copyright p { font-size: 12px; color: #999; }

/* ===== Main Content Wrapper ===== */
.sw-main-content {
  display: flex;
  flex-direction: column;
}

/* ===== Homepage: Banner ===== */
.sw-banner-section {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.sw-banner-slider { position: relative; width: 100%; height: 500px; }

.sw-banner-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1s ease-in-out;
}
.sw-banner-slide.active { opacity: 1; z-index: 1; pointer-events: auto; }
.sw-banner-slide a { display: block; width: 100%; height: 100%; }
.sw-banner-slide img { width: 100%; height: 100%; object-fit: cover; }

.sw-banner-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.sw-banner-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}
.sw-banner-dots span.active { background: #fff; }

/* ===== Homepage: News Grid ===== */
.sw-site-news { padding: 40px 0; background: #f8f8f8; }
.sw-news-grid { display: flex; gap: 30px; }

.sw-president-message { flex: 0 0 41.66%; padding: 20px; }
.sw-campus-news { flex: 0 0 58.33%; padding: 20px; }

.sw-section-header { margin-bottom: 20px; text-align: left; }
.sw-section-header .en-title {
  display: block; font-size: 18px; color: #999;
  font-weight: normal; letter-spacing: 1px; margin-bottom: 5px;
}
.sw-section-header .cn-title {
  font-size: 24px; color: #333; font-weight: bold; margin: 0;
}
.sw-section-header a { text-decoration: none; }

.sw-message-content { display: flex; gap: 20px; min-height: 370px; }
.sw-message-image { width: 200px; height: 250px; object-fit: cover; flex-shrink: 0; }
.sw-message-text { flex: 1; }
.sw-message-text p {
  font-size: 14px; line-height: 1.8; color: #666;
  text-indent: 2em; margin-bottom: 15px;
  display: -webkit-box; -webkit-line-clamp: 10;
  -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
}
.sw-more-link { color: #17509D; font-size: 14px; }
.sw-more-link:hover { text-decoration: underline; }

.sw-news-content { display: flex; flex-direction: column; gap: 20px; }

.sw-news-list-large { border-top: 2px solid #17509D; }
.sw-news-list-large li { padding: 12px 0; border-bottom: 1px dashed #ddd; }
.sw-news-list-large time { display: inline-block; color: #999; font-size: 12px; margin-right: 10px; }
.sw-news-list-large a { color: #333; font-size: 16px; transition: color 0.3s; }
.sw-news-list-large a:hover { color: #17509D; }
.sw-news-list-large p { color: #666; font-size: 14px; margin: 8px 0 0 0; line-height: 1.6; }

.sw-news-list-small { border-top: 2px solid #17509D; }
.sw-news-list-small li { padding: 10px 0; border-bottom: 1px dashed #ddd; display: flex; align-items: center; }
.sw-news-list-small time { color: #999; font-size: 12px; margin-right: 10px; flex-shrink: 0; }
.sw-news-list-small a { color: #666; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.3s; display: block; }
.sw-news-list-small a:hover { color: #17509D; }

/* ===== Homepage: Info Cards ===== */
.sw-site-info { padding: 40px 0; }
.sw-site-info .sw-container { display: flex; gap: 20px; }

.sw-info-card { flex: 1; min-width: 0; padding: 20px; background: #fff; }
.sw-info-top { position: relative; overflow: hidden; }
.sw-info-top a { display: block; }
.sw-info-title { margin-bottom: 12px; }
.sw-info-title .en-title { font-size: 14px; color: #999; display: block; margin-bottom: 5px; }
.sw-info-title h2 { font-size: 24px; color: #333; margin: 0; }
.sw-info-top img {
  display: block; width: 100%; height: 150px;
  object-fit: cover; transition: transform 0.3s;
}
.sw-info-top a:hover img { transform: scale(1.05); }

.sw-info-list { padding: 15px 0 0 0; }
.sw-info-list li { padding: 8px 0; border-bottom: 1px dashed #eee; overflow: hidden; }
.sw-info-list a {
  color: #666; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block; transition: color 0.3s;
}
.sw-info-list a:hover { color: #17509D; }

/* ===== Homepage: Middle Link Section ===== */
.sw-site-middle { padding: 40px 0; background: #f8f8f8; }
.sw-middle-grid { display: flex; gap: 30px; }
.sw-mid-card { flex: 1; position: relative; overflow: hidden; }
.sw-mid-link { display: block; position: relative; }
.sw-mid-link img { width: 100%; height: 150px; object-fit: cover; transition: transform 0.3s; }
.sw-mid-link:hover img { transform: scale(1.05); }
.sw-mid-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center; color: #fff; z-index: 2;
}
.sw-mid-overlay h4 { font-size: 14px; font-weight: normal; margin-bottom: 10px; color: rgba(255,255,255,0.9); }
.sw-mid-overlay h2 { font-size: 28px; margin: 0; }

/* ===== Category Page ===== */
.sw-breadcrumb { background: #f5f5f5; padding: 15px 0; border-bottom: 1px solid #eee; }
.sw-breadcrumb span, .sw-breadcrumb a { font-size: 14px; color: #666; }
.sw-breadcrumb a { color: #17509D; }
.sw-breadcrumb a:hover { text-decoration: underline; }
.sw-breadcrumb .separator { margin: 0 8px; color: #999; }

.sw-page-content { padding: 30px 0; min-height: 400px; }

.sw-tabs-nav { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #17509D; }
.sw-tab-item {
  padding: 12px 24px; border: none; background: #f5f5f5;
  cursor: pointer; font-size: 16px; transition: all 0.3s;
  border-radius: 4px 4px 0 0;
}
.sw-tab-item:hover { background: #e8e8e8; }
.sw-tab-item.active { background: #17509D; color: #fff; }

.sw-article-stats { margin-bottom: 20px; padding: 10px 0; }
.sw-article-stats span { font-size: 14px; color: #666; }

/* Text list */
.sw-article-list .sw-article-item {
  display: block; padding: 25px 15px;
  border-bottom: 1px solid #eee; transition: all 0.3s; cursor: pointer;
}
.sw-article-list .sw-article-item:hover {
  background: #f5f8fc; transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(23,80,157,0.08);
}
.sw-article-list .sw-article-item h3 { font-size: 20px; margin-bottom: 10px; color: #333; transition: color 0.3s; }
.sw-article-list .sw-article-item:hover h3 { color: #17509D; }
.sw-article-list .sw-article-item p { color: #666; font-size: 15px; line-height: 1.8; margin: 0 0 10px 0; }
.sw-article-list .sw-article-item time { color: #999; font-size: 14px; display: block; }

/* Grid list */
.sw-article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sw-grid-card {
  position: relative; display: block; overflow: hidden;
  border-radius: 6px; aspect-ratio: 4 / 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); transition: box-shadow 0.3s;
}
.sw-grid-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.sw-grid-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.sw-grid-card:hover img { transform: scale(1.06); }
.sw-grid-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 15px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.sw-grid-card-title {
  display: block; color: #fff; font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px;
}
.sw-grid-card-overlay time { color: rgba(255,255,255,0.8); font-size: 12px; display: block; }

/* Pagination */
.sw-pagination { margin-top: 40px; display: flex; justify-content: center; align-items: center; gap: 15px; }
.sw-page-btn {
  padding: 8px 20px; border: 1px solid #ddd; background: #fff;
  cursor: pointer; font-size: 14px; border-radius: 4px; transition: all 0.3s;
}
.sw-page-btn:hover:not(:disabled) { background: #17509D; color: #fff; border-color: #17509D; }
.sw-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sw-page-numbers { display: flex; gap: 5px; }
.sw-page-num {
  width: 36px; height: 36px; border: 1px solid #ddd; background: #fff;
  cursor: pointer; font-size: 14px; border-radius: 4px; transition: all 0.3s;
}
.sw-page-num:hover { background: #f5f5f5; }
.sw-page-num.active { background: #17509D; color: #fff; border-color: #17509D; }

/* ===== Single Article ===== */
.sw-article-detail { padding: 50px 0; min-height: 600px; }
.sw-article-detail .sw-container { max-width: 1000px; }

.sw-article-title { font-size: 32px; color: #333; text-align: center; margin-bottom: 20px; line-height: 1.4; }

.sw-article-meta { text-align: center; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.sw-article-meta time { color: #999; font-size: 14px; margin-right: 20px; }
.sw-article-meta .sw-cat-name { color: #c00; font-size: 14px; }

.sw-article-body { font-size: 16px; line-height: 1.8; color: #333; }
.sw-article-body p { margin-bottom: 20px; text-indent: 2em; }
.sw-article-body img { max-width: 100%; height: auto; margin: 20px 0; }

.sw-article-nav {
  margin-top: 50px; padding-top: 30px;
  border-top: 1px solid #eee;
  display: flex; justify-content: space-between; gap: 20px;
}
.sw-nav-prev, .sw-nav-next {
  flex: 1; padding: 20px; background: #f9f9f9;
  transition: background 0.3s; border-radius: 4px;
}
.sw-nav-prev:hover, .sw-nav-next:hover { background: #f0f0f0; }
.sw-nav-disabled { opacity: 0.5; cursor: not-allowed; }
.sw-nav-disabled:hover { background: #f9f9f9; }
.sw-nav-prev { text-align: left; }
.sw-nav-next { text-align: right; }
.sw-nav-prev span, .sw-nav-next span { display: block; color: #999; font-size: 14px; margin-bottom: 8px; }
.sw-nav-prev p, .sw-nav-next p {
  color: #333; font-size: 16px; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sw-empty-state { text-align: center; padding: 100px 0; color: #999; font-size: 16px; }
.sw-loading { text-align: center; padding: 100px 0; color: #999; font-size: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sw-header-top .sw-container { flex-direction: column; gap: 15px; }
  .sw-header-right { flex-direction: column; gap: 10px; }
  .sw-nav-list { flex-wrap: wrap; }
  .sw-nav-item > a { padding: 12px 15px; font-size: 14px; }

  .sw-news-grid { flex-direction: column; }
  .sw-president-message, .sw-campus-news { flex: 1; }
  .sw-message-content { flex-direction: column; min-height: auto; }
  .sw-message-image { width: 100%; height: 200px; }

  .sw-site-info .sw-container { flex-direction: column; }
  .sw-middle-grid { flex-direction: column; }
  .sw-banner-slider { height: 300px; }

  .sw-article-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .sw-footer-top .sw-container { flex-direction: column; gap: 20px; }
  .sw-footer-nav ul { justify-content: center; }
  .sw-footer-contact { text-align: center; }
  .sw-footer-links { flex-direction: column; text-align: center; }
  .sw-social-links { justify-content: center; }
}

.sw-logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.sw-logo-text {
  font-size: 28px;
  color: #17509D;
  font-weight: bold;
}

@media (max-width: 768px) {
  .sw-logo-img {
    height: 36px;
  }
  .sw-logo-text {
    font-size: 18px;
  }
}

/* ===== Logo Image ===== */
.sw-logo a {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 12px;
  text-decoration: none;
}

.sw-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.sw-logo-text {
  font-size: 24px;
  color: #17509D;
  font-weight: bold;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .sw-logo-img {
    height: 32px;
  }
  .sw-logo-text {
    font-size: 16px;
  }
}
