/* ============================================================
   OmniDex 技术博客 · 博客园自定义皮肤 v2（海洋单栏版）
   风格：海洋主题 / 单栏沉浸 / 交互大图 / 鲸鱼 + 水花特效
   配套：cnblogs-effects.js（需博客园 JS 权限，放「页脚HTML代码」）
   用法：后台 → 设置 →「页面定制CSS代码」→ 勾「禁用模板默认CSS」→ 粘贴
   ------------------------------------------------------------
   想换顶部背景图：见 #header 处的注释说明
   想换主题色：改 --accent 系列变量
   ============================================================ */

/* ---------- 0. 主题变量 ---------- */
:root {
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-soft: #ccfbf1;
  --bg: #eef4f8;
  --card: #ffffff;
  --text: #243040;
  --text-soft: #5b6b7d;
  --border: #e2e8f0;
  --code-bg: #1e2733;
  --code-text: #e6edf3;
  --shadow: 0 4px 18px rgba(30, 50, 70, .08);
  --radius: 12px;
  --maxw: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2dd4bf;
    --accent-dark: #5eead4;
    --accent-soft: #134e4a;
    --bg: #0d1218;
    --card: #161e27;
    --text: #d3dae3;
    --text-soft: #8b98a8;
    --border: #26303d;
    --code-bg: #0b0f14;
    --code-text: #dbe4ee;
    --shadow: 0 4px 18px rgba(0, 0, 0, .35);
  }
}

/* ---------- 1. 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; border-radius: 8px; }

#home {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 40px;
  background: transparent;
  width: auto;
  box-shadow: none;
}

/* ---------- 2. 顶部交互大图（全宽出血）---------- */
#header {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 280px;
  padding: 80px calc(50vw - var(--maxw) / 2 + 16px) 90px;
  overflow: hidden;
  color: #fff;
  background-color: #0b486b;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(45, 212, 191, .35), transparent 55%),
    linear-gradient(135deg, #08334f 0%, #0b5e7e 45%, #0d9488 100%);
  background-size: cover, cover;
  background-position: center;
  transition: background-position-x .25s ease-out;
}
/* 想换成自己的背景图：把上面 background-image 两行整体替换为
   background-image:
     linear-gradient(rgba(8, 40, 60, .35), rgba(8, 40, 60, .45)),
     url('https://你的图片地址.jpg');
   （前面的半透明渐变是文字遮罩，保证标题看得清）*/
#header h1 { margin: 0 0 8px; font-size: 38px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 3px 14px rgba(0,0,0,.3); }
#header h1 a { color: #fff; }
#header h1 a:hover { color: #b8fff5; text-decoration: none; }
#header .subtitle, #Header1_HeaderTitle { color: rgba(255,255,255,.85); font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.25); }

/* 顶部漂浮气泡层（JS 生成 .du-bubble）*/
.du-bubbles { position: absolute; inset: 0; pointer-events: none; }
.du-bubble {
  position: absolute;
  bottom: -30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.7), rgba(255,255,255,.08));
  animation: du-rise linear infinite;
}
@keyframes du-rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .5; }
  100% { transform: translateY(-340px) translateX(var(--drift, 20px)); opacity: 0; }
}

/* 底部两层波浪 */
#header::before, #header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 70px;
  background-repeat: repeat-x;
  background-size: 1440px 70px;
}
#header::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 70' preserveAspectRatio='none'%3E%3Cpath fill='%23eef4f8' d='M0,30 C240,70 480,0 720,25 C960,50 1200,65 1440,20 L1440,70 L0,70 Z'/%3E%3C/svg%3E");
}
#header::before {
  height: 90px;
  bottom: -2px;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' d='M0,50 C300,10 600,80 900,45 C1140,18 1320,70 1440,40 L1440,90 L0,90 Z'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  #header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 70' preserveAspectRatio='none'%3E%3Cpath fill='%230d1218' d='M0,30 C240,70 480,0 720,25 C960,50 1200,65 1440,20 L1440,70 L0,70 Z'/%3E%3C/svg%3E");
  }
}

/* ---------- 3. 导航移走，不占版面 ---------- */
#navigator { display: none; }

/* ---------- 4. 单栏沉浸布局 ---------- */
#main { overflow: visible; margin-top: 18px; }
#mainContent { width: 100%; float: none; }
#sideBar, #sideBarMain, #sideBarCell { width: auto; float: none; }

/* ---------- 5. 文章卡片 ---------- */
.day, .post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 38px;
  margin-bottom: 24px;
}
.postTitle, .day .postTitle { border: none; margin: 0 0 14px; padding: 0; }
.postTitle h2, .postTitle a:link, .postTitle a:visited {
  font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.4; border: none;
}
.postTitle a:hover { color: var(--accent); text-decoration: none; }

.postBody { min-height: 0; }
.postBody p { margin: 14px 0; }
.postBody h1, .postBody h2, .postBody h3, .postBody h4 {
  margin: 28px 0 12px; line-height: 1.4; font-weight: 700; color: var(--text);
}
.postBody h2 { font-size: 21px; padding-left: 11px; border-left: 4px solid var(--accent); }
.postBody h3 { font-size: 18px; }
.postBody ul, .postBody ol { padding-left: 26px; }
.postBody li { margin: 6px 0; }
.postBody blockquote {
  margin: 16px 0; padding: 10px 18px; color: var(--text-soft);
  background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
}
.postBody blockquote p { margin: 6px 0; }

.postBody table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
.postBody th, .postBody td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.postBody th { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.postBody tr:nth-child(even) td { background: rgba(128, 150, 170, .07); }

.postBody code, p code, li code {
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 2px 7px; border-radius: 5px;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: .9em;
}
.postBody pre, .highlight, .cnblogs_code {
  background: var(--code-bg) !important; color: var(--code-text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 15px 18px; overflow-x: auto; line-height: 1.65; font-size: 14px; margin: 16px 0;
}
.postBody pre code, .highlight code { background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
.cnblogs_code pre, .cnblogs_code code { background: transparent !important; color: inherit; }

.postDesc, .day .postDesc {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border);
  color: var(--text-soft); font-size: 13px; text-align: right;
}
.postDesc a { color: var(--text-soft); }
.postDesc a:hover { color: var(--accent); }

/* ---------- 6. 评论区 ---------- */
.feedback, #blog_post_info_block {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 30px; margin-bottom: 24px;
}
.feedbackItem { padding: 14px 0; border: none; border-bottom: 1px solid var(--border); }
.feedbackListSubtitle { color: var(--text-soft); font-size: 13px; }
.comment_form { background: var(--card); border-radius: var(--radius); padding: 20px 30px; border: 1px solid var(--border); }
#tbCommentBody, #tbCommentAuthor { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 10px; width: 100%; }
#btn_comment_submit { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 22px; cursor: pointer; font-size: 14px; }
#btn_comment_submit:hover { background: var(--accent-dark); }

/* ---------- 7. 菜单按钮（右上角悬浮）---------- */
.du-menu-btn {
  position: fixed;
  top: 18px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 10010;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: background .2s, transform .2s;
}
.du-menu-btn:hover { background: rgba(255,255,255,.32); transform: scale(1.06); }
.du-menu-btn span, .du-menu-btn::before, .du-menu-btn::after {
  content: '';
  position: absolute;
  left: 13px; right: 13px;
  height: 2.5px;
  border-radius: 2px;
  background: #fff;
  transition: transform .25s, opacity .2s;
}
.du-menu-btn::before { top: 16px; }
.du-menu-btn span { top: 22.5px; }
.du-menu-btn::after { top: 29px; }
.du-menu-btn.open::before { transform: translateY(6.5px) rotate(45deg); }
.du-menu-btn.open span { opacity: 0; }
.du-menu-btn.open::after { transform: translateY(-6.5px) rotate(-45deg); }
/* 页面滚动离开大图后，按钮变成深色实底，保证看得见 */
.du-menu-btn.solid {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.du-menu-btn.solid span, .du-menu-btn.solid::before, .du-menu-btn.solid::after { background: var(--text); }

/* ---------- 8. 抽屉（导航 + 原侧边栏）---------- */
.du-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 20, 30, .45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 10000;
}
.du-overlay.open { opacity: 1; visibility: visible; }

.du-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 330px; max-width: 84vw;
  height: 100%;
  background: var(--card);
  box-shadow: -8px 0 30px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 10005;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.du-drawer.open { transform: translateX(0); }

.du-drawer-title {
  padding: 20px 24px 14px;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}
.du-drawer-nav { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.du-drawer-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.du-drawer-nav a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }
.du-drawer-body { flex: 1; overflow-y: auto; padding: 8px 18px 24px; }

/* 抽屉里的原侧栏：卡片改扁平分隔线 */
.du-drawer-body #sideBar { display: block; }
.du-drawer .newsItem, .du-drawer .catList, .du-drawer .sidebar-block {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 2px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
}
.du-drawer h3, .du-drawer .catListTitle { margin: 6px 0 8px; font-size: 14px; color: var(--accent-dark); }
.du-drawer ul { list-style: none; margin: 0; padding: 0; }
.du-drawer li { margin: 7px 0; font-size: 14px; }
.du-drawer input[type="text"], .du-drawer input[type="search"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
}

/* ---------- 9. 小鲸鱼跟随 ---------- */
.du-whale {
  position: fixed;
  top: 0; left: 0;
  font-size: 32px;
  line-height: 1;
  pointer-events: none;
  z-index: 10020;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  filter: drop-shadow(0 3px 5px rgba(0, 40, 70, .25));
  will-change: transform;
}
.du-whale.show { opacity: .95; }

/* ---------- 10. 点击水花 ---------- */
.du-drop {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10030;
  background: radial-gradient(circle at 35% 30%, #b8fff5, #22b8e0 70%);
  box-shadow: 0 0 6px rgba(45, 180, 220, .6);
  animation: du-splash .62s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes du-splash {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80%  { opacity: .8; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.25); opacity: 0; }
}

/* ---------- 11. 页脚 ---------- */
#footer { clear: both; text-align: center; color: var(--text-soft); font-size: 13px; padding: 24px 0 8px; }
#footer a { color: var(--text-soft); }

/* ---------- 12. 响应式 ---------- */
@media (max-width: 860px) {
  #header { min-height: 220px; padding: 64px 22px 80px; }
  #header h1 { font-size: 28px; }
  .day, .post, .feedback, .comment_form { padding: 22px 18px; }
  .du-menu-btn { top: 14px; right: 14px; width: 44px; height: 44px; }
}

/* 触屏设备：隐藏鲸鱼（没有鼠标可跟）*/
@media (hover: none) {
  .du-whale { display: none; }
}
