/* ==========================================================================
   纯净盐神 (YanShen Pure) - Claude 官方优雅质感主题
   字体全量采用【微软雅黑】(Microsoft YaHei)，融合 Claude 陶土温润设计语言
   ========================================================================== */

:root {
  --color-mode: "light";
  
  /* Claude 官方暖阳纸质色彩体系 */
  --bg: #f5f4ed;
  --bg-card: #ffffff;
  --bg-soft: #faf9f5;
  --bg-alt: #edebe1;
  --bg-mute: #e8e6dc;
  --divider: #e0ddcf;
  --border-card: #e8e6dc;
  
  /* 正文与辅助文字 */
  --t1: #141413;       /* 浓墨纯黑 */
  --t2: #5e5d59;       /* 优雅中灰 */
  --t3: #87867f;       /* 弱化浅灰 */
  
  /* Claude 陶土红 (Terracotta) 品牌强调色 */
  --brand-1: #c96442;
  --brand-2: #b4573a;
  --brand-3: #d97757;
  --brand-soft: rgba(201, 100, 66, 0.08);
  --brand-border: rgba(201, 100, 66, 0.24);
  
  --shadow-sm: 0 1px 3px rgba(20, 20, 19, 0.04);
  --shadow-card: 0 2px 8px rgba(20, 20, 19, 0.04);
  --shadow-hover: 0 6px 16px rgba(201, 100, 66, 0.08);
  
  --navbar-bg: rgba(245, 244, 237, 0.92);
  --font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --reader-font-size: 17.5px;
  --reader-line-height: 1.85;
}

[data-user-color-scheme="dark"] {
  --color-mode: "dark";
  
  /* Claude 官方夜间深色画布 */
  --bg: #141413;
  --bg-card: #1f1f1b;
  --bg-soft: #1a1a17;
  --bg-alt: #232320;
  --bg-mute: #2b2b27;
  --divider: #2b2b27;
  --border-card: #30302c;
  
  --t1: #faf9f5;       /* 宣纸暖白 */
  --t2: #b0aea5;       /* 银灰 */
  --t3: #87867f;       /* 灰弱 */
  
  --brand-1: #d97757;
  --brand-2: #e08a6d;
  --brand-3: #c96442;
  --brand-soft: rgba(217, 119, 87, 0.14);
  --brand-border: rgba(217, 119, 87, 0.32);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, 0.35);
  
  --navbar-bg: rgba(20, 20, 19, 0.94);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--t1);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* 顶部轻量阅读进度条 */
.progress-bar-top {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--brand-1);
  z-index: 1100;
  width: 0%;
  transition: width 0.1s ease;
}

/* 顶部 Claude 极简导航条 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  background-color: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-badge {
  width: 30px;
  height: 30px;
  background: var(--brand-1);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(201, 100, 66, 0.25);
}

.brand-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-1);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 1px 7px;
  border-radius: 999px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--t2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-btn:hover {
  color: var(--brand-1);
  background: var(--brand-soft);
}

.nav-btn.active {
  color: var(--brand-1);
  background: var(--brand-soft);
  font-weight: 600;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--t2);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-alt);
  border-color: var(--divider);
  color: var(--t1);
}

/* 主内容容器 */
.main-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 24px auto 60px;
  padding: 0 20px;
  flex: 1;
}

/* 顶部欢迎卡片 (Claude Hero) */
.claude-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.claude-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-1);
}

.hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-desc {
  font-size: 14.5px;
  color: var(--t2);
  line-height: 1.65;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
  font-size: 13px;
  color: var(--t3);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-meta-item strong {
  color: var(--brand-1);
  font-weight: 700;
}

/* 快捷搜索栏 */
.search-bar-claude {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-bar-claude:focus-within {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-icon-claude {
  color: var(--t3);
  margin-right: 10px;
  font-size: 15px;
}

.search-input-claude {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 14.5px;
  font-family: var(--font-family);
  color: var(--t1);
  outline: none;
}

.search-input-claude::placeholder {
  color: var(--t3);
}

.search-shortcut-hint {
  font-size: 11px;
  color: var(--t3);
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--divider);
  user-select: none;
}

/* 分类标签滚动条 (Chips) */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.category-filter-bar::-webkit-scrollbar {
  height: 4px;
}
.category-filter-bar::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 2px;
}

.filter-chip {
  padding: 5px 13px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--t2);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: var(--brand-1);
  border-color: var(--brand-1);
}

.filter-chip.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-1);
  font-weight: 600;
}

/* 文章卡片列表 (.claude-card) */
.articles-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.claude-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.claude-card:hover {
  border-color: var(--brand-1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card-article-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.45;
  transition: color 0.15s ease;
}

.claude-card:hover .card-article-title {
  color: var(--brand-1);
}

.card-excerpt-text {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.65;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--t3);
  padding-top: 10px;
  border-top: 1px dashed var(--divider);
}

.card-tag-pill {
  color: var(--brand-1);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
}

.tag-preset {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* 分页器 */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
}

.claude-page-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--t2);
  font-size: 13.5px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.15s ease;
}

.claude-page-btn:hover {
  border-color: var(--brand-1);
  color: var(--brand-1);
}

.claude-page-btn.active {
  background: var(--brand-1);
  color: #fff;
  border-color: var(--brand-1);
  font-weight: 600;
}

.claude-page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 全分类网格视图 (.categories-grid) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.cat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-box:hover {
  border-color: var(--brand-1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cat-box-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--t1);
}

.cat-box-count {
  font-size: 12px;
  color: var(--t3);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 10px;
}

/* 正文阅读排版 (.article-detail-view) */
.article-detail-view {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
}

.article-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 13.5px;
  color: var(--t3);
}

.back-link {
  color: var(--brand-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.article-main-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.4;
  margin-bottom: 14px;
}

.article-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--t3);
  margin-bottom: 24px;
}

/* Markdown 正文字体与排版 */
.markdown-body {
  font-size: var(--reader-font-size);
  line-height: var(--reader-line-height);
  color: var(--t1);
  word-break: break-word;
}

.markdown-body p {
  margin-bottom: 1.45em;
  text-align: justify;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin: 1.8em 0 0.8em;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.35;
}

.markdown-body h1 {
  font-size: 1.45em;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 0.4em;
}

.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.15em; }

.markdown-body blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  border-left: 4px solid var(--brand-1);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  color: var(--t2);
}

.markdown-body hr {
  border: none;
  border-top: 1px dashed var(--divider);
  margin: 2.4em 0;
}

/* 正文底部换篇导航 */
.post-switch-nav {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.switch-nav-card {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.switch-nav-card:hover {
  border-color: var(--brand-1);
  background: var(--brand-soft);
}

.switch-label {
  font-size: 11.5px;
  color: var(--t3);
  margin-bottom: 4px;
}

.switch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 优雅浮层搜索 Modal */
.claude-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20, 20, 19, 0.45);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.claude-modal {
  width: 92%;
  max-width: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.claude-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: var(--font-family);
  color: var(--t1);
  outline: none;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--t3);
  cursor: pointer;
}

.modal-search-list {
  max-height: 52vh;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--brand-soft);
}

.result-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--t1);
}

.result-meta {
  font-size: 12px;
  color: var(--t3);
  margin-top: 2px;
}

/* 页脚 */
.site-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--t3);
  border-top: 1px solid var(--divider);
  background: var(--bg);
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background-color: rgba(20, 20, 19, 0.92);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: all 0.22s ease;
  z-index: 3000;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   响应式移动端深度适配 (Mobile & Tablet Responsiveness)
   ========================================================================== */

@media (max-width: 768px) {
  .navbar {
    height: 56px;
  }
  
  .nav-container {
    padding: 0 12px;
  }
  
  .brand-badge {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 7px;
  }

  .brand-text {
    font-size: 16px;
  }
  
  .navbar-brand .clean-pill {
    display: none; /* 移动端隐藏较长标贴，腾出空间防止导航栏控件挤碎换行 */
  }
  
  .navbar-links {
    gap: 4px;
  }
  
  .nav-btn {
    padding: 5px 8px;
    font-size: 12.5px;
    gap: 3px;
    border-radius: 6px;
  }
  
  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .main-wrapper {
    margin: 14px auto 40px;
    padding: 0 12px;
  }
  
  .claude-hero {
    padding: 16px 15px;
    margin-bottom: 14px;
    border-radius: 12px;
  }
  
  .hero-title {
    font-size: 17.5px;
    line-height: 1.4;
    flex-wrap: wrap;
    gap: 6px;
  }

  .hero-title .clean-pill {
    font-size: 10.5px;
    padding: 1px 6px;
  }
  
  .hero-desc {
    font-size: 13px;
    line-height: 1.55;
  }
  
  .hero-meta-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    margin-top: 12px;
    padding-top: 10px;
    font-size: 12px;
  }
  
  .search-bar-claude {
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  
  .search-shortcut-hint {
    display: none; /* 手机端没有物理 / 键，隐藏以释放输入空间 */
  }
  
  .search-input-claude {
    font-size: 13.5px;
  }
  
  .category-filter-bar {
    padding-bottom: 6px;
    margin-bottom: 14px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .category-filter-bar::-webkit-scrollbar {
    display: none;
  }
  
  .filter-chip {
    padding: 4px 10px;
    font-size: 12px;
  }
  
  .claude-card {
    padding: 14px 15px;
    border-radius: 10px;
  }
  
  .card-article-title {
    font-size: 15.5px;
    line-height: 1.4;
  }
  
  .card-excerpt-text {
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 8px;
  }
  
  .card-bottom-row {
    font-size: 11.5px;
    padding-top: 8px;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .pagination-row {
    gap: 4px;
    margin-top: 20px;
    padding-top: 14px;
    flex-wrap: wrap;
  }
  
  .claude-page-btn {
    padding: 5px 9px;
    font-size: 12px;
    min-width: 32px;
    border-radius: 6px;
  }
  
  .article-detail-view {
    padding: 18px 14px;
    border-radius: 10px;
  }
  
  .article-top-nav {
    margin-bottom: 16px;
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .article-top-nav .claude-page-btn {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  
  .article-main-title {
    font-size: 19.5px;
    line-height: 1.35;
    margin-bottom: 10px;
  }
  
  .article-header-meta {
    font-size: 11.5px;
    gap: 6px 10px;
    margin-bottom: 16px;
  }
  
  .markdown-body {
    font-size: 16px;
    line-height: 1.8;
  }

  .markdown-body p {
    margin-bottom: 1.25em;
  }
  
  .markdown-body blockquote {
    padding: 10px 14px;
    margin: 1.2em 0;
  }
  
  .post-switch-nav {
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
  }
  
  .switch-nav-card {
    width: 100%;
    text-align: left !important;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .cat-box {
    padding: 12px 14px;
  }
  
  .cat-box-name {
    font-size: 13.5px;
  }
  
  .claude-modal-backdrop {
    padding: 10px;
    padding-top: 16px;
    align-items: flex-start;
  }
  
  .claude-modal {
    width: 100%;
    max-height: 88vh;
    border-radius: 12px;
  }
  
  .claude-modal-header {
    padding: 12px 14px;
  }
  
  .modal-search-input {
    font-size: 15px;
  }
  
  .modal-search-list {
    max-height: 60vh;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .navbar-links {
    gap: 2px;
  }
  
  .nav-btn {
    padding: 4px 6px;
    font-size: 11.5px;
  }
  
  .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 12.5px;
  }
  
  .brand-badge {
    width: 25px;
    height: 25px;
    font-size: 12.5px;
    border-radius: 6px;
  }
  
  .brand-text span:first-child {
    font-size: 14.5px;
  }
  
  .claude-hero {
    padding: 14px 12px;
  }
  
  .hero-title {
    font-size: 15.5px;
  }
  
  .hero-meta-row {
    font-size: 11px;
    gap: 6px;
  }
  
  .card-article-title {
    font-size: 14.5px;
  }
  
  .claude-page-btn {
    padding: 4px 7px;
    font-size: 11px;
    min-width: 26px;
  }
}
