/* ============================================================
   Beehive-style Hero Theme  —  yytblog
   特征：网格背景 + 悬浮胶囊导航 + 巨型标题 Hero + 大留白
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root{
  --bg:            #fdfdfd;
  --text:          #101828;
  --text-light:    #667085;
  --text-lighter:  #98a2b3;
  --accent:        #2f6fed;
  --accent-hover:  #1b54c9;
  --border:        #e4e7ec;
  --code-bg:       #f2f4f7;
  --code-dark:     #1b1e24;
  --radius:        14px;
  --maxw:          860px;
}

*{ margin:0; padding:0; box-sizing:border-box; }

body{
  font-family:'Inter','PingFang SC','Microsoft YaHei',sans-serif;
  color:var(--text);
  background-color:var(--bg);
  /* 淡方格网格背景 */
  background-image:
    linear-gradient(to right,  rgba(16,24,40,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16,24,40,.035) 1px, transparent 1px);
  background-size:56px 56px;
  background-position:center top;
  line-height:1.75;
  font-size:16px;
  -webkit-font-smoothing:antialiased;
}

a{ color:var(--accent); text-decoration:none; transition:color .2s; }
a:hover{ color:var(--accent-hover); text-decoration:underline; }

/* ============ 顶栏：悬浮胶囊 ============ */
.site-header{
  position:sticky; top:16px; z-index:100;
  max-width:1080px;
  margin:16px auto 0;
  padding:10px 14px 10px 22px;
  height:auto;
  display:flex; align-items:center; justify-content:space-between;
  gap:18px;
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(16,24,40,.07);
  border-radius:999px;
  box-shadow:0 4px 20px rgba(16,24,40,.05);
}
/* logo：前面加一个蜂巢小图标 */
.site-header h1{
  font-size:1.02rem; font-weight:800; letter-spacing:-.3px;
  white-space:nowrap;
}
.site-header h1::before{
  content:'';
  display:inline-block;
  width:16px; height:16px; margin-right:7px;
  vertical-align:-2px;
  border-radius:3px;
  background:
    radial-gradient(circle at 50% 35%, var(--text) 0 2.4px, transparent 2.6px),
    linear-gradient(135deg, var(--text), #475467);
}
.site-header h1 a{ color:var(--text); }
.site-header h1 a:hover{ color:var(--accent); text-decoration:none; }
.site-header .subtitle{ display:none; }

.site-header nav{
  display:flex; align-items:center; gap:4px;
}
.site-header nav a{
  color:var(--text-light);
  font-size:.86rem; font-weight:500;
  padding:6px 12px; border-radius:999px;
  letter-spacing:0; text-transform:none;
  transition:background .18s, color .18s;
}
.site-header nav a:hover{
  color:var(--text); background:rgba(16,24,40,.05); text-decoration:none;
}
/* 给前几个菜单项加小图标（纯 CSS 装饰） */
.site-header nav a:nth-child(1)::before{ content:'⌂  '; }
.site-header nav a:nth-child(2)::before{ content:'✦  '; }
.site-header nav a:nth-child(3)::before{ content:'◈  '; }
.site-header nav a:nth-child(4)::before{ content:'⚑  '; }
.site-header nav a span{ display:none; }          /* 中英文副标题，Hero 风下隐藏更干净 */

/* ============ 布局 ============ */
.container{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 24px;
}

/* ============ 首页 Hero ============ */
/* 首页第一屏：面包屑 + 巨型标题 + 副标题，全部居中 */
body:not(.single) .container > *:nth-child(1){
  text-align:center;
}
/* 面包屑行 */
.breadcrumb,
.post-meta.top{
  text-align:center;
  font-size:.8rem; color:var(--text-lighter);
  margin:4.5rem 0 1.2rem;
  letter-spacing:.2px;
}
.breadcrumb a{ color:var(--text-lighter); }
.breadcrumb a:hover{ color:var(--accent); }
.breadcrumb .cur{ color:var(--accent); font-weight:600; }

/* Hero 区（首页第一个 .post-card 变身 Hero） */
body:not(.single) .post-card:first-of-type{
  background:transparent;
  border:none;
  border-radius:0;
  padding:0 0 1rem;
  margin:0 auto 1rem;
  box-shadow:none;
  text-align:center;
}
body:not(.single) .post-card:first-of-type:hover{
  border:none; box-shadow:none;
}
body:not(.single) .post-card:first-of-type h2{
  font-size:clamp(2.1rem, 5.4vw, 3.5rem);
  font-weight:900;
  letter-spacing:-.035em;
  line-height:1.12;
  margin:.4rem auto 1.1rem;
  max-width:15em;
}
body:not(.single) .post-card:first-of-type h2 a{ color:var(--text); }
body:not(.single) .post-card:first-of-type h2 a:hover{
  color:var(--text); text-decoration:none; opacity:.72;
}
body:not(.single) .post-card:first-of-type .summary{
  font-size:1.02rem;
  color:var(--text-light);
  max-width:34em;
  margin:0 auto 2rem;
  line-height:1.7;
}
body:not(.single) .post-card:first-of-type .post-meta{
  justify-content:center;
  margin-bottom:.4rem;
}

/* ============ 文章列表（Hero 之下，轻量行式） ============ */
.post-card{
  background:rgba(255,255,255,.66);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:1.5rem 1.8rem;
  margin:1.1rem 0;
  transition:border-color .2s, box-shadow .2s, transform .2s;
}
.post-card:hover{
  border-color:#c7cfdb;
  box-shadow:0 6px 22px rgba(16,24,40,.06);
  transform:translateY(-1px);
}
.post-card h2{
  font-size:1.2rem; font-weight:700; letter-spacing:-.2px;
  margin-bottom:.35rem;
}
.post-card h2 a{ color:var(--text); }
.post-card h2 a:hover{ color:var(--accent); text-decoration:none; }
.post-meta{
  color:var(--text-lighter);
  font-size:.79rem;
  display:flex; gap:.75rem; flex-wrap:wrap;
  margin:.45rem 0;
}
.summary{ color:var(--text-light); font-size:.9rem; margin:.6rem 0 .9rem; }
.read-more{ font-size:.83rem; font-weight:600; }
.read-more::after{ content:' →'; }
.tag{
  background:var(--code-bg); color:var(--text-light);
  padding:2px 9px; border-radius:999px; font-size:.75rem;
  border:1px solid var(--border);
}
.tag:hover{ background:#e6ebf2; }

/* ============ 正文文章 ============ */
.post-content{
  background:transparent;
  border:none; border-radius:0;
  max-width:var(--maxw);
  margin:0 auto;
  padding:2rem 0 3rem;
}
.post-content > h1:first-child{
  font-size:clamp(1.9rem, 4.4vw, 2.75rem);
  font-weight:900;
  letter-spacing:-.032em;
  line-height:1.15;
  text-align:center;
  margin:2.2rem auto 1rem;
  max-width:16em;
}
.post-content h1,.post-content h2,.post-content h3,
.post-content h4,.post-content h5,.post-content h6{
  font-weight:700; letter-spacing:-.2px; line-height:1.35;
  margin:2.3rem 0 .9rem;
  scroll-margin-top:96px;
}
.post-content h1{ font-size:1.85rem; border-bottom:1px solid var(--border); padding-bottom:.5rem; }
.post-content h2{ font-size:1.32rem; border-bottom:1px solid var(--border); padding-bottom:.35rem; }
.post-content h3{ font-size:1.08rem; }
.post-content p{ margin-bottom:1.2rem; color:#232a35; }
.post-content ul,.post-content ol{ margin:0 0 1.2rem 1.6rem; }
.post-content li{ margin:.35rem 0; }
.post-content strong{ font-weight:700; color:var(--text); }
.post-content img{
  max-width:100%; border-radius:10px; margin:1.6rem 0;
  border:1px solid var(--border);
}

/* 行内 code */
.post-content code{
  font-family:'JetBrains Mono','Fira Code',Consolas,monospace;
  background:var(--code-bg); color:var(--accent);
  padding:2px 7px; border-radius:5px; font-size:.85em;
}
/* 代码块：mac 三点 + 语言标签位 */
.post-content pre{
  background:var(--code-dark); color:#e6edf3;
  padding:2.6rem 1.25rem 1.25rem;
  border-radius:12px;
  overflow-x:auto;
  margin:1.6rem 0;
  font-size:.85rem; line-height:1.62;
  position:relative;
  border:1px solid #2c3038;
}
.post-content pre code{
  background:none; color:inherit; padding:0; font-size:inherit;
}
.post-content pre::before{
  content:''; position:absolute; top:13px; left:15px;
  width:11px; height:11px; border-radius:50%;
  background:#ff5f56;
  box-shadow:19px 0 0 #ffbd2e, 38px 0 0 #27c93f;
}
.post-content pre[data-lang]::after{
  content:attr(data-lang);
  position:absolute; top:11px; left:50%; transform:translateX(-50%);
  color:#8b949e; font-size:.68rem; letter-spacing:1.2px; font-weight:600;
}
.post-content blockquote{
  border-left:3px solid var(--accent);
  background:rgba(47,111,237,.045);
  padding:.85rem 1.25rem; margin:1.6rem 0;
  color:var(--text-light); border-radius:0 8px 8px 0;
}

/* ============ 按钮 ============ */
.btn{
  display:inline-block; padding:.52rem 1.15rem;
  border:none; border-radius:999px;
  cursor:pointer; font-size:.84rem; font-weight:600;
  text-decoration:none; transition:all .18s;
}
.btn-primary{ background:var(--text); color:#fff; }
.btn-primary:hover{ background:var(--accent); color:#fff; transform:translateY(-1px); }
.btn-danger{ background:#d92d20; color:#fff; }
.btn-sm{ padding:.34rem .78rem; font-size:.78rem; }

/* ============ 提示条 ============ */
.flash{
  background:#eff5ff; border:1px solid #b2cdf8;
  padding:.75rem 1.15rem; border-radius:10px;
  margin-bottom:1.5rem; font-size:.9rem;
}
.flash.error{  background:#fef3f2; border-color:#fecdc7; color:#912018; }
.flash.success{ background:#ecfdf3; border-color:#abefc6; color:#0a6b38; }

/* ============ 后台 / 登录 / 编辑 ============ */
.login-box,.editor-box{
  max-width:420px; margin:4rem auto;
  background:rgba(255,255,255,.85);
  padding:2.4rem; border-radius:var(--radius);
  border:1px solid var(--border);
  box-shadow:0 8px 30px rgba(16,24,40,.05);
}
.editor-box{ max-width:100%; }
.login-box h2{ margin-bottom:1.4rem; font-weight:800; font-size:1.3rem; letter-spacing:-.3px; }
.login-box input,.editor-box input,.editor-box textarea{
  width:100%; padding:.65rem .85rem;
  border:1px solid var(--border); border-radius:9px;
  font-size:.92rem; margin-bottom:1rem; font-family:inherit;
  transition:border-color .2s, box-shadow .2s;
}
.login-box input:focus,.editor-box input:focus,.editor-box textarea:focus{
  outline:none; border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(47,111,237,.11);
}
.editor-box label{ display:block; margin-bottom:.4rem; font-weight:600; font-size:.83rem; }
.editor-box textarea#content{ height:420px; font-family:'JetBrains Mono',monospace; font-size:.85rem; }
.toolbar{ margin-bottom:.8rem; display:flex; gap:.4rem; flex-wrap:wrap; }
.toolbar button{
  padding:.34rem .72rem; border:1px solid var(--border);
  background:#fff; border-radius:8px; cursor:pointer;
  font-size:.78rem; transition:background .18s;
}
.toolbar button:hover{ background:var(--code-bg); }
.dashboard-post{
  display:flex; justify-content:space-between; align-items:center;
  padding:.9rem 0; border-bottom:1px solid var(--border);
}
.dashboard-post:last-child{ border-bottom:none; }
.dashboard-post a{ color:var(--text); font-weight:600; }
.dashboard-post a:hover{ color:var(--accent); }

/* ============ 页脚 ============ */
.site-footer{
  text-align:center; padding:3rem 1.5rem;
  color:var(--text-lighter); margin-top:4rem;
  border-top:1px solid var(--border);
  font-size:.8rem;
}

/* ============ 管理条 ============ */
.admin-bar{ background:var(--text); color:#fff; padding:.5rem 0; font-size:.78rem; }
.admin-bar a{ color:rgba(255,255,255,.68); margin:0 .7rem; }
.admin-bar a:hover{ color:#fff; }

/* ============ 翻页 / 归档等附加块 ============ */
.pagination{ text-align:center; margin:2.5rem 0; }
.pagination a,.pagination span{
  display:inline-block; padding:.4rem .85rem; margin:0 .2rem;
  border:1px solid var(--border); border-radius:8px; font-size:.83rem;
}

/* ============ 响应式 ============ */
@media (max-width:768px){
  .site-header{
    top:8px; margin:8px 10px 0;
    padding:8px 8px 8px 16px;
    border-radius:999px; gap:10px;
  }
  .site-header h1{ font-size:.92rem; }
  .site-header nav{ gap:0; overflow-x:auto; }
  .site-header nav a{ padding:5px 8px; font-size:.78rem; white-space:nowrap; }
  .site-header nav a:nth-child(n+4){ display:none; }   /* 窄屏收起后两项 */
  .container{ padding:0 16px; }
  .post-card{ padding:1.25rem 1.25rem; }
  .post-content pre{ padding:2.2rem .85rem .85rem; font-size:.78rem; }
  .breadcrumb{ margin:3rem 0 1rem; }
}
