/*
Theme Name: SunZone
Description: 孙越AI 门户主题，参考 GridZone 风格的卡片瀑布流布局
Version: 1.0
Author: SunyueAI
Text Domain: sunzone
*/

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #444;
  --title: #222;
  --muted: #999;
  --accent: #2563eb;
  --border: #e5e5e5;
  --shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.10);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--title); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ===== Header ===== */
#header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 99;
  transition: transform 0.25s ease;
}
#header.hide { transform: translateY(-100%); }
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}
.site-branding { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.site-title { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: 0.5px; }
.site-title a { color: var(--title); }
.site-title a b { color: var(--accent); }
.site-description { font-size: 13px; color: var(--muted); margin: 0; }

.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 20px 10px;
  font-size: 15px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--accent); }

.header-search form { display: flex; }
.header-search input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 20px 0 0 20px;
  padding: 7px 14px;
  font-size: 14px;
  outline: none;
  width: 150px;
  transition: width 0.2s;
}
.header-search input[type="search"]:focus { width: 200px; border-color: var(--accent); }
.header-search button {
  border: 1px solid var(--border);
  border-left: 0;
  background: #fafafa;
  border-radius: 0 20px 20px 0;
  padding: 7px 14px;
  cursor: pointer;
  color: #777;
}

.menu-toggle { display: none; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);
  color: #fff;
  text-align: center;
  padding: 44px 20px 48px;
}
.hero h1 { font-size: 30px; margin: 0 0 10px; font-weight: 700; }
.hero p { color: rgba(255, 255, 255, 0.85); margin: 0 auto 22px; max-width: 640px; font-size: 15px; }
.hero .btn {
  display: inline-block;
  background: #ff0033;
  color: #fff;
  padding: 10px 26px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.hero .btn:hover { background: #d90029; color: #fff; transform: translateY(-2px); }
.hero .btn.ghost { background: rgba(255, 255, 255, 0.14); margin-left: 12px; }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.25); }

/* ===== Grid ===== */
.main-wrap { max-width: 1400px; margin: 0 auto; padding: 12px 12px 40px; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--title);
  margin: 26px 8px 4px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.card-grid { display: flex; flex-wrap: wrap; }
.masonry-item { width: 25%; padding: 12px; }
.masonry-inner {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease-in;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.masonry-inner:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.entry-thumbnail { display: block; position: relative; aspect-ratio: 16/9; background: #e8ecf3; overflow: hidden; }
.entry-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.masonry-inner:hover .entry-thumbnail img { transform: scale(1.04); }
.entry-category { position: absolute; left: 10px; bottom: 10px; }
.entry-category a {
  background: rgba(0, 0, 0, 0.6);
  color: #eee;
  font-size: 12px;
  display: inline-block;
  padding: 3px 11px;
  border-radius: 10px;
  margin-right: 4px;
}
.entry-category a:hover { background: var(--accent); color: #fff; }
.play-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.card-body { padding: 14px 18px 0; flex: 1; }
.entry-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}
.entry-meta {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 18px 14px;
  display: flex;
  gap: 14px;
}

/* ===== Pagination ===== */
.pagination { text-align: center; margin: 30px 0 10px; }
.pagination .page-numbers {
  display: inline-block;
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px 15px;
  margin: 0 4px;
  font-size: 14px;
  color: #555;
}
.pagination .current, .pagination a:hover { background: var(--accent); color: #fff; }

/* ===== Single ===== */
.single-wrap { max-width: 900px; margin: 24px auto 50px; padding: 0 16px; }
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 48px;
}
.post-header .entry-category-line { margin-bottom: 12px; }
.post-header .entry-category-line a {
  background: #eef2ff;
  color: var(--accent);
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 12px;
  margin-right: 6px;
}
.post-title { font-size: 28px; line-height: 1.45; color: var(--title); margin: 0 0 14px; }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 26px; display: flex; gap: 18px; flex-wrap: wrap; }

.entry-content { font-size: 16px; line-height: 1.9; color: #3a3a3a; }
.entry-content h2 {
  font-size: 21px;
  color: var(--title);
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.entry-content h3 { font-size: 18px; color: var(--title); margin: 28px 0 10px; }
.entry-content p { margin: 0 0 16px; }
.entry-content ul, .entry-content ol { padding-left: 24px; margin: 0 0 16px; }
.entry-content li { margin-bottom: 8px; }
.entry-content a { color: var(--accent); }
.entry-content iframe { border-radius: 8px; }
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

.tag-list { margin-top: 28px; }
.tag-list a {
  display: inline-block;
  background: #f0f2f5;
  color: #666;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 14px;
  margin: 0 8px 8px 0;
}
.tag-list a:hover { background: var(--accent); color: #fff; }

.post-nav { display: flex; gap: 16px; margin-top: 26px; }
.post-nav > div {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  font-size: 14px;
}
.post-nav .nav-label { color: var(--muted); font-size: 12px; display: block; margin-bottom: 4px; }
.post-nav .next { text-align: right; }

.related-title { font-size: 19px; font-weight: 700; color: var(--title); margin: 40px 8px 2px; padding-left: 12px; border-left: 4px solid var(--accent); }

/* ===== Archive header ===== */
.archive-header { max-width: 1400px; margin: 26px auto 0; padding: 0 20px; }
.archive-header h1 { font-size: 24px; color: var(--title); margin: 0; }
.archive-header p { color: var(--muted); margin: 6px 0 0; }

/* ===== Breadcrumbs & TOC ===== */
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 0 4px 14px; }
.breadcrumbs a { color: #777; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; color: #ccc; }
.breadcrumbs em { font-style: normal; color: #aaa; }

.toc-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 24px;
  margin: 0 0 24px;
  font-size: 14px;
}
.toc-title { font-weight: 700; color: var(--title); margin-bottom: 8px; }
.toc-box ol { margin: 0; padding-left: 20px; }
.toc-box li { margin: 5px 0; }
.toc-box li.toc-sub { margin-left: 18px; list-style-type: circle; }
.toc-box a { color: #555; }
.toc-box a:hover { color: var(--accent); }
.entry-content h2, .entry-content h3 { scroll-margin-top: 80px; }

/* ===== Comments ===== */
.comments-area { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--border); }
.comments-area input, .comments-area textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.comments-area .submit {
  width: auto;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 28px;
  border-radius: 20px;
  cursor: pointer;
}
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--border); padding: 14px 0; }

/* ===== About / SEO section ===== */
.about-site {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 40px;
  margin: 36px 12px 10px;
  font-size: 15px;
  line-height: 1.85;
  color: #555;
}
.about-site h2 {
  font-size: 19px;
  color: var(--title);
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}
.about-site h2 + p { margin-top: 0; }
.about-site h2:not(:first-child) { margin-top: 26px; }
.about-site h3 { font-size: 15.5px; color: var(--title); margin: 16px 0 4px; }
.about-site p { margin: 0 0 10px; }
.about-site a { color: var(--accent); }

/* ===== Footer ===== */
#footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 30px;
  padding: 28px 20px 34px;
  text-align: center;
  color: #888;
  font-size: 14px;
}
#footer a { color: #666; margin: 0 10px; }
#footer a:hover { color: var(--accent); }
#footer .foot-links { margin-bottom: 10px; }
.foot-cols {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  text-align: left;
  max-width: 900px;
  margin: 0 auto 22px;
}
.foot-col { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.foot-col a { margin: 0; font-size: 13.5px; }
.foot-title { font-weight: 700; color: #333; margin-bottom: 4px; font-size: 14px; }
.foot-bottom { border-top: 1px solid var(--border); padding-top: 16px; }
.foot-bottom a { margin: 0; }

/* 导航里的官网入口按钮 */
.main-nav a[href*="xauusd.team"] {
  background: var(--accent);
  color: #fff !important;
  border-radius: 999px;
  padding: 7px 14px;
  margin: 13px 0 13px 6px;
}
.main-nav a[href*="xauusd.team"]:hover { opacity: .85; }

@media (max-width: 1300px) and (min-width: 769px) {
  .site-description { display: none; }
  .header-search input[type="search"] { width: 110px; }
  .main-nav a { padding: 20px 8px; font-size: 14px; }
}

/* ===== Responsive ===== */
@media (max-width: 1200px) { .masonry-item { width: 33.333%; } }
@media (max-width: 900px)  { .masonry-item { width: 50%; } }
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .menu-toggle {
    display: block;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    color: #555;
  }
  .main-nav { display: none; flex-basis: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 12px 6px; border-top: 1px solid #f0f0f0; }
  .main-nav a[href*="xauusd.team"] { display: inline-block; margin: 10px 0 4px; border-top: 0; }
  .foot-cols { gap: 28px; }
  .header-search { flex-basis: 100%; padding-bottom: 10px; }
  .header-search input[type="search"] { width: 100%; flex: 1; }
  .hero h1 { font-size: 22px; }
  .post-card { padding: 24px 20px; }
  .post-title { font-size: 22px; }
}
@media (max-width: 560px) { .masonry-item { width: 100%; } }
