/* portal1 — 综合门户三栏布局 */
:root {
  --portal-blue: #1d4ed8;
  --portal-blue-dark: #1e40af;
  --portal-blue-light: #dbeafe;
  --portal-text: #1e293b;
  --portal-muted: #64748b;
  --portal-border: #e2e8f0;
  --portal-bg: #f1f5f9;
  --portal-white: #ffffff;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --col-left: 200px;
  --col-right: 260px;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body.tpl-portal1 {
  font-family: var(--font-sans);
  color: var(--portal-text);
  background: var(--portal-bg);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* Top bar */
.portal-topbar {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 6px 16px;
}
.portal-topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* Header */
.portal-header {
  background: var(--portal-blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}
.portal-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.portal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  flex-shrink: 0;
}
.portal-logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.portal-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.portal-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px;
}
.portal-nav-link {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.portal-nav-link:hover,
.portal-nav-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: 0.25s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  top: 56px;
  background: var(--portal-blue-dark);
  z-index: 99;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.3s;
  overflow-y: auto;
}
.nav-mobile.open { transform: translateX(0); }
.nav-mobile ul { display: flex; flex-direction: column; gap: 4px; }
.nav-mobile a {
  display: block;
  color: #fff;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 1rem;
}
.nav-mobile a:hover { background: rgba(255,255,255,0.1); }

/* Three-column layout */
.portal-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  grid-template-columns: var(--col-left) 1fr var(--col-right);
  gap: 20px;
  align-items: start;
}

.portal-panel {
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
}
.portal-panel-title {
  background: var(--portal-blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 2px solid var(--portal-blue-dark);
}
.portal-nav-list li a,
.portal-link-list li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--portal-text);
  border-bottom: 1px solid var(--portal-border);
  transition: background 0.15s, color 0.15s;
}
.portal-nav-list li:last-child a,
.portal-link-list li:last-child a { border-bottom: none; }
.portal-nav-list li a:hover,
.portal-link-list li a:hover,
.portal-nav-list li a.active {
  background: var(--portal-blue-light);
  color: var(--portal-blue);
}

/* Center column */
.portal-featured {
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.portal-featured-img img { width: 100%; height: 100%; object-fit: cover; min-height: 200px; }
.portal-featured-body { padding: 20px; }
.portal-featured-title {
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 8px 0;
}
.portal-featured-title a:hover { color: var(--portal-blue); }
.portal-featured-summary {
  font-size: 0.9rem;
  color: var(--portal-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.portal-featured-meta { font-size: 0.8rem; color: var(--portal-muted); }

.portal-page-head {
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid var(--portal-blue);
}
.portal-page-head h1 { font-size: 1.5rem; color: var(--portal-blue); }
.portal-page-head p { font-size: 0.9rem; color: var(--portal-muted); margin-top: 4px; }

.portal-section {
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}
.portal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(90.25turn, var(--portal-blue-light), #fff);
  border-bottom: 2px solid var(--portal-blue);
}
.portal-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--portal-blue-dark);
}
.portal-section-more {
  font-size: 0.8rem;
  color: var(--portal-blue);
}
.portal-section-more:hover { text-decoration: underline; }

.portal-dense-list { padding: 8px 0; }
.portal-dense-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 16px;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--portal-border);
}
.portal-dense-list li:last-child { border-bottom: none; }
.portal-dense-list li a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portal-dense-list li a:hover { color: var(--portal-blue); }
.portal-dense-list li a::before { content: '▪'; color: var(--portal-blue); margin-right: 6px; }
.portal-dense-list time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--portal-muted);
}

.portal-news-list { padding: 8px 0; }
.portal-news-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--portal-border);
}
.portal-news-item:last-child { border-bottom: none; }
.portal-news-thumb {
  flex-shrink: 0;
  width: 120px;
  border-radius: 4px;
  overflow: hidden;
}
.portal-news-thumb img { width: 120px; height: 68px; object-fit: cover; }
.portal-news-body h3 {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 4px 0;
}
.portal-news-body h3 a:hover { color: var(--portal-blue); }
.portal-news-body p {
  font-size: 0.8rem;
  color: var(--portal-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.portal-news-meta { font-size: 0.75rem; color: var(--portal-muted); }

.portal-tag,
.portal-tag-sm {
  display: inline-block;
  background: var(--portal-blue-light);
  color: var(--portal-blue);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.portal-tag-sm { font-size: 0.65rem; }

.portal-empty { padding: 40px; text-align: center; color: var(--portal-muted); }

/* Right sidebar */
.portal-hot-list { padding: 8px 0; counter-reset: hot; }
.portal-hot-list li {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--portal-border);
  align-items: flex-start;
}
.portal-hot-list li:last-child { border-bottom: none; }
.portal-hot-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--portal-border);
  color: var(--portal-muted);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portal-hot-list li:nth-child(-n+3) .portal-hot-num {
  background: var(--portal-blue);
  color: #fff;
}
.portal-hot-list a:hover { color: var(--portal-blue); }

.portal-side-featured { display: block; padding: 12px; }
.portal-side-featured img { border-radius: 4px; margin-bottom: 8px; }
.portal-side-featured span { font-size: 0.85rem; line-height: 1.4; }
.portal-side-featured:hover span { color: var(--portal-blue); }

/* Article */
.portal-breadcrumb {
  font-size: 0.8rem;
  color: var(--portal-muted);
  margin-bottom: 16px;
  padding: 8px 0;
}
.portal-breadcrumb a:hover { color: var(--portal-blue); }

.portal-article {
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  padding: 24px;
}
.portal-article-title {
  font-size: 1.6rem;
  line-height: 1.35;
  margin: 12px 0;
}
.portal-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--portal-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--portal-border);
}
.portal-article-cover { margin: 20px 0; border-radius: 6px; overflow: hidden; }
.portal-article-body { font-size: 1rem; line-height: 1.85; }
.portal-article-body p { margin-bottom: 1em; }
.portal-article-body h2 {
  font-size: 1.2rem;
  margin: 1.5em 0 0.75em;
  color: var(--portal-blue-dark);
}
.portal-figure { margin: 1.5em 0; }
.portal-figure figcaption {
  font-size: 0.85rem;
  color: var(--portal-muted);
  text-align: center;
  margin-top: 8px;
}
.portal-article-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--portal-border);
}
.btn-back {
  display: inline-block;
  background: var(--portal-blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
}
.btn-back:hover { background: var(--portal-blue-dark); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 16px;
  border-top: 1px solid var(--portal-border);
}
.pagination-btn {
  padding: 8px 16px;
  border: 1px solid var(--portal-border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--portal-white);
}
.pagination-btn:hover { border-color: var(--portal-blue); color: var(--portal-blue); }
.pagination-btn-primary {
  background: var(--portal-blue);
  color: #fff;
  border-color: var(--portal-blue);
}
.pagination-btn-primary:hover { background: var(--portal-blue-dark); color: #fff; }
.pagination-info { font-size: 0.85rem; color: var(--portal-muted); }

/* 404 */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 40px;
}
.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--portal-white);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
}
.error-code { font-size: 5rem; font-weight: 700; color: var(--portal-blue); line-height: 1; }
.error-title { font-size: 1.5rem; margin: 16px 0 8px; }
.error-desc { color: var(--portal-muted); margin-bottom: 24px; }

/* Footer */
.portal-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: auto;
}
.portal-footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.portal-footer-brand strong { color: #fff; font-size: 1.1rem; }
.portal-footer-brand p { margin-top: 8px; font-size: 0.85rem; line-height: 1.6; }
.portal-footer-col h4 { color: #fff; font-size: 0.9rem; margin-bottom: 12px; }
.portal-footer-col li { margin-bottom: 6px; }
.portal-footer-col a { font-size: 0.85rem; }
.portal-footer-col a:hover { color: #fff; }
.portal-footer-bottom {
  border-top: 1px solid #1e293b;
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
}
.portal-footer-bottom a { color: #cbd5e1; }
.portal-footer-bottom a:hover { color: #fff; }

/* Responsive */
@media (max-width: 1024px) {
  .portal-layout {
    grid-template-columns: 1fr var(--col-right);
  }
  .portal-col-left { display: none; }
}

@media (max-width: 768px) {
  .portal-nav { display: none; }
  .menu-toggle { display: flex; }
  .nav-mobile { display: block; }

  .portal-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .portal-col-right { order: 3; }
  .portal-featured { grid-template-columns: 1fr; }
  .portal-news-item { flex-direction: column; }
  .portal-news-thumb { width: 100%; }
  .portal-news-thumb img { width: 100%; height: auto; aspect-ratio: 16/9; }
  .portal-footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .portal-article { padding: 16px; }
  .portal-article-title { font-size: 1.3rem; }
}
