/*
Theme Name: 老雅痞 (Lao Yapi) - Web3 & Tech Editorial
Theme URI: https://laoyapi.com
Author: 老雅痞 (RecodeX.AI 创始人 / Web3 专栏作家)
Author URI: https://laoyapi.com
Description: 专为 Web3 专栏作家、独立研究员、RecodeX.AI 创始人“老雅痞”量身打造的加密思想与科技专栏主题。
Version: 2.5.0
Requires at least: 6.0
Tested up to: 7.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: laoyapi
*/

/* ============================================================
   1. CSS Variables & Web3 Editorial Theme Modes
   ============================================================ */
:root {
  /* Dark / Cypherpunk Amber Obsidian (Default) */
  --bg-primary: #0a0c10;
  --bg-secondary: #12151c;
  --bg-card: #181c25;
  --bg-elevated: #202632;
  --bg-tag: rgba(212, 163, 89, 0.08);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(212, 163, 89, 0.35);
  --border-glow: rgba(212, 163, 89, 0.15);
  
  --text-main: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  
  --gold-primary: #e5ad58;
  --gold-hover: #fcd34d;
  --gold-tint: rgba(229, 173, 88, 0.12);
  --gold-border: rgba(229, 173, 88, 0.32);
  
  --cyan-accent: #38bdf8;
  --cyan-tint: rgba(56, 189, 248, 0.1);
  
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 6px 24px rgba(229, 173, 88, 0.18);

  --font-serif: -apple-system-ui-serif, "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Cinzel", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Roboto Mono", Consolas, Menlo, Monaco, monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --container-max: 1120px;
}

[data-theme="light"] {
  --bg-primary: #f8f6f0;
  --bg-secondary: #eeeae0;
  --bg-card: #ffffff;
  --bg-elevated: #faf8f4;
  --bg-tag: rgba(180, 120, 30, 0.07);
  
  --border-subtle: #e2ddd3;
  --border-accent: rgba(180, 120, 30, 0.35);
  --border-glow: rgba(180, 120, 30, 0.12);
  
  --text-main: #141518;
  --text-body: #333842;
  --text-muted: #64748b;
  
  --gold-primary: #9e6315;
  --gold-hover: #b8771b;
  --gold-tint: rgba(158, 99, 21, 0.08);
  --gold-border: rgba(158, 99, 21, 0.28);
  
  --cyan-accent: #0284c7;
  --cyan-tint: rgba(2, 132, 199, 0.08);
  
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-gold: 0 6px 24px rgba(158, 99, 21, 0.12);
}

/* ============================================================
   2. Reset & Typography
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.8;
  letter-spacing: 0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* ============================================================
   3. Header & Web3 Identity Navigation
   ============================================================ */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background-color: rgba(10, 12, 16, 0.88);
}

[data-theme="light"] .site-header {
  background-color: rgba(248, 246, 240, 0.9);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.brand-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--gold-border);
  color: var(--gold-primary);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  box-shadow: 0 0 16px var(--border-glow);
  user-select: none;
  position: relative;
}

.brand-logo-mark::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981; /* Online green node indicator */
  box-shadow: 0 0 8px #10b981;
}

.brand-title-group h1,
.brand-title-group .site-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand-title-group h1 a:hover,
.brand-title-group .site-title a:hover {
  color: var(--gold-primary);
}

.brand-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--gold-primary);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.brand-subtitle-dot {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.brand-role {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-body);
  font-weight: 500;
  padding: 0.35rem 0.2rem;
  position: relative;
}

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

.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* ============================================================
   4. Hero Author Profile & Web3 Persona Banner
   ============================================================ */
.hero-profile-section {
  max-width: var(--container-max);
  margin: 2.5rem auto 1.5rem auto;
  padding: 0 1.5rem;
}

.profile-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.5rem;
  position: relative;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold-tint) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.profile-badge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.node-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--gold-border);
  color: var(--gold-primary);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
}

.founder-pill {
  background: var(--cyan-tint);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--cyan-accent);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
}

.profile-headline {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.profile-bio {
  color: var(--text-body);
  font-size: 1.06rem;
  max-width: 820px;
  line-height: 1.85;
  margin-bottom: 1.75rem;
}

.profile-bio strong {
  color: var(--text-main);
  font-weight: 600;
}

.domain-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.domain-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.domain-tag:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: var(--gold-tint);
}

.platforms-syndication {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.platforms-label {
  font-weight: 600;
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.platform-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  color: var(--text-body);
  font-size: 0.82rem;
  transition: border-color 0.2s ease;
}

.platform-item:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* ============================================================
   5. Content Section & Articles Feed
   ============================================================ */
.site-content {
  flex: 1;
  max-width: var(--container-max);
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
  margin-bottom: 2rem;
}

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-main);
  font-weight: 600;
}

.feed-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold-primary);
  letter-spacing: 0.05em;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.85rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-gold);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--gold-primary);
  margin-bottom: 0.95rem;
}

.post-card-date {
  color: var(--text-muted);
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.post-card-title a:hover {
  color: var(--gold-primary);
}

.post-card-excerpt {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.75;
  margin-bottom: 1.6rem;
  flex: 1;
}

.post-card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.read-more-link {
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease;
}

.read-more-link:hover {
  color: var(--gold-hover);
  gap: 0.65rem;
}

/* ============================================================
   6. Single Post & Reading Experience
   ============================================================ */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3.75rem 3.25rem;
  box-shadow: var(--shadow-md);
}

.article-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2.25rem;
  margin-bottom: 2.75rem;
}

.article-back-link {
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 2.45rem;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-family: var(--font-mono);
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.95;
  color: var(--text-body);
}

.article-content p {
  margin-bottom: 1.75rem;
}

.article-content h2,
.article-content h3 {
  font-family: var(--font-serif);
  color: var(--text-main);
  margin: 2.75rem 0 1.25rem 0;
  line-height: 1.4;
}

.article-content h2 {
  font-size: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.6rem;
}

.article-content blockquote {
  border-left: 3px solid var(--gold-primary);
  background: var(--gold-tint);
  padding: 1.35rem 1.85rem;
  margin: 2.25rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-main);
}

.author-bio-box {
  margin-top: 3.5rem;
  padding: 2rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.author-bio-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.author-bio-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.author-bio-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ============================================================
   7. Comments & Discourse Section (老雅痞 讨论回响)
   ============================================================ */
.comments-area {
  max-width: 820px;
  margin: 3rem auto 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-md);
}

.comments-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comments-title span {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--gold-primary);
  font-weight: 500;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem 0;
}

.comment-list .comment {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comment-list .children {
  list-style: none;
  padding-left: 2.5rem;
  margin-top: 1.5rem;
  border-left: 2px solid var(--border-subtle);
}

.comment-body {
  position: relative;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

.comment-author .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-border);
  box-shadow: 0 0 8px var(--border-glow);
}

.comment-author .fn {
  color: var(--gold-primary);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.comment-author .says {
  color: var(--text-muted);
  font-weight: normal;
  font-size: 0.88rem;
}

.comment-metadata {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.comment-metadata a {
  color: var(--text-muted);
}

.comment-metadata a:hover {
  color: var(--gold-primary);
}

.comment-content {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.8;
  margin: 0.75rem 0 1rem 0;
}

.comment-content p {
  margin-bottom: 0.75rem;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.reply {
  margin-top: 0.5rem;
}

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--gold-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.comment-reply-link:hover {
  border-color: var(--gold-primary);
  background: var(--gold-tint);
  color: var(--gold-hover);
}

/* Comment Form & Respond Box */
#respond {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

#reply-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#cancel-comment-reply-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #ef4444;
  margin-left: 1rem;
}

.logged-in-as {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.logged-in-as a {
  color: var(--gold-primary);
  text-decoration: underline;
}

.comment-form-comment {
  margin-bottom: 1.25rem;
}

#commentform textarea,
#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"] {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#commentform textarea {
  min-height: 130px;
  resize: vertical;
}

#commentform textarea:focus,
#commentform input[type="text"]:focus,
#commentform input[type="email"]:focus,
#commentform input[type="url"]:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px var(--gold-tint);
}

#commentform .form-submit {
  margin-top: 1rem;
}

#commentform input[type="submit"],
.comment-submit-btn,
#submit {
  background: var(--gold-primary);
  color: #0a0c10;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

#commentform input[type="submit"]:hover,
.comment-submit-btn:hover,
#submit:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.comment-notes,
.comment-form-cookies-consent {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
  font-style: italic;
}

/* ============================================================
   8. Footer
   ============================================================ */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 3.75rem 1.5rem 2.5rem 1.5rem;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.footer-motto {
  color: var(--gold-primary);
  font-size: 0.94rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin-bottom: 1.35rem;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 680px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.75;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  letter-spacing: 0.03em;
}

/* ============================================================
   8. Responsive Adjustments
   ============================================================ */
@media (max-width: 768px) {
  .header-inner {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .profile-card {
    padding: 2rem 1.5rem;
  }
  
  .profile-headline {
    font-size: 1.6rem;
  }
  
  .article-container {
    padding: 2rem 1.25rem;
  }
  
  .article-title {
    font-size: 1.85rem;
  }
  
  .author-bio-box {
    flex-direction: column;
    text-align: center;
  }
}
