/* ============================================
   邓少之家 · 排版润色
   只改“手脚”不动骨架：字体、行距、间距、链接、配色细节
   删掉 nginx 里那一行注入，立刻恢复原样
   ============================================ */

:root {
  --wb-accent: #9a6b2f;
  --wb-accent-soft: #f6efe2;
  --wb-quote-bg: #faf7f1;
  --wb-rule: #e8e2d6;
}

html.dark {
  --wb-accent: #e0b56a;
  --wb-accent-soft: #2a2418;
  --wb-quote-bg: #1b1f27;
  --wb-rule: #2c3240;
}

/* ---------- 字体与基础行文 ---------- */
body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body p,
body li,
body dd,
body blockquote {
  line-height: 1.9 !important;
}

/* 段落之间给点呼吸，挤在一起最显“没设计过” */
body p + p {
  margin-top: 1.05em !important;
}

/* ---------- 标题 ---------- */
h1, h2, h3, h4 {
  letter-spacing: -0.012em;
}

body h2 {
  margin-top: 2.4em !important;
  margin-bottom: 0.7em !important;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--wb-rule);
}

body h3 {
  margin-top: 1.9em !important;
  margin-bottom: 0.55em !important;
}

h1 + h2, h2 + h3 {
  margin-top: 1.1em !important;
}

/* ---------- 链接：细下划线 + 悬停变色 ---------- */
a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color .18s ease, opacity .18s ease;
}

body a:not([class]) {
  border-bottom: 1px solid var(--wb-rule);
  padding-bottom: 1px;
}

body a:not([class]):hover {
  color: var(--wb-accent);
  border-bottom-color: var(--wb-accent);
}

/* 导航/卡片里的链接不要下划线 */
nav a, header a, footer a, .rounded-xl a[class] {
  border-bottom: 0 !important;
}

/* ---------- 引用块：左侧竖线 ---------- */
blockquote {
  border-left: 3px solid var(--wb-accent) !important;
  background: var(--wb-quote-bg);
  padding: 0.85em 1.1em !important;
  margin: 1.6em 0 !important;
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: normal !important;
  opacity: .95;
}

/* ---------- 代码 ---------- */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 0.9em !important;
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  background: var(--wb-accent-soft);
}

pre {
  border-radius: 0.75rem !important;
  padding: 1.05em 1.2em !important;
  overflow-x: auto;
  line-height: 1.65 !important;
}

pre code {
  background: transparent !important;
  padding: 0 !important;
  font-size: 0.86em !important;
}

/* ---------- 图片与表格 ---------- */
img {
  border-radius: 0.6rem;
}

body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.94em;
}

body th,
body td {
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--wb-rule);
  text-align: left;
}

body th {
  font-weight: 600;
  border-bottom-width: 2px;
}

body tbody tr:hover {
  background: var(--wb-accent-soft);
}

/* ---------- 细节 ---------- */
::selection {
  background: var(--wb-accent-soft);
  color: inherit;
}

html {
  scroll-behavior: smooth;
}

/* 细一点的滚动条，别用系统那种粗的 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(140, 140, 140, .3);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 140, 140, .5);
  background-clip: content-box;
}

/* 焦点可见性（键盘操作时） */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--wb-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================
   暖色系覆盖（配合山城夜景横幅）
   ============================================ */
:root {
  --wb-bg: #fbf5ec;
  --wb-card: #fffdf8;
  --wb-text: #2b2018;
  --wb-muted: #7a6a5c;
  --wb-border2: #e9dcc9;
}

html.dark {
  --wb-bg: #17120d;
  --wb-card: #221a13;
  --wb-text: #efe4d4;
  --wb-muted: #a89684;
  --wb-border2: #33271c;
}

body {
  background-color: var(--wb-bg) !important;
  color: var(--wb-text);
}

/* 卡片、面板统一成暖色底 */
.rounded-xl,
.rounded-lg {
  background-color: var(--wb-card) !important;
}

html.dark .bg-white,
html.dark .bg-slate-800,
html.dark .bg-slate-900,
html.dark .bg-slate-700 {
  background-color: var(--wb-card) !important;
}

html:not(.dark) .bg-white {
  background-color: var(--wb-card) !important;
}

/* 抬头与底部 */
header,
footer,
nav {
  border-color: var(--wb-border2) !important;
}

html.dark footer,
html.dark header {
  background-color: #1b1510 !important;
}

/* 文字层级 */
html.dark h1, html.dark h2, html.dark h3, html.dark h4 {
  color: #f4ebdd;
}

html.dark .text-slate-500,
html.dark .text-slate-400,
html.dark .text-gray-500 {
  color: var(--wb-muted) !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: var(--wb-text) !important;
}

/* 分隔线 */
html.dark hr,
html.dark .border-slate-200,
html.dark .border-slate-700,
html.dark .border-slate-600 {
  border-color: var(--wb-border2) !important;
}

/* 标签/按钮类小胶囊也调暖 */
html.dark .bg-slate-100,
html.dark .bg-slate-200 {
  background-color: #2e2318 !important;
  color: var(--wb-text) !important;
}

/* 横幅：只留照片，去掉上面那行字 */
[style*="hero.jpg"] .text-5xl,
[style*="hero.jpg"] .text-sm {
  display: none !important;
}

/* 横幅下沿压一层很轻的暖色渐变，跟页面底色接上 */
[style*="hero.jpg"] {
  box-shadow: inset 0 -60px 60px -50px rgba(23, 18, 13, .9);
}

/* ============================================
   输入框修正（此前配色覆盖把输入框也压暗了，字看不见）
   ============================================ */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
textarea,
select {
  background-color: #fdfaf4 !important;
  color: #2b2018 !important;
  border: 1px solid #d9c9b0 !important;
  border-radius: 8px !important;
  caret-color: #b46a2a !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.dark textarea,
html.dark select {
  background-color: #2e2318 !important;
  color: #f4ebdd !important;
  border: 1px solid #4a3a28 !important;
  caret-color: #e0a960 !important;
}

input::placeholder,
textarea::placeholder {
  color: #9a8b7a !important;
  opacity: 1 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #8a7a68 !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #b46a2a !important;
  outline-offset: 1px;
}

html.dark input:focus,
html.dark textarea:focus,
html.dark select:focus {
  outline: 2px solid #e0a960 !important;
}

/* 下拉框选项在深色下也别白底黑字 */
select option {
  background-color: #fdfaf4;
  color: #2b2018;
}

html.dark select option {
  background-color: #2e2318;
  color: #f4ebdd;
}
