/*
Theme Name: Gaoduan Meiya Mag
Theme URI: http://www.kxrcsx.cn
Author: 高端美牙网
Description: 杂志式图文资讯主题：封面品牌头 + 吸顶导航 + 栏目标签条 + 图文卡片流 + 侧栏榜单 + 正文阅读页。适配桌面与移动端。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: gaoduan-meiya
*/

:root {
  --ink: #14242b;
  --muted: #5a6f78;
  --line: #d5e3e7;
  --paper: #f2f7f8;
  --surface: #ffffff;
  --brand: #0f6b7a;
  --brand-deep: #083d47;
  --brand-soft: #d5eef2;
  --accent: #2f7fd1;
  --accent-soft: #d9e9f8;
  --header-h: 64px;
  --max: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --footer-bg: #e4eef0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(15, 107, 122, .08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(47, 127, 209, .07), transparent 50%),
    linear-gradient(180deg, #e8f3f5 0%, var(--paper) 28%, var(--paper) 100%);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
button, input { font: inherit; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%); white-space: nowrap;
}
.empty-tip { padding: 24px 8px; color: var(--muted); }

/* —— Brand Cover —— */
.cover {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand) 55%, #1a9aad 100%);
  color: #fff;
  padding: 28px 24px 24px;
  text-align: center;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 90%, rgba(255,255,255,.1), transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(255,255,255,.08), transparent 38%);
  pointer-events: none;
}
.cover-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  animation: rise .9s var(--ease) both;
}
.cover .cover-brand {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.25;
  text-indent: .18em;
}
.cover-slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: .24em;
  opacity: .85;
}
.cover-slogan::before,
.cover-slogan::after {
  content: "";
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,.4);
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(8, 61, 71, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  flex-shrink: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .12em;
  padding-right: 8px;
}
.nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav .menu-item > a {
  display: block;
  color: rgba(255,255,255,.82);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.nav a:hover,
.nav a.is-active,
.nav .current-menu-item > a,
.nav .current_page_item > a,
.nav .current-menu-parent > a,
.nav .current-cat > a {
  color: #fff;
  border-bottom-color: #fff;
}
.nav ul { display: flex; align-items: center; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.search-toggle,
.menu-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  transition: background .2s;
}
.search-toggle:hover,
.menu-toggle:hover { background: rgba(255,255,255,.12); }
.menu-toggle { display: none; }
.search-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  box-shadow: 0 8px 24px rgba(28, 42, 36, .08);
}
.search-panel.is-open { display: block; animation: drop .35s var(--ease); }
.search-form {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 10px;
}
.search-form input[type="search"] {
  flex: 1;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--paper);
  outline: none;
  transition: border-color .2s;
}
.search-form input[type="search"]:focus { border-color: var(--brand); }
.search-form button {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 500;
}
.search-form button:hover { background: var(--brand-deep); }

/* —— Layout —— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 20px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 16px;
}
.section-head h1,
.section-head h2 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin: 0;
}
.section-head .en {
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
}
.feed { border-top: 1px solid var(--line); }
.article-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), transform .3s var(--ease);
  animation: rise .7s var(--ease) both;
}
.article-card:nth-child(1) { animation-delay: .05s; }
.article-card:nth-child(2) { animation-delay: .1s; }
.article-card:nth-child(3) { animation-delay: .15s; }
.article-card:nth-child(4) { animation-delay: .2s; }
.article-card:nth-child(5) { animation-delay: .25s; }
.article-card:nth-child(6) { animation-delay: .3s; }
.article-card:hover {
  background: rgba(15, 107, 122, .06);
  transform: translateX(4px);
}
.thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  background: var(--brand-soft);
  display: block;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease);
}
.article-card:hover .thumb img { transform: scale(1.06); }
.thumb .tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(8, 61, 71, .88);
  color: #fff;
  border-radius: 2px;
  letter-spacing: .04em;
}
.thumb-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand-soft), #eef7f8);
}
.thumb-empty .ph-ico {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 34px;
  font-weight: 700;
  color: rgba(15, 107, 122, .35);
  letter-spacing: .1em;
}
.article-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 8px;
  letter-spacing: .02em;
}
.article-body h2 a:hover { color: var(--brand); }
.article-body .summary {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.article-meta .more {
  color: var(--brand);
  font-weight: 500;
}
.article-meta .more:hover { text-decoration: underline; }

/* —— Sidebar —— */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px 20px 16px;
  border-radius: var(--radius);
}
.widget-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.widget-head h3 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: inline;
  margin: 0 10px 0 0;
}
.widget-head span {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.rank-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.rank-list li:last-child { border-bottom: 0; }
.rank-list .cat {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-radius: 2px;
  white-space: nowrap;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-list a {
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-list a:hover { color: var(--brand); }
.rank-list .tm {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* —— 栏目标签条 —— */
.cat-strip {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 20px 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 2;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 8px 12px;
  transition: border-color .25s, background .25s, transform .25s var(--ease);
  animation: rise .6s var(--ease) both;
  text-align: center;
}
.cat-item:nth-child(1) { animation-delay: .05s; }
.cat-item:nth-child(2) { animation-delay: .08s; }
.cat-item:nth-child(3) { animation-delay: .11s; }
.cat-item:nth-child(4) { animation-delay: .14s; }
.cat-item:nth-child(5) { animation-delay: .17s; }
.cat-item:nth-child(6) { animation-delay: .2s; }
.cat-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.cat-item .ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--brand), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.cat-item strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg, #e8eee9);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.site-footer .brand-foot {
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--brand-deep);
  font-size: 16px;
  letter-spacing: .12em;
  margin-bottom: 8px;
}

.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 42, 36, .45);
  z-index: 200;
}
.drawer-backdrop.is-open { display: block; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 86vw);
  height: 100%;
  background: var(--brand-deep);
  z-index: 210;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  padding: 72px 0 24px;
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer a {
  display: block;
  color: rgba(255,255,255,.9);
  padding: 14px 28px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.drawer a:hover { background: rgba(255,255,255,.08); }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; gap: 28px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-toggle { display: grid; }
  .cover { padding: 22px 20px 20px; }
  .cover-slogan::before,
  .cover-slogan::after { width: 24px; }
  .article-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
  }
  .article-body h2 { font-size: 1rem; }
  .article-body .summary { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .thumb .tag { font-size: 10px; }
  .cat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* —— Breadcrumb / List page title —— */
.breadcrumb {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  align-items: center;
}
.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: var(--line);
}
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current="page"] span { color: var(--ink); }
.page-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 8px;
}
.archive-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 10px;
}

/* —— Pagination —— */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 28px 0 8px;
}
.pagination a,
.pagination span.ellipsis,
.pagination span.page-nav,
.pagination span.current,
.pagination .page-numbers {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  transition: all .2s;
  line-height: 1;
}
.pagination span.ellipsis {
  border: 0;
  background: transparent;
  min-width: 20px;
  padding: 0 2px;
  pointer-events: none;
}
.pagination a:hover,
.pagination span.current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* —— Article detail —— */
.article-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px 32px;
}
.article-main > h1,
.article-main article > h1 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .03em;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.contInfo {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.contInfo a { color: var(--brand); }
.article-main .content {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  word-wrap: break-word;
}
.article-main .content p { margin: 16px 0; }
.article-main .content h2,
.article-main .content h3,
.article-main .content h4 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  margin: 28px 0 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.45;
}
.article-main .content h2 { font-size: 1.35rem; }
.article-main .content h3 { font-size: 1.2rem; }
.article-main .content h4 { font-size: 1.05rem; }
.article-main .content strong,
.article-main .content b { font-weight: 700; color: var(--ink); }
.article-main .content a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.article-main .content a:hover { border-bottom-color: var(--brand); }
.article-main .content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  border-radius: var(--radius);
}
.article-main .content ul { list-style: disc; padding-left: 22px; margin: 16px 0; }
.article-main .content ol { list-style: decimal; padding-left: 22px; margin: 16px 0; }
.article-main .content li { margin: 6px 0; }
.article-main .content blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--brand);
  background: var(--paper);
  color: var(--muted);
}
.article-main .content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.article-main .content th,
.article-main .content td { border: 1px solid var(--line); padding: 8px 10px; }
.article-main .content iframe,
.article-main .content video { max-width: 100%; }
.article-main .content p[align="center"],
.article-main .content p[style*="text-align:center"],
.article-main .content p[style*="text-align: center"],
.article-main .content .img-center { text-align: center; }
.article-main .content .wp-caption { max-width: 100%; }
.article-main .content .wp-caption-text,
.article-main .content figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}
.article-main .content .aligncenter { margin-left: auto; margin-right: auto; }
.article-main .content .alignleft { float: left; margin: 8px 18px 8px 0; }
.article-main .content .alignright { float: right; margin: 8px 0 8px 18px; }

.box_page_line {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.box_page_line p { margin: 0; }
.article-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}
.article-nav span { flex: 1 1 260px; }
.article-nav a {
  color: var(--brand);
  font-weight: 500;
}
.article-nav a:hover { text-decoration: underline; }
.article-nav .nav-next { text-align: right; }

/* —— Search / 404 —— */
.search-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 80px;
  text-align: center;
}
.search-page h2 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.search-page p { color: var(--muted); line-height: 1.8; }
.search-page a { color: var(--brand); font-weight: 500; }

@media (max-width: 720px) {
  .article-main { padding: 20px 16px 24px; }
  .article-main .content { font-size: 15px; }
  .article-card:hover { transform: none; }
}
