/* ==========================================================================
   WordPress DUX Theme Simulation Stylesheet
   ========================================================================== */

/* Variables */
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --bg-color: #f6f6f6;
  --text-main: #333333;
  --text-muted: #777777;
  --border-color: #eaeaea;
  --card-bg: #ffffff;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--primary-color);
}

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

/* Header & Nav */
.header-wrap {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 70px;
}

.logo-section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #1a4fa0;
}

.logo-link img {
  height: 38px;
  margin-right: 8px;
  border-radius: 4px;
}

.logo-divider {
  border-left: 1px solid #e2e8f0;
  height: 28px;
  margin: 0 15px;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-links li {
  margin-left: 20px;
  position: relative;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  padding: 8px 4px;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

/* Header Search Styles */
.header-search-container {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 4px 12px;
  margin-left: 10px;
}

.header-search-container input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #374151;
  width: 120px;
  transition: width 0.25s ease;
}

.header-search-container input:focus {
  width: 170px;
}

.header-search-container button {
  border: none;
  background: transparent;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  padding-left: 5px;
  outline: none;
}

/* Layout Grid */
.main-wrapper {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 8fr 3.5fr;
  gap: 20px;
}

/* Main Content Column */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* Sidebar Column */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
}

/* Sidebar TOC styles */
.toc-container {
  list-style: none;
}

.toc-container li {
  margin-bottom: 8px;
}

.toc-link {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all 0.2s ease;
}

.toc-link.active {
  color: var(--primary-color) !important;
  font-weight: bold;
  border-left-color: var(--primary-color);
  padding-left: 12px;
}

.toc-link.toc-h3 {
  padding-left: 20px;
}

.toc-link.toc-h3.active {
  padding-left: 22px;
}

/* Sidebar lists */
.widget-posts-list {
  list-style: none;
}

.widget-posts-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

.widget-posts-list li:last-child {
  border-bottom: none;
}

.widget-posts-list a {
  color: #333;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
  max-width: 220px;
}

.widget-posts-list .post-date {
  color: #bbb;
  font-size: 12px;
  flex-shrink: 0;
}

/* Card Promos */
.card-promo {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 22px 20px;
  margin-bottom: 15px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card-promo-tag {
  position: absolute;
  top: -1px;
  left: 20px;
  font-size: 11px;
  color: #fff;
  padding: 2px 10px;
  border-radius: 0 0 3px 3px;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-purple {
  background: #a855f7;
}

.tag-orange {
  background: #ff5722;
}

.card-promo-title {
  font-size: 18px;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 8px;
}

.card-promo-title a {
  color: #3b82f6;
  text-decoration: underline;
}

.card-promo-title.hot-title {
  color: #ff5722;
}

.card-promo-desc {
  font-size: 13.5px;
  color: #666;
  line-height: 1.6;
}

/* Tag cloud styles */
.widget-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 10px;
}

.widget-tags-cloud li {
  margin: 0;
}

.widget-tags-cloud a {
  display: inline-block;
  padding: 5px 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 12px;
  color: #4b5563;
  transition: all 0.2s ease;
}

.widget-tags-cloud a:hover {
  background: var(--primary-color);
  color: #fff !important;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

/* Post tags container */
.post-tags-container {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-tags-label {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: bold;
  margin-right: 5px;
}

.post-tag-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 3px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.post-tag-badge:hover {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

/* Basic Info Summary Box */
.info-summary-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 18px;
  margin: 25px 0;
  color: #1f2937;
}

.info-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

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

.info-summary-label {
  font-weight: bold;
  color: #4b5563;
}

.info-summary-value {
  color: #111827;
  text-align: right;
  font-weight: 500;
}

.info-summary-value a {
  color: #007bff !important;
  text-decoration: underline;
}

/* Plans Table Styles */
.plans-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
}

.plans-table th, .plans-table td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: left;
}

.plans-table th {
  background: #f8fafc;
  font-weight: bold;
  color: #1e293b;
}

.plans-table tr:hover {
  background: #fafafa;
}

/* Related Posts Grid (1排4个, 一共3行, 填满 12 个) */
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
  list-style: none;
}

.related-posts-grid li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-posts-grid a {
  display: block;
  font-size: 13px;
  color: #007bff;
  line-height: 1.5;
  text-decoration: underline;
}

.related-posts-grid a:hover {
  color: var(--primary-hover);
}

/* Advantages list */
.advantages-list h3 {
  font-size: 15.5px !important;
  color: #1f2937;
  margin: 18px 0 6px 0 !important;
}

.advantages-list p {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
}

/* Article Page Styling */
.article-header {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.article-content h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 35px 0 18px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: #111;
  position: relative;
  scroll-margin-top: 90px;
}

.article-content h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary-color);
}

.article-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 25px 0 12px 0;
  color: #222;
  scroll-margin-top: 90px;
}

.article-content p {
  margin-bottom: 18px;
  color: #444;
  text-align: justify;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.article-content th, .article-content td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: left;
}

.article-content th {
  background-color: #fcfcfc;
  font-weight: 700;
}

.article-content ul, .article-content ol {
  margin: 0 0 18px 20px;
  color: #444;
}

.article-content li {
  margin-bottom: 6px;
}

.article-content blockquote {
  padding: 15px 20px;
  margin: 20px 0;
  border-left: 4px solid var(--primary-color);
  background-color: #f9f9f9;
  color: #555;
  font-style: italic;
  font-size: 14.5px;
}

/* Buttons and Blocks */
.promo-box {
  text-align: center;
  margin: 35px 0;
}

.promo-btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--primary-color);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  transition: all 0.2s ease-in-out;
}

.promo-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* DUX Style Homepage Grid */
.home-article-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.home-article-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  gap: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-article-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.item-thumb {
  width: 140px;
  height: 95px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.item-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.item-excerpt {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Footer */
.footer {
  background: #2a2a2a;
  color: #bbb;
  padding: 35px 20px;
  margin-top: 40px;
  border-top: 1px solid #1a1a1a;
  font-size: 13.5px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer p {
  line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 900px) {
  .main-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    height: auto;
    flex-direction: column;
    padding: 12px 15px;
    gap: 10px;
  }
  .logo-divider {
    display: none;
  }
  .logo-subtitle {
    display: none;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links li {
    margin: 4px 10px;
  }
  .nav-links a {
    font-size: 14px;
  }
  .nav-links a.active::after {
    display: none;
  }
  .header-search-container {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
  .header-search-container input {
    width: 100%;
  }
  .header-search-container input:focus {
    width: 100%;
  }
  .main-wrapper {
    margin: 10px auto;
    padding: 0 10px;
  }
  .content-card {
    padding: 20px 15px;
  }
  .article-header h1 {
    font-size: 20px;
  }
  .article-content h2 {
    font-size: 17px;
    margin: 25px 0 12px 0;
  }
  .article-content h3 {
    font-size: 15px;
    margin: 20px 0 10px 0;
  }
  .sidebar {
    display: none !important;
  }
  .home-article-item {
    flex-direction: column;
    padding: 15px;
    gap: 12px;
  }
  .item-thumb {
    width: 100%;
    height: 140px;
  }
  .promo-btn {
    width: 100%;
    padding: 15px;
  }
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
