/* ==========================================================================
   智汇空间 · 个人技术分享站
   配色：#008FD7 主色 / #005BAC 深蓝 / #F5F7FA 背景（沿用项目统一视觉）
   ========================================================================== */

:root {
  --ts-primary: #008FD7;
  --ts-deep: #005BAC;
  --ts-bg: #F5F7FA;
  --ts-text: #1F2A37;
  --ts-muted: #6B7A8C;
  --ts-line: #E4EAF0;
  --ts-card: #FFFFFF;
  --ts-radius: 12px;
  --ts-shadow: 0 2px 12px rgba(16, 42, 67, .06);
  --ts-shadow-hover: 0 8px 24px rgba(0, 143, 215, .16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ts-bg);
  color: var(--ts-text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ts-deep); text-decoration: none; }
a:hover { color: var(--ts-primary); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ============================ 顶部导航 ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ts-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ts-deep); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--ts-muted); letter-spacing: .5px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 14px; border-radius: 8px; font-size: 14px;
  color: #41546B; transition: all .18s;
}
.nav a:hover { background: #EAF5FC; color: var(--ts-deep); }

.nav-toggle {
  display: none; border: 1px solid var(--ts-line); background: #fff;
  border-radius: 8px; width: 38px; height: 34px; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--ts-deep);
}

/* ============================ 首屏 ============================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #00649B 0%, #008FD7 55%, #28A9E8 100%);
  color: #fff;
  padding: 84px 0 76px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.18) 0, transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.12) 0, transparent 36%),
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-tag {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 13px; letter-spacing: .5px; margin-bottom: 20px;
}
.hero h1 { margin: 0 0 16px; font-size: 40px; line-height: 1.3; letter-spacing: -0.5px; }
.hero h1 em { font-style: normal; border-bottom: 3px solid rgba(255, 255, 255, .55); padding-bottom: 2px; }
.hero p { margin: 0 0 30px; max-width: 680px; font-size: 16px; color: rgba(255, 255, 255, .9); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 9px; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.btn-light { background: #fff; color: var(--ts-deep); font-weight: 600; }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); color: var(--ts-deep); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.hero-stats {
  margin-top: 44px; display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.hero-stat {
  padding: 16px 18px; border-radius: var(--ts-radius);
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
}
.hero-stat b { display: block; font-size: 26px; line-height: 1.2; }
.hero-stat span { font-size: 13px; color: rgba(255, 255, 255, .84); }

/* ============================ 区块 ============================ */
.section { padding: 68px 0; }
.section.alt { background: #fff; }

.section-head { margin-bottom: 34px; }
.section-head h2 {
  margin: 0 0 8px; font-size: 26px; color: var(--ts-deep); letter-spacing: -0.3px;
}
.section-head h2::after {
  content: ""; display: block; width: 44px; height: 3px; margin-top: 10px;
  background: linear-gradient(90deg, var(--ts-primary), #6EC6EF);
  border-radius: 2px;
}
.section-head p { margin: 0; color: var(--ts-muted); font-size: 14px; }

/* ============================ 卡片网格 ============================ */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--ts-card);
  border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius);
  padding: 24px;
  box-shadow: var(--ts-shadow);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--ts-shadow-hover); border-color: #BFE3F6; }

.card .icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 16px;
  background: #EAF5FC; color: var(--ts-primary);
  display: flex; align-items: center; justify-content: center;
}
.card .icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 10px; font-size: 17px; color: var(--ts-deep); }
.card p { margin: 0; color: var(--ts-muted); font-size: 14px; }

/* ============================ 文章列表 ============================ */
.posts { display: grid; gap: 14px; }
.post {
  display: flex; align-items: flex-start; gap: 18px;
  background: #fff; border: 1px solid var(--ts-line);
  border-radius: var(--ts-radius); padding: 20px 22px;
  transition: all .2s;
}
.post:hover { border-color: #BFE3F6; box-shadow: var(--ts-shadow); transform: translateX(4px); }
.post .date {
  flex: 0 0 76px; text-align: center; border-right: 1px solid var(--ts-line);
  padding-right: 16px; color: var(--ts-muted);
}
.post .date b { display: block; font-size: 22px; color: var(--ts-deep); line-height: 1.2; }
.post .date span { font-size: 12px; }
.post h3 { margin: 0 0 6px; font-size: 16px; color: var(--ts-text); }
.post:hover h3 { color: var(--ts-primary); }
.post p { margin: 0 0 10px; font-size: 13.5px; color: var(--ts-muted); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: #F0F6FB; color: var(--ts-deep); border: 1px solid #DCEAF5;
}

/* ============================ 标签页 ============================ */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tab {
  padding: 9px 18px; border-radius: 9px; font-size: 14px; cursor: pointer;
  background: #fff; border: 1px solid var(--ts-line); color: #41546B;
  font-family: inherit; transition: all .18s;
}
.tab:hover { border-color: var(--ts-primary); color: var(--ts-deep); }
.tab.active {
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-deep));
  border-color: transparent; color: #fff; font-weight: 600;
}
.pane { display: none; }
.pane.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================ 关于我 ============================ */
.about { display: grid; grid-template-columns: 280px 1fr; gap: 34px; align-items: start; }
.profile {
  background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius);
  padding: 28px 24px; text-align: center; box-shadow: var(--ts-shadow);
}
.avatar {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-deep));
  color: #fff; font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.profile h3 { margin: 0 0 4px; font-size: 18px; color: var(--ts-deep); }
.profile .role { font-size: 13px; color: var(--ts-muted); margin-bottom: 18px; }
.profile .meta { text-align: left; font-size: 13.5px; color: #41546B; }
.profile .meta div { padding: 7px 0; border-top: 1px dashed var(--ts-line); display: flex; gap: 8px; }
.profile .meta b { flex: 0 0 46px; color: var(--ts-muted); font-weight: 400; }

.skills { display: grid; gap: 16px; }
.skill { }
.skill .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.skill .top span:last-child { color: var(--ts-muted); font-size: 13px; }
.skill .track { height: 8px; border-radius: 999px; background: #E8EEF4; overflow: hidden; }
.skill .fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--ts-primary), #5FBDEC);
  width: 0; transition: width 1s cubic-bezier(.2, .8, .3, 1);
}

/* ============================ 联系 ============================ */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.contact-item {
  background: #fff; border: 1px solid var(--ts-line); border-radius: var(--ts-radius);
  padding: 22px; text-align: center; transition: all .2s;
}
.contact-item:hover { border-color: #BFE3F6; box-shadow: var(--ts-shadow); }
.contact-item .ico { font-size: 24px; margin-bottom: 10px; }
.contact-item h4 { margin: 0 0 6px; font-size: 15px; color: var(--ts-deep); }
.contact-item p { margin: 0; font-size: 13.5px; color: var(--ts-muted); word-break: break-all; }

/* ============================ 页脚 ============================ */
.site-footer {
  background: #0E3A57; color: rgba(255, 255, 255, .72);
  padding: 46px 0 26px; font-size: 13.5px;
}
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px;
  padding-bottom: 26px; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; margin-bottom: 12px; }
.footer-brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--ts-primary), #35A3DC);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 12px; font-weight: 600; }
.site-footer a { color: rgba(255, 255, 255, .72); display: block; padding: 3px 0; font-size: 13.5px; }
.site-footer a:hover { color: #fff; }

/* ===== 备案信息（关键：底部可见 + 链接工信部） ===== */
.footer-bottom {
  padding-top: 22px; text-align: center; font-size: 13px;
  color: rgba(255, 255, 255, .6); line-height: 2.1;
}
.footer-bottom .sep { margin: 0 10px; opacity: .45; }
.beian-link {
  color: rgba(255, 255, 255, .82) !important;
  display: inline-block !important;
  padding: 0 !important;
  transition: color .18s;
}
.beian-link:hover { color: #fff !important; text-decoration: underline; }
.beian-link .beian-icon {
  display: inline-block; vertical-align: -2px; margin-right: 5px;
  width: 14px; height: 14px;
}
/* 公安联网备案徽标（36x40 原图，按高 15px 等比缩放） */
.beian-link .gongan-icon {
  display: inline-block; vertical-align: -3px; margin-right: 4px;
  height: 15px; width: auto;
}

/* ============================ 返回顶部 ============================ */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--ts-deep); border: 1px solid var(--ts-line);
  box-shadow: 0 4px 16px rgba(16, 42, 67, .14);
  cursor: pointer; font-size: 17px; line-height: 1;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--ts-primary); color: #fff; border-color: var(--ts-primary); }

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  .grid-3, .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--ts-line);
    padding: 8px 16px 14px; box-shadow: 0 8px 20px rgba(16, 42, 67, .08);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
  .grid-3, .grid-2, .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 22px; }
  .hero { padding: 56px 0 50px; }
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 15px; }
  .section { padding: 48px 0; }
  .post { flex-direction: column; gap: 10px; }
  .post .date { border-right: none; border-bottom: 1px solid var(--ts-line); padding: 0 0 8px; text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .post .date b { font-size: 17px; }
  .to-top { right: 16px; bottom: 16px; }
}

@media print {
  .site-header, .to-top, .hero-actions { display: none; }
}
