/*
Theme Name: S Modern
Theme URI: https://example.com/themes/s-modern
Author: 你名字
Version: 2.0.0
Description: 现代化、美观 UI、与插件高度兼容、SEO 优化，并支持超大 LOGO 的 WordPress 主题。
Text Domain: s-modern
*/

body {
    font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background: #f4f6fa;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    scroll-behavior: smooth;
}

/* 多背景方案 */
.bg-gradient-1 { background: linear-gradient(120deg, #f6f9ff, #eef7ff); }
.bg-gradient-2 { background: linear-gradient(120deg, #fff7f7, #ffeef0); }
.bg-gradient-3 { background: linear-gradient(120deg, #f7fff8, #eefdf4); }
.bg-solid { background: #f4f6fa; }

/* 推荐渐变背景样式 */
.bg-bluegreen { background: linear-gradient(135deg, #a5f3fc 0%, #93c5fd 50%, #60a5fa 100%); }
.bg-sunset { background: linear-gradient(135deg, #ffedd5 0%, #fdba74 50%, #fb7185 100%); }
.bg-mint { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%); }
.bg-gray-purple { background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 50%, #a78bfa 100%); }
.bg-tech-blue { background: linear-gradient(135deg, #e0f2fe 0%, #93c5fd 50%, #3b82f6 100%); }
.bg-night-neon { background: linear-gradient(135deg, #0f172a 0%, #1f2937 50%, #3b82f6 100%); }

.container {
    display: flex;
    max-width: 1200px;
    margin: auto;
    gap: 20px;
}

.content {
    flex: 3;
    padding: 20px;
}
.content.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* 全局变量：站点头部高度（用于子导航粘性定位） */
:root { --site-header-height: 100px; }

/* 首页二级导航条 */
.sub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  position: sticky;
  top: var(--site-header-height);
  z-index: 99;
  background: rgba(255,255,255,0.70);
  backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding: 8px 16px;
}
.sub-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sub-nav .has-dropdown { position: relative; }
.sub-nav .dropdown-menu {
  display: none;
  position: absolute;
  left: 0; top: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 12px;
  min-width: 520px;
  z-index: 1000;
}
.sub-nav .has-dropdown.is-open .dropdown-menu { display: block; }
.sub-nav .has-dropdown .pill { cursor: pointer; }
.sub-nav .has-dropdown.is-open > .pill { background: rgba(59,130,246,0.14); color: #0b5bd3; }
.sub-nav .dropdown-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sub-nav .dropdown-group .parent { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(59,130,246,0.10); color: #0b5bd3; text-decoration: none; font-weight: 600; }
.sub-nav .dropdown-group .parent.active { background: linear-gradient(90deg, #3b82f6, #0ea5e9); color: #fff; }
.sub-nav .dropdown-group .children { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sub-nav .dropdown-group .children a { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.80); border: 1px solid rgba(0,0,0,0.06); color: #222; text-decoration: none; }
.sub-nav .dropdown-group .children a:hover { background: rgba(255,255,255,0.95); }
.sub-nav .dropdown-group .children a.active { color: #fff; background: linear-gradient(90deg, #3b82f6, #0ea5e9); border-color: transparent; }
.sub-nav a { 
  display: inline-block; 
  padding: 8px 12px; 
  font-size: 14px; 
  color: #222; 
  text-decoration: none; 
  background: rgba(255,255,255,0.75); 
  border: 1px solid rgba(0,0,0,0.06); 
  border-radius: 999px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sub-nav a:hover { background: rgba(255,255,255,0.9); }
.sub-nav a.active { 
  color: #fff; 
  background: linear-gradient(90deg, #3b82f6, #0ea5e9); 
  border-color: transparent; 
}
.sub-nav .pill { padding: 8px 12px; border-radius: 999px; }

.sidebar {
    flex: 1;
    background: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* 文章页左侧快速导航（隐藏右侧侧栏） */
.single .toc-nav {
  flex: 0 0 220px;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(160%) blur(10px);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.single .toc-title {
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 8px;
  color: #111;
  position: relative;
}
.single .toc-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9);
  border-radius: 3px;
}
.single .toc-controls { display: flex; gap: 8px; font-size: 12px; color: #555; margin: 6px 0 10px; }
.single .toc-controls label { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; background: rgba(59,130,246,0.08); cursor: pointer; }
.single .toc-controls input { accent-color: #3b82f6; }
.single #toc ul { list-style: none; margin: 0; padding: 0; }
.single #toc li { margin: 2px 0; }
.single #toc li.h2 a { padding-left: 12px; }
.single #toc li.h3 a { margin-left: 10px; opacity: 0.9; padding-left: 18px; }
.single #toc a { position: relative; display: block; color: #333; text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.single #toc a::before { content: ""; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.single #toc a:hover { color: #0ea5e9; background: rgba(59,130,246,0.10); }
.single #toc a.active { color: #0b5bd3; background: rgba(59,130,246,0.16); }
.single #toc a.active::before { background: #3b82f6; }
.single .toc-tip { font-size: 12px; color: #777; margin-top: 8px; }

/* 标题滚动偏移，避免被粘性头部遮挡 */
.single article h1,
.single article h2,
.single article h3 { scroll-margin-top: 100px; }

/* 单篇文章页不显示右侧侧栏 */
.single .sidebar { display: none; }

.card {
    perspective: 1000px;
    position: relative;
    animation: card-breathe-scale 6s ease-in-out infinite;
    will-change: transform;
}
.card-inner {
    position: relative;
    width: 100%;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}
.card:hover .card-inner { transform: rotateY(180deg); }
.card-inner:hover { transform: rotateY(180deg); }
/* 补充：当父元素 hover 被覆盖时，直接在内层也触发 */
.card-inner:hover { transform: rotateY(180deg); }
.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #fff;
    animation: breathing-shadow 3s ease-in-out infinite;
}
.card-front .card-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.card-front .card-title { padding: 10px; font-size: 16px; margin: 0; color: #222; }
.card-back { transform: rotateY(180deg); padding: 16px; color: #222; }
.card-back { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.card-back .card-content { flex: 1; }
.card-back .card-title { margin: 0 0 8px; font-size: 18px; }
.card-excerpt { font-size: 15px; line-height: 1.6; color: #333; }
.card-back .download-btn {
  width: auto;
  margin-top: 12px;
  align-self: flex-start;
  padding: 10px 14px;
}
.card-link { position: absolute; inset: 0; z-index: 10; }

/* 侧栏美化（玻璃风格与模块化） */
.sidebar {
  backdrop-filter: saturate(160%) blur(10px);
  background: rgba(255,255,255,0.65);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.aside-card {
  background: rgba(255,255,255,0.75);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.aside-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 14px 0 10px;
  position: relative;
}
.aside-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9);
  border-radius: 3px;
}
.aside-list { list-style: none; padding: 0; margin: 0; }
.aside-list li { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 8px 6px; 
  border-bottom: 1px dashed rgba(0,0,0,0.08); 
}
.aside-list li:last-child { border-bottom: none; }
.aside-list a { color: #222; text-decoration: none; }
.aside-list a:hover { color: #0ea5e9; }
.aside-meta { font-size: 12px; color: #888; margin-left: auto; }
.aside-actions { display: flex; gap: 8px; margin-top: 8px; }
.aside-btn { 
  display: inline-block; 
  padding: 8px 12px; 
  background: #0078d7; 
  color: #fff; 
  text-decoration: none; 
  border-radius: 8px; 
}
.aside-btn:hover { background: #3b82f6; }
.tag-cloud a { 
  display: inline-block; 
  margin: 6px 8px 0 0; 
  padding: 6px 10px; 
  border-radius: 999px; 
  background: rgba(59,130,246,0.12); 
  color: #1e3a8a; 
  text-decoration: none; 
  transition: all .2s ease; 
}
.tag-cloud a:hover { background: rgba(59,130,246,0.22); color: #0f172a; }

@keyframes breathing-shadow {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
  50% { box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
}

@keyframes card-breathe-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

.download-btn {
    display: inline-block;
    padding: 10px 15px;
    background: #0078d7;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

/* 文章页标签 */
.post-tags { margin-top: 16px; }
.post-tags .tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags .tag { 
  display: inline-block; 
  padding: 6px 10px; 
  border-radius: 999px; 
  background: rgba(59,130,246,0.12); 
  color: #1e3a8a; 
  text-decoration: none; 
  transition: all .2s ease; 
}
.post-tags .tag:hover { background: rgba(59,130,246,0.22); color: #0f172a; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.65);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.site-header .site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
}
.site-logo img {
    max-height: 128px; /* 支持尽可能大的 LOGO */
    height: auto;
    width: auto;
}
.site-info { display: flex; flex-direction: column; }
.site-title { font-size: 28px; font-weight: 700; color: #111; text-decoration: none; letter-spacing: .2px; }
.site-description { margin: 2px 0 0; font-size: 14px; color: #444; }
.site-nav { border-top: 1px solid #eee; }
.site-nav .menu { list-style: none; display: flex; gap: 16px; padding: 10px 16px; margin: 0; max-width: 1200px; margin: 0 auto; }
.site-nav .menu li a { color: #333; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.site-nav .menu li a:hover { background: #f2f3f5; }
.bg-gradient-1 { background: linear-gradient(120deg, #f6f9ff, #eef7ff); }
.bg-gradient-2 { background: linear-gradient(120deg, #fff7f7, #ffeef0); }
.bg-gradient-3 { background: linear-gradient(120deg, #f7fff8, #eefdf4); }
.bg-solid { background: #f4f6fa; }
/* Win11 风格蓝色渐变背景 */
.bg-win11 {
    background:
      radial-gradient(1200px circle at 10% 10%, rgba(96,165,250,0.6) 0%, rgba(37,99,235,0.6) 35%, rgba(30,58,138,0.0) 60%),
      linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #1e40af 100%);
}
.breadcrumb {
  font-size: 13px;
  color: #666;
  margin: 8px 0 12px;
}
.breadcrumb a { color: #444; text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.breadcrumb a:hover { background: rgba(59,130,246,0.10); color: #0ea5e9; }
.breadcrumb .sep { margin: 0 6px; color: #999; }
.breadcrumb .current { color: #111; font-weight: 600; }
