/* =========================================================
   Blue Fish · 蓝色大肥鱼主题
   文件名必须为 theme-blue-fish.css
   ========================================================= */

:root {
  --accent: #3b82f6;
  --bg: #f5f9ff;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #dbeafe;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(59, 130, 246, 0.10);
  --header-bg: rgba(255, 255, 255, 0.82);
}

html.dark {
  --bg: #0b1220;
  --card: #111a2e;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e2d4a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(11, 18, 32, 0.82);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(59, 130, 246, 0.25);
}

/* ---------- Header ---------- */

.t-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.25s ease;
}

.t-header.is-scrolled {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

html.dark .t-header.is-scrolled {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30);
}

.t-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.t-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.t-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.t-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.t-nav a:hover {
  color: var(--accent);
}

#dark-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

#dark-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#dark-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

#dark-toggle .icon-dark {
  display: none;
}

html.dark #dark-toggle .icon-dark {
  display: block;
}

html.dark #dark-toggle .icon-light {
  display: none;
}

/* ---------- Layout ---------- */

.t-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 20px;
}

/* ---------- Hero ---------- */

.t-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 48px 40px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 55%, #f0f9ff 100%);
}

.t-hero::after {
  content: "🐟";
  position: absolute;
  right: 32px;
  bottom: -10px;
  font-size: 120px;
  line-height: 1;
  opacity: 0.14;
  transform: rotate(-8deg);
  pointer-events: none;
}

html.dark .t-hero {
  background: linear-gradient(135deg, #0f1d3a 0%, #0b1220 100%);
}

.t-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.t-hero-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.t-hero h1 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
}

.t-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- Article List ---------- */

.t-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.t-card {
  display: flex;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.t-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.18);
}

html.dark .t-card:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.40);
}

.t-card-cover {
  flex: 0 0 240px;
  width: 240px;
  height: 168px;
  overflow: hidden;
  background: var(--border);
}

.t-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.t-card:hover .t-card-cover img {
  transform: scale(1.04);
}

.t-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 22px 24px;
}

.t-card-body h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.4;
}

.t-card-body h2 a {
  color: var(--text);
  text-decoration: none;
}

.t-card-body h2 a:hover {
  color: var(--accent);
}

.t-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.t-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.t-cat {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
}

html.dark .t-cat {
  background: rgba(59, 130, 246, 0.20);
}

.t-empty {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

/* 卡片渐入，仅在 JS 可用时启用，避免无 JS 时不可见 */
.has-js .t-card,
.has-js .t-recommend-card {
  opacity: 0;
}

.has-js .t-card.is-visible,
.has-js .t-recommend-card.is-visible {
  opacity: 1;
}

/* ---------- Post ---------- */

.t-post {
  max-width: 820px;
  margin: 0 auto;
}

.t-post-header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  line-height: 1.3;
}

.t-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.t-meta a {
  color: var(--accent);
  text-decoration: none;
}

.t-draft {
  padding: 2px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
}

html.dark .t-draft {
  background: #422006;
  color: #fbbf24;
}

.t-post-cover {
  overflow: hidden;
  margin-bottom: 28px;
  border-radius: var(--radius);
}

.t-post-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.post-body {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin: 1.8em 0 0.7em;
  line-height: 1.35;
}

.post-body p {
  margin: 1em 0;
}

.post-body a {
  color: var(--accent);
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.post-body blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(59, 130, 246, 0.07);
  color: var(--muted);
}

.post-body pre {
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.post-body :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  font-size: 0.9em;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
}

.post-body .nb-table-wrap {
  overflow-x: auto;
}

.post-body th,
.post-body td {
  padding: 8px 12px;
  border: 1px solid var(--border);
}

html.dark .post-body pre {
  border: 1px solid var(--border);
  background: #020617;
}

/* ---------- Prev / Next ---------- */

.t-around {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 820px;
  margin: 32px auto 0;
}

.t-around a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.t-around a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.t-around small {
  color: var(--muted);
  font-size: 0.8rem;
}

.t-around b {
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ---------- Recommend ---------- */

.t-recommend {
  max-width: 820px;
  margin: 36px auto 0;
}

.t-recommend h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.t-recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.t-recommend-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.t-recommend-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.t-recommend-card img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.t-recommend-card span {
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.t-footer {
  padding: 40px 20px 80px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.t-footer a {
  color: var(--accent);
  text-decoration: none;
}

.t-footer-tip {
  margin-top: 6px;
  opacity: 0.7;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .t-header {
    padding: 10px 14px;
  }

  .t-brand span {
    font-size: 0.95rem;
  }

  .t-nav {
    gap: 10px;
  }

  .t-nav a {
    font-size: 0.82rem;
  }

  .t-main {
    padding: 20px 14px;
  }

  .t-hero {
    padding: 32px 22px;
    border-radius: 22px;
  }

  .t-hero::after {
    right: 10px;
    font-size: 80px;
  }

  .t-card {
    flex-direction: column;
  }

  .t-card-cover {
    flex: none;
    width: 100%;
    height: 190px;
  }

  .t-card-body {
    padding: 18px;
  }

  .t-card-body h2 {
    font-size: 1.15rem;
  }

  .t-around {
    grid-template-columns: 1fr;
  }

  .t-recommend-grid {
    grid-template-columns: 1fr;
  }

  .t-recommend-card img {
    height: 150px;
  }

  .t-footer {
    padding-bottom: 110px;
  }
}