@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Fira Code', 'Share Tech Mono', 'Courier New', monospace;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: #fff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

ul, menu {
  list-style: none;
}

/* ===== 侧边导航 ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #000;
  border-right: 1px solid #333;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-nav summary {
  display: none;
}

.sidebar-nav[open] > summary,
.sidebar-nav > summary {
  display: none;
}

.sidebar-nav__inner {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  height: 100%;
}

.sidebar-brand {
  text-align: center;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid #333;
  margin-bottom: 2rem;
}

.brand-link {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  word-break: break-all;
}

.site-logo-img {
  max-width: 140px;
  margin: 0 auto;
}

.site-logo-text {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #fff;
  word-break: break-all;
}

.sidebar-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-menu li a {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.05em;
  color: #ccc;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 40px;
  line-height: 1.5;
}

.sidebar-menu li a:hover {
  color: #fff;
  border-left-color: #fff;
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}

/* ===== 内容区 ===== */
.content-area {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content-area--inner {
  position: relative;
}

/* ===== Hero ===== */
.hero--home {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "text media";
  position: relative;
  overflow: hidden;
  align-items: center;
}

.hero__slash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(105deg, #000 0%, #000 52%, #111 52%, #111 100%);
  z-index: 0;
  pointer-events: none;
}

.hero__text {
  grid-area: text;
  position: relative;
  z-index: 1;
  padding: 4rem 3rem 4rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero__eyebrow {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: #888;
  text-transform: uppercase;
}

.hero__h1 {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1.2;
  color: #fff;
  letter-spacing: 0.05em;
}

.hero__lead {
  font-size: 1rem;
  color: #ccc;
  max-width: 440px;
  line-height: 1.7;
}

.hero__cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid #fff;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
  line-height: 1.5;
}

.hero__cta:hover {
  background: #fff;
  color: #000;
  text-decoration: none;
}

.hero__media {
  grid-area: media;
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.hero__placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #111 0px,
    #111 2px,
    #000 2px,
    #000 12px
  );
}

/* ===== 主内容结构 main > div.wrap > section > article ===== */
.main-home,
.main-category,
.main-entry,
.main-tag,
.main-about,
.main-privacy {
  flex: 1;
  padding: 3rem 2rem;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

.section-content {
  margin-bottom: 3rem;
}

/* 满足 main > div.wrap > section > article 四层嵌套 */
.home-content,
.category-body,
.entry-article,
.tag-body,
.about-article,
.privacy-article {
  display: block;
}

/* ===== 页面头 ===== */
.page-header {
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid #222;
  position: relative;
}

.page-header__meta {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 1rem;
  font-family: 'Share Tech Mono', monospace;
}

.breadcrumb-home,
.breadcrumb-parent {
  color: #888;
}

.breadcrumb-home:hover,
.breadcrumb-parent:hover {
  color: #fff;
  text-decoration: none;
}

.breadcrumb-sep {
  margin: 0 0.4rem;
  color: #444;
}

.breadcrumb-current {
  color: #ccc;
}

.page-header__h1 {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1.25;
  color: #fff;
  margin-bottom: 0.75rem;
}

.page-header__desc {
  color: #aaa;
  font-size: 0.95rem;
  max-width: 600px;
}

/* ===== Entry header ===== */
.entry-header {
  padding: 3rem 2rem 1.5rem;
  border-bottom: 1px solid #222;
}

.entry-header__meta {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 1rem;
  font-family: 'Share Tech Mono', monospace;
}

.entry-header__h1 {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  line-height: 1.3;
  color: #fff;
  margin-bottom: 1rem;
}

.entry-header__byline {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: #666;
  font-family: 'Share Tech Mono', monospace;
}

.byline-item a {
  color: #aaa;
}

.byline-item a:hover {
  color: #fff;
}

.entry-hero-figure {
  overflow: hidden;
  max-height: 420px;
}

.entry-hero-img {
  width: 100%;
  object-fit: cover;
}

/* ===== 正文排版 drop cap ===== */
.entry-drop-cap > *:first-child::first-letter,
.entry-body > *:first-child::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  font-family: 'Share Tech Mono', monospace;
  color: #fff;
  font-weight: 700;
}

.entry-body,
.category-text,
.tag-text,
.home-body-text,
.about-body,
.privacy-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #ccc;
}

.entry-body h2,
.category-text h2,
.tag-text h2,
.home-body-text h2,
.about-body h2,
.privacy-body h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.3rem;
  color: #fff;
  margin: 2rem 0 0.75rem;
  border-left: 3px solid #fff;
  padding-left: 0.75rem;
}

.entry-body h3,
.category-text h3,
.about-body h3,
.privacy-body h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  color: #eee;
  margin: 1.5rem 0 0.5rem;
}

.entry-body p,
.category-text p,
.tag-text p,
.home-body-text p,
.about-body p,
.privacy-body p {
  margin-bottom: 1.2rem;
}

.entry-body a,
.category-text a,
.tag-text a,
.home-body-text a,
.about-body a,
.privacy-body a {
  color: #fff;
  border-bottom: 1px solid #444;
}

.entry-body a:hover,
.about-body a:hover,
.privacy-body a:hover {
  border-bottom-color: #fff;
  text-decoration: none;
}

.entry-body ul,
.entry-body ol,
.about-body ul,
.about-body ol,
.privacy-body ul,
.privacy-body ol {
  margin: 0 0 1.2rem 1.5rem;
}

.entry-body li,
.about-body li,
.privacy-body li {
  margin-bottom: 0.4rem;
}

/* ===== Pull Quote ===== */
.pull-quote-wrap {
  margin: 2rem 0;
}

.pull-quote {
  border-left: 4px solid #fff;
  padding: 1rem 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.05rem;
  color: #eee;
  background: #0a0a0a;
  letter-spacing: 0.03em;
  quotes: none;
}

.pull-quote--about {
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ===== Section 标题 ===== */
.section-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

.section-title span {
  display: inline-block;
}

/* ===== 分类卡片 ===== */
.section-categories {
  margin-top: 3rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.cat-card {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.cat-card:hover {
  border-color: #555;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

.cat-card__title {
  display: block;
  margin-bottom: 0.5rem;
}

.cat-card__title h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.05em;
  border: none;
  padding: 0;
  margin: 0;
}

.cat-card__title h2 span {
  display: inline-block;
}

.cat-card__title:hover h2 {
  text-decoration: underline;
}

.cat-card__desc {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.cat-card__list {
  margin-bottom: 1rem;
}

.cat-card__list li {
  font-size: 0.82rem;
  border-bottom: 1px solid #1a1a1a;
  padding: 0.3rem 0;
}

.cat-card__list li a {
  color: #bbb;
}

.cat-card__list li a:hover {
  color: #fff;
  text-decoration: none;
}

.cat-card__more {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: #666;
  letter-spacing: 0.1em;
}

.cat-card__more:hover {
  color: #fff;
  text-decoration: none;
}

/* ===== 资源条目卡片 ===== */
.section-entries {
  margin-top: 3rem;
}

.entry-grid,
.tag-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.entry-item {
  background: #080808;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.entry-item:hover {
  border-color: #444;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
}

.entry-item__tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #666;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.4rem;
}

.entry-item__link h3 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.entry-item__link h3 span {
  display: inline-block;
}

.entry-item__link:hover h3 {
  text-decoration: underline;
}

.entry-item__desc {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.entry-item__date {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: #555;
}

/* ===== 子页表格 ===== */
.section-list {
  margin-top: 2.5rem;
}

.child-list-wrap {
  overflow-x: auto;
}

.child-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.child-table thead th {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #333;
  text-align: left;
}

.child-table tbody tr {
  border-bottom: 1px solid #1a1a1a;
  transition: background 0.15s;
}

.child-table tbody tr:hover {
  background: #0d0d0d;
}

.child-table td {
  padding: 0.75rem 1rem;
  color: #ccc;
  vertical-align: top;
}

.child-table td:first-child a {
  color: #fff;
  font-weight: 500;
}

.child-table td:first-child a:hover {
  text-decoration: underline;
}

.child-table time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: #666;
}

.no-items {
  color: #555;
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* ===== Aside ===== */
.global-aside {
  position: fixed;
  top: 0;
  right: 0;
  width: 200px;
  height: 100vh;
  background: #000;
  border-left: 1px solid #1a1a1a;
  padding: 2.5rem 1.25rem;
  overflow-y: auto;
  z-index: 50;
}

.aside-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #1a1a1a;
}

.aside-title span {
  display: inline-block;
}

.aside-title--mt {
  margin-top: 1.5rem;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.aside-nav-list li a {
  display: block;
  font-size: 0.78rem;
  color: #777;
  padding: 0.3rem 0;
  line-height: 1.5;
  transition: color 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover {
  color: #fff;
  text-decoration: none;
}

/* 内容区右侧 aside 时调整 wrap 最大宽 */
.content-area--inner .wrap {
  max-width: 820px;
  padding-right: 1rem;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid #222;
  padding: 2rem 2rem 0;
  margin-right: 200px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #1a1a1a;
}

.footer-brand-link {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: #fff;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.footer-desc {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.6;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-nav ul li a {
  font-size: 0.82rem;
  color: #666;
  display: block;
  padding: 0.25rem 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-nav ul li a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  padding: 1rem 0;
  text-align: center;
}

.copyright {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: #444;
  letter-spacing: 0.08em;
}

/* ===== 标签页 ===== */
.page-header--tag .tag-label-prefix {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #555;
  text-transform: uppercase;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ===== Reveal 动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .global-aside {
    display: none;
  }
  .site-footer {
    margin-right: 0;
  }
  .content-area--inner .wrap {
    padding-right: 0;
  }
}

@media (max-width: 860px) {
  .sidebar-nav {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #222;
  }

  .sidebar-nav summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    list-style: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #fff;
    min-height: 52px;
  }

  .sidebar-nav summary::-webkit-details-marker {
    display: none;
  }

  .sidebar-nav__inner {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #1a1a1a;
  }

  .sidebar-brand {
    text-align: left;
    padding: 0 0 1rem;
    margin-bottom: 1rem;
  }

  .sidebar-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-menu li a {
    padding: 0.5rem 0.75rem;
    border-left: none;
    border: 1px solid #333;
    font-size: 0.78rem;
    min-height: 40px;
  }

  .content-area {
    margin-left: 0;
  }

  .hero--home {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "media";
    min-height: auto;
  }

  .hero__text {
    padding: 3rem 1.5rem;
    align-items: flex-start;
  }

  .hero__media {
    height: 55vw;
    min-height: 220px;
  }

  .hero__slash {
    display: none;
  }

  .cat-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid,
  .tag-entry-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .main-home,
  .main-category,
  .main-entry,
  .main-tag,
  .main-about,
  .main-privacy {
    padding: 2rem 1rem;
  }

  .page-header,
  .entry-header {
    padding: 2rem 1rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero__h1 {
    font-size: 1.4rem;
  }

  .page-header__h1,
  .entry-header__h1 {
    font-size: 1.3rem;
  }

  .child-table {
    font-size: 0.8rem;
  }

  .child-table td {
    padding: 0.6rem 0.5rem;
  }

  .site-footer {
    padding: 1.5rem 1rem 0;
  }
}
