/* ===================================================================
 * World Gafei - Coffee Review Theme  (v20260827)
 * Inspired by gcrmag.com (jnews magazine layout) - Restyled with
 * a warm "espresso + cream" palette for World Gafei brand.
 * Keep all xunruicms template tags intact; only CSS is changed.
 * =================================================================== */

/* ---- 1. Design Tokens (CSS variables) ---- */
:root {
  /* Brand palette - coffee inspired */
  --c-bg:           #faf6f0;   /* page background (cream) */
  --c-surface:      #ffffff;   /* card / panel background */
  --c-surface-alt:  #f3ece1;   /* alt surface (warm sand) */
  --c-ink:          #2a2118;   /* primary text (espresso) */
  --c-ink-soft:     #5c5045;   /* secondary text */
  --c-ink-mute:     #8a7e6f;   /* tertiary / meta text */
  --c-line:         #e8dfd3;   /* hairline */
  --c-line-soft:    #f0e9de;   /* softer hairline */

  --c-primary:      #6b4423;   /* main brand (dark roast) */
  --c-primary-700:  #4f3019;   /* hover / dark */
  --c-primary-100:  #f3e9dc;   /* tinted surface */
  --c-accent:       #a0352a;   /* accent (cherry red) */
  --c-accent-700:   #7d2820;
  --c-gold:         #b8845f;   /* warm gold */
  --c-leaf:         #4a6741;   /* muted leaf green for tags */
  --c-dark:         #1a140d;   /* deep header / dark surface */

  /* Typography */
  --ff-sans: "Inter", "Source Sans Pro", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ff-serif: "Source Serif Pro", "Playfair Display", "Georgia", "Songti SC", serif;
  --ff-mono: "JetBrains Mono", "Menlo", Consolas, monospace;

  /* Layout */
  --container-w: 1200px;
  --gutter: 20px;
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(42, 33, 24, 0.05);
  --shadow:    0 4px 18px rgba(42, 33, 24, 0.08);
  --shadow-lg: 0 10px 40px rgba(42, 33, 24, 0.12);

  --tr-fast: 150ms ease;
  --tr:      280ms cubic-bezier(.4, 0, .2, 1);
}

/* ---- 2. Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font: 15px/1.7 var(--ff-sans);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-width: 320px;
}
img { border: 0; max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
a { color: var(--c-ink); text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--c-primary); }
h1, h2, h3, h4, h5, h6 { font-family: var(--ff-serif); font-weight: 700; line-height: 1.3; color: var(--c-ink); }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
em, i { font-style: normal; }
span { display: inline; }
strong, b { font-weight: 600; }

/* ---- 3. Layout helpers ---- */
.container { width: 100%; max-width: var(--container-w); margin: 0 auto; padding: 0 var(--gutter); }
.box, article { width: 100%; max-width: var(--container-w); margin: 0 auto; overflow: visible; }
.clear { clear: both; width: 100%; height: 0; overflow: hidden; }
.blank { clear: both; width: 100%; height: 24px; overflow: hidden; }
.fl { float: left; } .fr { float: right; }

/* Top utility bar above the masthead */
.topbar {
  background: var(--c-dark);
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 8px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.topbar a { color: rgba(255, 255, 255, .85); }
.topbar a:hover { color: #fff; }
.topbar-meta { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar-meta .dot { color: var(--c-gold); margin: 0 4px; }

/* ---- 4. Header / masthead ---- */
header { background: var(--c-surface); border-bottom: 1px solid var(--c-line); position: relative; z-index: 9; }
header.is-sticky { position: sticky; top: 0; box-shadow: var(--shadow-sm); }

.masthead { padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.masthead .logo { display: flex; align-items: center; gap: 14px; }
.masthead .logo a { display: flex; align-items: center; gap: 14px; }
.masthead .logo img { height: 56px; width: auto; }
.masthead .logo-text { line-height: 1.2; }
.masthead .logo-title {
  font-family: var(--ff-serif);
  font-size: 28px;
  color: var(--c-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.masthead .logo-sub { color: var(--c-ink-soft); font-size: 13px; margin-top: 2px; }

/* Search box */
.masthead .search { display: flex; align-items: stretch; width: 360px; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; background: var(--c-surface-alt); transition: border-color var(--tr), background var(--tr); }
.masthead .search:focus-within { border-color: var(--c-primary); background: #fff; }
.masthead .search input.input_text { flex: 1; border: 0; background: transparent; padding: 0 16px; line-height: 44px; outline: none; font-size: 14px; color: var(--c-ink); }
.masthead .search input.input_text::placeholder { color: var(--c-ink-mute); }
.masthead .search input.input_submit { width: 56px; border: 0; background: var(--c-primary); color: #fff; font-weight: 600; letter-spacing: .05em; cursor: pointer; transition: background var(--tr-fast); }
.masthead .search input.input_submit:hover { background: var(--c-primary-700); }

/* Primary navigation */
.topnav { background: var(--c-primary); }
.topnav .container { display: flex; align-items: center; }
.topnav #starlist { display: flex; flex-wrap: wrap; align-items: stretch; }
.topnav #starlist > li { position: relative; }
.topnav #starlist > li > a {
  display: flex;
  align-items: center;
  padding: 0 22px;
  height: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background var(--tr-fast);
  position: relative;
}
.topnav #starlist > li > a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 12px;
  height: 2px;
  background: var(--c-gold);
  transition: all var(--tr);
  opacity: 0;
}
.topnav #starlist > li > a:hover,
.topnav #starlist > li.current > a {
  color: #fff;
  background: var(--c-primary-700);
}
.topnav #starlist > li > a:hover::after,
.topnav #starlist > li.current > a::after {
  left: 22px;
  right: 22px;
  opacity: 1;
}
.topnav #starlist ul.sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-top: 2px solid var(--c-gold);
  box-shadow: var(--shadow);
  padding: 6px 0;
  display: none;
  z-index: 20;
}
.topnav #starlist > li:hover > ul.sub { display: block; }
.topnav #starlist ul.sub li { display: block; }
.topnav #starlist ul.sub li a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--c-ink);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--tr-fast);
}
.topnav #starlist ul.sub li a:hover { background: var(--c-primary-100); color: var(--c-primary); padding-left: 22px; }
.topnav #starlist .menu::before {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
  opacity: .8;
  display: inline-block;
}

/* Mobile nav toggle */
#mnavh { display: none; }
@media (max-width: 900px) {
  .topnav #starlist { display: none; }
  .topnav #starlist.open { display: flex; flex-direction: column; width: 100%; }
  .topnav #starlist.open > li > a { height: 44px; }
  #mnavh { display: block; width: 50px; height: 50px; margin-left: auto; color: #fff; }
  #mnavh span { display: block; width: 24px; height: 2px; background: #fff; margin: 11px auto; }
  .masthead { flex-direction: column; align-items: stretch; gap: 16px; }
  .masthead .search { width: 100%; }
}

/* ---- 5. Hero / banner ---- */
.hero { padding: 28px 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.hero-grid > * { min-width: 0; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.swiper-container { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--c-surface-alt); aspect-ratio: 16 / 7; width: 100%; max-width: 100%; min-width: 0; }
.swiper-wrapper { display: flex; transition: transform .5s ease; width: 100%; height: 100%; }
.swiper-slide { flex: 0 0 100%; position: relative; overflow: hidden; }
.swiper-slide a { display: block; height: 100%; }
.swiper-slide img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.swiper-slide:hover img { transform: scale(1.05); }
.swiper-slide .slide-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 22px 18px;
  color: #fff;
  font-family: var(--ff-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(26, 20, 13, .85) 0%, rgba(26, 20, 13, 0) 100%);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.swiper-slide .slide-cat {
  position: absolute; top: 14px; left: 14px;
  background: var(--c-accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px;
}
.swiper-button-prev, .swiper-button-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26, 20, 13, .55); color: #fff;
  border-radius: 50%; cursor: pointer;
  font-size: 20px; user-select: none;
  transition: background var(--tr-fast);
}
.swiper-button-prev { left: 14px; } .swiper-button-next { right: 14px; }
.swiper-button-prev:hover, .swiper-button-next:hover { background: var(--c-accent); }
.swiper-pagination { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.swiper-pagination span { width: 24px; height: 3px; background: rgba(255, 255, 255, .45); border-radius: 2px; cursor: pointer; transition: background var(--tr-fast); }
.swiper-pagination span.active { background: var(--c-gold); }

/* Headline box (right of hero) */
.headline-box { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 24px 26px; display: flex; flex-direction: column; }
.headline-box .head-tag {
  display: inline-block; align-self: flex-start;
  background: var(--c-primary-100); color: var(--c-primary);
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 2px;
  margin-bottom: 14px;
}
.headline-news-title { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.headline-news-title a { color: var(--c-ink); }
.headline-news-title a:hover { color: var(--c-primary); }
.headline-news-smalltext { color: var(--c-ink-soft); font-size: 14px; line-height: 1.65; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.headline-news-list { border-top: 1px solid var(--c-line); padding-top: 12px; margin-top: auto; }
.headline-news-list li { line-height: 1.9; padding-left: 14px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.headline-news-list li::before { content: "›"; position: absolute; left: 0; top: 0; color: var(--c-accent); font-weight: 700; }
.headline-news-list a { color: var(--c-ink-soft); font-size: 13px; }
.headline-news-list a:hover { color: var(--c-primary); }

/* ---- 6. Section block (Latest News / Industry Features / etc.) ---- */
.block { margin: 36px 0; }
.block-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid var(--c-line);
  background: linear-gradient(to right, var(--c-primary-100), transparent 60%);
}
.block-head h2 {
  font-family: var(--ff-serif);
  font-size: 22px;
  color: var(--c-ink);
  position: relative;
  padding-left: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.block-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 5px;
  background: var(--c-accent);
  border-radius: 2px;
}
.block-head .more {
  font-size: 12px; color: var(--c-ink-soft);
  text-transform: uppercase; letter-spacing: .12em;
  display: inline-flex; align-items: center; gap: 6px;
}
.block-head .more::after { content: "→"; transition: transform var(--tr-fast); }
.block-head .more:hover { color: var(--c-primary); }
.block-head .more:hover::after { transform: translateX(3px); }
.block-body { padding: 24px 26px; }
.block-body.tight { padding: 12px 18px; }

/* Tabs inside a block */
.tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--c-line); padding: 0 26px; background: var(--c-surface); }
.tab-bar li { list-style: none; }
.tab-bar li a, .tab-bar li {
  display: inline-flex; align-items: center; height: 50px;
  padding: 0 22px;
  font-family: var(--ff-serif);
  font-size: 16px; font-weight: 600;
  color: var(--c-ink-soft);
  cursor: pointer; position: relative;
  border-bottom: 3px solid transparent;
  transition: all var(--tr-fast);
  text-transform: capitalize;
}
.tab-bar li a:hover, .tab-bar li:hover, .tab-bar li.tab-current {
  color: var(--c-primary);
  border-bottom-color: var(--c-accent);
}
.tab-content > section { display: none; padding: 24px 26px; }
.tab-content > section.active { display: block; }

/* Tab content - 1+6 layout (one big + 6 small) */
.layout-1-6 { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.95fr); gap: 26px; }
@media (max-width: 760px) { .layout-1-6 { grid-template-columns: 1fr; } }
.feat-card .feat-img { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--c-surface-alt); margin-bottom: 14px; }
.feat-card .feat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.feat-card:hover .feat-img img { transform: scale(1.06); }
.feat-card .feat-cat { position: absolute; top: 12px; left: 12px; background: var(--c-accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 2px; }
.feat-card h3 { font-family: var(--ff-serif); font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.feat-card h3 a { color: var(--c-ink); }
.feat-card h3 a:hover { color: var(--c-primary); }
.feat-card .feat-desc { color: var(--c-ink-soft); font-size: 14px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.btn-link {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--c-primary);
  border-bottom: 2px solid var(--c-primary);
  padding-bottom: 4px;
  transition: all var(--tr-fast);
}
.btn-link:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); padding-bottom: 6px; }

.list-2x4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 30px; }
@media (max-width: 600px) { .list-2x4 { grid-template-columns: 1fr; } }
.list-2x4 li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--c-line-soft); }
.list-2x4 li .l-date {
  flex: 0 0 56px;
  text-align: center;
  font-family: var(--ff-serif);
  border: 1px solid var(--c-line);
  border-radius: 4px;
  padding: 6px 0;
  line-height: 1.1;
  background: var(--c-surface);
}
.list-2x4 li .l-date b { display: block; font-size: 18px; color: var(--c-primary); font-weight: 700; }
.list-2x4 li .l-date small { display: block; font-size: 10px; color: var(--c-ink-mute); letter-spacing: .04em; }
.list-2x4 li .l-body { flex: 1; min-width: 0; }
.list-2x4 li .l-body h4 { font-size: 14px; line-height: 1.45; margin-bottom: 4px; font-weight: 600; }
.list-2x4 li .l-body h4 a { color: var(--c-ink); }
.list-2x4 li .l-body h4 a:hover { color: var(--c-primary); }
.list-2x4 li .l-body p { color: var(--c-ink-soft); font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Tab content - large left + 4 small right */
.layout-1-4 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 30px; }
@media (max-width: 760px) { .layout-1-4 { grid-template-columns: 1fr; } }
.layout-1-4 .pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.layout-1-4 .pics .pic-card { position: relative; }
.layout-1-4 .pics .pic-card .pc-img { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; }
.layout-1-4 .pics .pic-card .pc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.layout-1-4 .pics .pic-card:hover .pc-img img { transform: scale(1.06); }
.layout-1-4 .pics .pic-card .pc-title { font-size: 14px; line-height: 1.45; margin-top: 10px; font-weight: 500; }
.layout-1-4 .pics .pic-card .pc-title a { color: var(--c-ink); }
.layout-1-4 .pics .pic-card .pc-title a:hover { color: var(--c-primary); }
.layout-1-4 .feat-card .feat-img { aspect-ratio: 4 / 5; }

/* 4 x 2 grid (videos-like list) */
.layout-4x2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .layout-4x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.layout-4x2 .card-mini { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; transition: transform var(--tr), box-shadow var(--tr); }
.layout-4x2 .card-mini:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--c-primary-100); }
.layout-4x2 .card-mini .cm-img { aspect-ratio: 16 / 11; overflow: hidden; position: relative; }
.layout-4x2 .card-mini .cm-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.layout-4x2 .card-mini:hover .cm-img img { transform: scale(1.06); }
.layout-4x2 .card-mini .cm-body { padding: 14px 16px 16px; }
.layout-4x2 .card-mini h4 { font-size: 15px; line-height: 1.45; margin-bottom: 6px; font-weight: 600; }
.layout-4x2 .card-mini h4 a { color: var(--c-ink); }
.layout-4x2 .card-mini h4 a:hover { color: var(--c-primary); }
.layout-4x2 .card-mini .cm-meta { color: var(--c-ink-mute); font-size: 12px; display: flex; justify-content: space-between; }

/* 3 x multi line small pic - text heavy list */
.text-list-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 30px; }
.text-list-2col > * { min-width: 0; }
@media (max-width: 700px) { .text-list-2col { grid-template-columns: 1fr; } }
.text-list-2col li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--c-line-soft); align-items: flex-start; }
.text-list-2col li .tl-thumb { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 4px; overflow: hidden; background: var(--c-surface-alt); }
.text-list-2col li .tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.text-list-2col li .tl-body { flex: 1; min-width: 0; }
.text-list-2col li .tl-body h4 { font-size: 14px; line-height: 1.4; margin-bottom: 3px; font-weight: 600; }
.text-list-2col li .tl-body h4 a { color: var(--c-ink); }
.text-list-2col li .tl-body h4 a:hover { color: var(--c-primary); }
.text-list-2col li .tl-body p { color: var(--c-ink-soft); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-list-2col li .tl-body .tl-meta { color: var(--c-ink-mute); font-size: 11px; margin-top: 4px; display: block; }

/* Pure text link list (used inside wenzi blocks) */
.text-only-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 24px; }
.text-only-list > * { min-width: 0; }
@media (max-width: 700px) { .text-only-list { grid-template-columns: 1fr; } }
.text-only-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--c-line-soft); font-size: 14px; }
.text-only-list li::before { content: "•"; color: var(--c-accent); font-size: 18px; line-height: 1; }
.text-only-list li a { flex: 1; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-only-list li a:hover { color: var(--c-primary); }
.text-only-list li time { color: var(--c-ink-mute); font-size: 12px; flex: 0 0 auto; }

/* Tags block */
.tags-block { padding: 22px 26px; }
.tags-block ul { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.tags-block a {
  display: inline-block;
  background: var(--c-surface-alt);
  color: var(--c-ink-soft);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--c-line-soft);
  transition: all var(--tr-fast);
}
.tags-block a:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* Friend links */
.links-block { padding: 22px 26px; }
.links-block ul { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.links-block li { font-size: 13px; color: var(--c-ink-mute); }
.links-block li:not(:last-child)::after { content: "|"; color: var(--c-line); margin-left: 18px; }
.links-block a { color: var(--c-ink-soft); }
.links-block a:hover { color: var(--c-primary); }

/* Ad placeholders */
.ad { background: var(--c-surface-alt); border: 1px dashed var(--c-line); text-align: center; padding: 30px 20px; color: var(--c-ink-mute); font-size: 13px; margin: 24px 0; border-radius: var(--radius); }
.ad-big { width: 100%; }
.ad-small { width: 100%; }

/* ---- 7. Article list (list.html / category.html) ---- */
.layout-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; padding: 30px 0; }
.layout-with-aside > * { min-width: 0; }
@media (max-width: 900px) { .layout-with-aside { grid-template-columns: 1fr; } }

.breadcrumb-bar { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 14px 22px; font-size: 13px; color: var(--c-ink-soft); margin-bottom: 20px; }
.breadcrumb-bar a { color: var(--c-ink-soft); }
.breadcrumb-bar a:hover { color: var(--c-primary); }
.breadcrumb-bar span.sep { margin: 0 8px; color: var(--c-line); }
.breadcrumb-bar span.crumb-current { color: var(--c-primary); font-weight: 600; }
.breadcrumb-bar .bc-label { color: var(--c-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin-right: 8px; font-size: 12px; }

.list-block { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; }
.list-block-head { padding: 22px 26px; border-bottom: 2px solid var(--c-primary); }
.list-block-head h1, .list-block-head h2 { font-size: 24px; color: var(--c-ink); }
.list-block-head .list-sub { color: var(--c-ink-soft); font-size: 13px; margin-top: 4px; }

.article-list { padding: 0 26px; }
.article-list .article-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--c-line); }
.article-list .article-item > * { min-width: 0; }
.article-list .article-item:last-child { border-bottom: 0; }
.article-list .article-item .ai-img { width: 220px; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--c-surface-alt); }
.article-list .article-item .ai-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.article-list .article-item:hover .ai-img img { transform: scale(1.06); }
.article-list .article-item h2 { font-size: 20px; line-height: 1.35; margin-bottom: 10px; }
.article-list .article-item h2 a { color: var(--c-ink); }
.article-list .article-item h2 a:hover { color: var(--c-primary); }
.article-list .article-item p { color: var(--c-ink-soft); font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; }
.article-list .article-item .ai-meta { color: var(--c-ink-mute); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.article-list .article-item .ai-meta a { color: var(--c-ink-soft); }
.article-list .article-item .ai-meta a:hover { color: var(--c-primary); }
@media (max-width: 600px) {
  .article-list .article-item { grid-template-columns: 1fr; }
  .article-list .article-item .ai-img { width: 100%; }
}

/* Pagination */
.pagelist { padding: 26px; text-align: center; }
.pagelist a, .pagelist span { display: inline-block; padding: 8px 14px; margin: 0 3px; font-size: 13px; border: 1px solid var(--c-line); border-radius: 4px; color: var(--c-ink-soft); background: var(--c-surface); transition: all var(--tr-fast); }
.pagelist a:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagelist span.current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ---- 8. Article page (show.html) ---- */
.article-page { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 36px 44px; }
@media (max-width: 600px) { .article-page { padding: 24px 20px; } }
.article-page .ap-title { font-family: var(--ff-serif); font-size: 32px; line-height: 1.3; color: var(--c-ink); margin-bottom: 18px; }
@media (max-width: 600px) { .article-page .ap-title { font-size: 24px; } }
.article-page .ap-meta { color: var(--c-ink-mute); font-size: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--c-line); margin-bottom: 26px; display: flex; gap: 22px; flex-wrap: wrap; }
.article-page .ap-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-page .ap-meta i { color: var(--c-primary); }
.article-page .ap-lead { background: var(--c-primary-100); border-left: 3px solid var(--c-accent); padding: 14px 18px; font-size: 14px; color: var(--c-ink-soft); margin-bottom: 26px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.article-page .ap-body { font-size: 16px; line-height: 1.85; color: var(--c-ink); }
.article-page .ap-body p { margin-bottom: 18px; }
.article-page .ap-body h2, .article-page .ap-body h3, .article-page .ap-body h4 { margin: 28px 0 14px; }
.article-page .ap-body img { max-width: 100%; border-radius: var(--radius); margin: 12px auto; }
.article-page .ap-body blockquote { border-left: 3px solid var(--c-primary); padding: 6px 18px; color: var(--c-ink-soft); font-style: italic; background: var(--c-surface-alt); margin: 18px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.ap-note { margin: 24px 0 0; padding: 18px 22px; background: var(--c-primary-100); border: 1px solid var(--c-line); border-left: 4px solid var(--c-accent); border-radius: var(--radius-sm); font-size: 14px; line-height: 1.75; color: var(--c-ink); }
.ap-note p { margin: 0 0 10px; }
.ap-note h4 { margin: 14px 0 6px; font-size: 15px; color: var(--c-accent-700); letter-spacing: .02em; }
.ap-note p:last-child { margin-bottom: 0; }

.ap-cool { padding: 18px 0; text-align: center; border-top: 1px dashed var(--c-line); border-bottom: 1px dashed var(--c-line); margin: 26px 0; }
.ap-cool a { display: inline-block; padding: 10px 26px; background: var(--c-primary); color: #fff; border-radius: var(--radius); font-weight: 600; transition: background var(--tr-fast); }
.ap-cool a:hover { background: var(--c-accent); }

.ap-tags { padding: 20px 0; border-top: 1px solid var(--c-line); }
.ap-tags h3 { font-size: 14px; color: var(--c-ink-soft); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .1em; }
.ap-tags ul { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-tags li a { display: inline-block; background: var(--c-surface-alt); color: var(--c-ink-soft); padding: 6px 14px; font-size: 13px; border-radius: 999px; border: 1px solid var(--c-line-soft); }
.ap-tags li a:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.ap-share { display: flex; align-items: center; gap: 22px; padding: 24px 0; border-top: 1px solid var(--c-line); margin-top: 24px; }
.ap-share .share-qr { width: 88px; height: 88px; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 6px; }
.ap-share .share-qr img { width: 100%; height: 100%; object-fit: contain; }
.ap-share .share-text p { font-size: 13px; color: var(--c-ink-soft); line-height: 1.7; }

.ap-prev-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin: 30px 0 0; }
.ap-prev-next a { display: grid; grid-template-columns: 100px 1fr; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--c-line); border-radius: var(--radius); transition: all var(--tr-fast); }
.ap-prev-next a > * { min-width: 0; }
.ap-prev-next a:hover { border-color: var(--c-primary); background: var(--c-primary-100); }
.ap-prev-next a img { width: 100px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.ap-prev-next a em { font-size: 11px; color: var(--c-primary); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin-bottom: 4px; display: block; }
.ap-prev-next a h4 { font-size: 14px; line-height: 1.4; font-weight: 500; }
.ap-prev-next a.next { text-align: right; grid-template-columns: 1fr 100px; }
.ap-prev-next a.next em { text-align: right; }
@media (max-width: 600px) { .ap-prev-next { grid-template-columns: 1fr; } .ap-prev-next a.next { grid-template-columns: 100px 1fr; text-align: left; } .ap-prev-next a.next em { text-align: left; } }

.related-block { margin-top: 30px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 26px; }
.related-block h2 { font-size: 20px; margin-bottom: 16px; padding-left: 14px; border-left: 4px solid var(--c-accent); }
.related-block ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.related-block ul > * { min-width: 0; }
.related-block li { padding: 8px 0; border-bottom: 1px dashed var(--c-line-soft); font-size: 14px; position: relative; padding-left: 16px; }
.related-block li::before { content: "›"; position: absolute; left: 0; color: var(--c-accent); font-weight: 700; }
.related-block li a { color: var(--c-ink); }
.related-block li a:hover { color: var(--c-primary); }
@media (max-width: 600px) { .related-block ul { grid-template-columns: 1fr; } }

/* ---- 9. Sidebar (right aside) ---- */
aside { display: flex; flex-direction: column; gap: 24px; }
aside .widget { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); overflow: hidden; }
aside .widget-head { padding: 16px 22px; border-bottom: 1px solid var(--c-line); background: var(--c-primary-100); }
aside .widget-head h2 { font-size: 16px; color: var(--c-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding-left: 12px; border-left: 3px solid var(--c-accent); line-height: 1.1; }
aside .widget-body { padding: 20px 22px; }

.side-tab { display: flex; border-bottom: 2px solid var(--c-primary); background: var(--c-surface); }
.side-tab li { flex: 1; padding: 12px 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--c-ink-soft); cursor: pointer; text-transform: uppercase; letter-spacing: .08em; }
.side-tab li.sidetab-current { background: var(--c-primary); color: #fff; }
.side-tab-content > section { display: none; padding: 18px 22px; }
.side-tab-content > section.active { display: block; }

.side-featured { margin-bottom: 18px; position: relative; border-radius: var(--radius); overflow: hidden; }
.side-featured .sf-img { aspect-ratio: 16 / 10; overflow: hidden; }
.side-featured .sf-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.side-featured:hover .sf-img img { transform: scale(1.06); }
.side-featured .sf-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; color: #fff; font-weight: 600; font-size: 14px; line-height: 1.4; background: linear-gradient(to top, rgba(26, 20, 13, .85), transparent); }

.side-list-mini { display: flex; flex-direction: column; }
.side-list-mini li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--c-line-soft); align-items: flex-start; }
.side-list-mini li:last-child { border-bottom: 0; }
.side-list-mini .slm-num { flex: 0 0 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-family: var(--ff-serif); font-weight: 700; font-size: 13px; color: #fff; background: var(--c-ink-mute); border-radius: 3px; }
.side-list-mini li:nth-child(1) .slm-num { background: var(--c-accent); }
.side-list-mini li:nth-child(2) .slm-num { background: var(--c-gold); }
.side-list-mini li:nth-child(3) .slm-num { background: var(--c-leaf); }
.side-list-mini .slm-body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }
.side-list-mini .slm-body a { color: var(--c-ink); }
.side-list-mini .slm-body a:hover { color: var(--c-primary); }

.side-list-thumb li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--c-line-soft); }
.side-list-thumb li > * { min-width: 0; }
.side-list-thumb li:last-child { border-bottom: 0; }
.side-list-thumb .st-img { width: 70px; height: 70px; border-radius: 4px; overflow: hidden; }
.side-list-thumb .st-img img { width: 100%; height: 100%; object-fit: cover; }
.side-list-thumb .st-body { font-size: 13px; line-height: 1.5; }
.side-list-thumb .st-body a { color: var(--c-ink); }
.side-list-thumb .st-body a:hover { color: var(--c-primary); }

.tag-cloud { padding: 16px 22px 22px; }
.tag-cloud a { display: inline-block; padding: 5px 12px; margin: 4px 4px 4px 0; background: var(--c-surface-alt); color: var(--c-ink-soft); font-size: 12px; border-radius: 999px; border: 1px solid var(--c-line-soft); }
.tag-cloud a:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.you-may ul { padding: 0 22px 22px; }
.you-may li { padding: 8px 0; border-bottom: 1px dashed var(--c-line-soft); font-size: 13px; line-height: 1.5; padding-left: 16px; position: relative; }
.you-may li:last-child { border-bottom: 0; }
.you-may li::before { content: "›"; position: absolute; left: 0; color: var(--c-accent); font-weight: 700; }
.you-may li a { color: var(--c-ink); }
.you-may li a:hover { color: var(--c-primary); }

/* ---- 10. Page (static) ---- */
.page-content-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 36px 44px; }
.page-content-card h1 { font-family: var(--ff-serif); font-size: 28px; color: var(--c-ink); margin-bottom: 22px; padding-bottom: 16px; border-bottom: 2px solid var(--c-primary); }

/* ---- 11. Search page ---- */
.search-hero { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 24px; }
.search-hero h1 { font-size: 22px; margin-bottom: 14px; }
.search-hero form { display: flex; gap: 10px; }
.search-hero input[type=text] { flex: 1; padding: 12px 18px; border: 1px solid var(--c-line); border-radius: var(--radius); font-size: 15px; outline: none; transition: border-color var(--tr-fast); }
.search-hero input[type=text]:focus { border-color: var(--c-primary); }
.search-hero button { padding: 0 28px; background: var(--c-primary); color: #fff; border-radius: var(--radius); font-weight: 600; letter-spacing: .04em; }
.search-hero button:hover { background: var(--c-primary-700); }
.search-empty { text-align: center; padding: 60px 20px; color: var(--c-ink-mute); }
.search-empty i { font-size: 48px; color: var(--c-line); display: block; margin-bottom: 12px; }

.search-list .article-item { display: grid; grid-template-columns: 100px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--c-line); }
.search-list .article-item > * { min-width: 0; }
.search-list .article-item .ai-img { width: 100px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; }
.search-list .article-item .ai-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---- 12. Footer ---- */
footer { background: var(--c-dark); color: rgba(255, 255, 255, .75); margin-top: 40px; }
.footer-top { padding: 50px 0 30px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.footer-grid > * { min-width: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h3 { color: #fff; font-family: var(--ff-serif); font-size: 16px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .12); position: relative; }
.footer-grid h3::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 36px; height: 2px; background: var(--c-gold); }
.footer-grid p { line-height: 1.85; font-size: 13px; color: rgba(255, 255, 255, .65); }
.footer-grid ul li { padding: 5px 0; font-size: 13px; }
.footer-grid ul li a { color: rgba(255, 255, 255, .7); transition: color var(--tr-fast); }
.footer-grid ul li a:hover { color: var(--c-gold); }
.footer-qr { display: flex; gap: 18px; margin-top: 14px; }
.footer-qr .qr { text-align: center; }
.footer-qr img { width: 90px; height: 90px; border-radius: 4px; background: #fff; padding: 4px; }
.footer-qr span { display: block; font-size: 12px; color: rgba(255, 255, 255, .65); margin-top: 6px; }

.footer-bottom { background: #100b06; padding: 18px 0; font-size: 12px; color: rgba(255, 255, 255, .5); border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-bottom .container { display: flex; flex-direction: column; gap: 6px; }
.footer-bottom .copyright a { color: rgba(255, 255, 255, .7); margin: 0 4px; }
.footer-bottom .copyright a:hover { color: var(--c-gold); }
.footer-bottom .statement { color: rgba(255, 255, 255, .45); line-height: 1.7; }
.footer-bottom .statement b { color: rgba(255, 255, 255, .75); }

/* Scroll to top */
.icon-top {
  position: fixed; right: 24px; bottom: 32px;
  width: 42px; height: 42px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; box-shadow: var(--shadow);
  font-size: 18px; transition: all var(--tr-fast);
  opacity: 0; pointer-events: none; z-index: 99;
}
.icon-top.show { opacity: 1; pointer-events: auto; }
.icon-top:hover { background: var(--c-accent); transform: translateY(-3px); }

/* ---- 13. Tag pages ---- */
.tag-pill { display: inline-block; background: var(--c-accent); color: #fff; padding: 4px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border-radius: 3px; margin-bottom: 12px; }

/* ---- 14. 404 / msg pages ---- */
.msg-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.msg-page .msg-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 50px 60px; max-width: 540px; width: 100%; }
.msg-page .msg-icon { font-size: 72px; color: var(--c-accent); line-height: 1; margin-bottom: 18px; }
.msg-page h1 { font-size: 28px; margin-bottom: 10px; }
.msg-page p { color: var(--c-ink-soft); margin-bottom: 22px; }
.msg-page .msg-back { display: inline-block; padding: 10px 26px; background: var(--c-primary); color: #fff; border-radius: var(--radius); font-weight: 600; }
.msg-page .msg-back:hover { background: var(--c-primary-700); color: #fff; }

/* ---- 15. Comment (kept simple, blends with new design) ---- */
.pinglun-box { margin-top: 30px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg); padding: 26px; }
.pinglun-box h2 { font-size: 20px; margin-bottom: 16px; padding-left: 14px; border-left: 4px solid var(--c-accent); }
.pinglun { display: flex; flex-direction: column; gap: 14px; }
.pinglun .pl-name, .pinglun .pl-yzm { padding: 10px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); font-size: 14px; outline: none; }
.pinglun .pl-name:focus, .pinglun .pl-yzm:focus { border-color: var(--c-primary); }
.pinglun textarea { padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); font-size: 14px; resize: vertical; min-height: 100px; outline: none; }
.pinglun textarea:focus { border-color: var(--c-primary); }
.pinglun input[type=submit] { align-self: flex-end; padding: 10px 28px; background: var(--c-primary); color: #fff; border-radius: var(--radius); font-weight: 600; }
.pinglun input[type=submit]:hover { background: var(--c-primary-700); }
