/* ========================================
 * Tangobear Blog - 现代极简风格
 * 设计：深色导航 + 纯白内容 + 毛玻璃特效
 * ======================================== */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --header-bg: #0f172a;
  --header-text: #f1f5f9;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 全局 ---------- */
* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover, a:active {
  color: var(--primary-dark);
}

/* ---------- 头部导航 ---------- */
#header {
  background: var(--header-bg);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.site-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

#logo {
  color: #fff;
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
#logo:hover {
  opacity: 0.85;
}

.description {
  color: var(--text-lighter);
  font-size: 0.85em;
  font-style: normal;
  margin: 0;
  display: none;
}

/* 导航菜单 */
#nav-menu {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
#nav-menu a {
  display: block;
  padding: 8px 16px;
  border: none;
  height: auto;
  line-height: 1.4;
  color: var(--text-lighter);
  float: none;
  font-size: 0.9em;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
#nav-menu a:hover,
#nav-menu .current {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* 搜索框 */
#search {
  margin: 0;
  position: relative;
}
#search input.text {
  padding: 8px 36px 8px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.85em;
  width: 200px;
  transition: var(--transition);
  outline: none;
}
#search input.text::placeholder {
  color: var(--text-lighter);
}
#search input.text:focus {
  border-color: var(--primary-light);
  background: rgba(255,255,255,0.12);
  width: 240px;
}
#search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
  text-indent: -9999em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat center;
  background-size: 18px;
}
#search button:hover {
  opacity: 1;
}

/* ---------- 主内容 ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.col-mb-12 {
  width: 100%;
}

.col-9 {
  flex: 1;
  min-width: 0;
}

.col-3 {
  width: 280px;
  flex-shrink: 0;
}

/* 文章卡片 */
.post {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin: 24px 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.post:hover {
  box-shadow: var(--shadow-lg);
}

.post-title {
  margin: 0 0 12px;
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.3;
}
.post-title a {
  color: var(--text);
}
.post-title a:hover {
  color: var(--primary);
}

.post-meta {
  margin: 0 0 20px;
  padding: 0;
  color: var(--text-light);
  font-size: 0.85em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.post-meta li {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
}
.post-meta li + li::before {
  content: "·";
  margin: 0 8px;
  color: var(--text-lighter);
}
.post-meta a {
  color: var(--text-light);
  border: none;
}
.post-meta a:hover {
  color: var(--primary);
}

.post-content {
  line-height: 1.8;
  color: var(--text);
  font-size: 0.95em;
}
.post-content p {
  margin: 0 0 1.2em;
}

/* 阅读更多 */
.more {
  margin-top: 20px;
  text-align: left;
}
.more a {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.85em;
  font-weight: 500;
  transition: var(--transition);
}
.more a:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- 文章内容样式 ---------- */
.post-content h2, .comment-content h2 {
  font-size: 1.4em;
  margin: 1.5em 0 0.6em;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.post-content h3, .comment-content h3 {
  font-size: 1.2em;
  margin: 1.2em 0 0.5em;
  font-weight: 600;
}
.post-content h4, .comment-content h4 {
  font-size: 1.05em;
  font-weight: 600;
}

.post-content img, .comment-content img,
.post-content video, .comment-content video {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.2em 0;
}
.post-content a img, .comment-content a img {
  background: none;
  position: static;
  bottom: auto;
}

blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.6;
  margin: 1.2em 0;
}
code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;
}
pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  display: block;
}

hr {
  margin: 2em auto;
  width: 60px;
  border: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.9em;
}
table th, table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
table th {
  background: #f8fafc;
  font-weight: 600;
}

/* ---------- 标签 ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.tags a {
  display: inline-block;
  padding: 3px 12px;
  background: #f1f5f9;
  color: var(--text-light);
  border-radius: 14px;
  font-size: 0.8em;
  transition: var(--transition);
}
.tags a:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- 分页 ---------- */
.page-navigator {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.page-navigator li {
  display: inline-block;
  margin: 0;
}
.page-navigator a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85em;
  transition: var(--transition);
}
.page-navigator a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}
.page-navigator .current a {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- 侧边栏 ---------- */
#secondary {
  padding-top: 24px;
}
.widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 0.95em;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget-list li {
  margin: 6px 0;
  line-height: 1.6;
}
.widget-list a {
  color: var(--text-light);
  font-size: 0.9em;
}
.widget-list a:hover {
  color: var(--primary);
}

/* ---------- 评论 ---------- */
#comments {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.comment-list, .comment-list ol {
  list-style: none;
  padding: 0;
}
.comment-list li {
  padding: 16px 0;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border);
}
.comment-list li:last-child {
  border-bottom: none;
}
.comment-list li.comment-level-odd,
.comment-list li.comment-level-even {
  background: transparent;
}
.comment-list li.comment-by-author {
  background: transparent;
}
.comment-author .avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.comment-author cite {
  font-weight: 600;
  font-style: normal;
}
.comment-meta {
  font-size: 0.85em;
  color: var(--text-lighter);
}
.comment-content {
  font-size: 0.9em;
  line-height: 1.7;
  margin-top: 8px;
}

/* 评论表单 */
#comment-form label {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 6px;
}
#comment-form input,
#comment-form textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9em;
  transition: var(--transition);
  outline: none;
}
#comment-form input:focus,
#comment-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
#comment-form .submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
#comment-form .submit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ---------- 页脚 ---------- */
#footer {
  background: var(--header-bg);
  color: var(--text-lighter);
  padding: 40px 0;
  text-align: center;
  font-size: 0.85em;
  margin-top: 40px;
}
#footer a {
  color: var(--text-lighter);
}
#footer a:hover {
  color: #fff;
}

/* ---------- 归档页 ---------- */
.archive-title {
  margin: 24px 0 0;
  color: var(--text-light);
  font-size: 0.9em;
  font-weight: 500;
}
.post-near {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 0.9em;
}
.post-near li {
  margin: 8px 0;
}

/* ---------- 骨架屏 / 加载动画 ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.post {
  animation: fadeInUp 0.4s ease both;
}
.post:nth-child(2) { animation-delay: 0.05s; }
.post:nth-child(3) { animation-delay: 0.1s; }
.post:nth-child(4) { animation-delay: 0.15s; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  .row {
    flex-direction: column;
  }
  .col-3 {
    width: 100%;
  }
  #header .container {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
  }
  #nav-menu {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  #nav-menu a {
    padding: 6px 12px;
    font-size: 0.85em;
  }
  #search input.text {
    width: 160px;
  }
  #search input.text:focus {
    width: 180px;
  }
  .post {
    padding: 20px;
    margin: 16px 0;
  }
  .post-title {
    font-size: 1.3em;
  }
  .site-name {
    flex: 1;
  }
  .description {
    display: none;
  }
  #header,
  .post-title,
  .post-meta {
    text-align: left;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  .post {
    padding: 16px;
    border-radius: var(--radius-sm);
  }
  .post-title {
    font-size: 1.15em;
  }
  #search input.text {
    width: 130px;
  }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- 选中文本 ---------- */
::selection {
  background: rgba(37,99,235,0.2);
  color: var(--text);
}

/* ---------- 暗色模式支持 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --text-lighter: #64748b;
    --border: #334155;
    --header-bg: #020617;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
  }
  a { color: #60a5fa; }
  a:hover { color: #93c5fd; }
  blockquote { background: #1e293b; }
  code { background: #334155; color: #fda4af; }
  .tags a { background: #334155; }
  .tags a:hover { background: var(--primary); }
  .page-navigator a:hover { background: #1e293b; }
  table th { background: #1e293b; }
  #comment-form input:focus,
  #comment-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(96,165,250,0.15);
  }
  ::selection {
    background: rgba(96,165,250,0.3);
  }
}