/* ═══════════════════════════════════════
   仙侠主题 — Xianxia Theme for Typecho
   墨色山水 · 金色灵气 · 剑气纵横
   ═══════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-deep: #080c16;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-header: #0d1222;
  --text: #d4c8b8;
  --text-light: #a89880;
  --text-heading: #e8dcc8;
  --gold: #c9a96e;
  --gold-light: #d4b87a;
  --gold-dim: #8b7348;
  --crimson: #a0524a;
  --crimson-light: #c97068;
  --jade: #5a8a6a;
  --border: #1e2d3d;
  --border-gold: rgba(201, 169, 110, 0.2);
  --glow: 0 0 20px rgba(201, 169, 110, 0.08);
  --glow-strong: 0 0 30px rgba(201, 169, 110, 0.15);
}

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(201,169,110,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(160,82,74,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(90,138,106,0.03) 0%, transparent 50%);
  color: var(--text);
  font-family: "Noto Serif SC", "STSong", "SimSun", "PingFang SC", "Microsoft YaHei", "Source Han Serif SC", serif;
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.4;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}
a:hover {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(201,169,110,0.3);
}

pre, code {
  background: #0f1923;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
  color: #c9a96e;
}
pre { padding: 16px; overflow-x: auto; margin: 12px 0; }
code { padding: 2px 6px; }

blockquote {
  border-left: 3px solid var(--gold);
  margin: 16px 0;
  padding: 12px 20px;
  background: rgba(201,169,110,0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-light);
  font-style: italic;
}

/* ── Header — 仙门 ── */
#header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-gold);
  padding: 30px 0 0;
  position: relative;
  box-shadow: var(--glow);
}
#header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.3), transparent);
}

#header .site-name {
  text-align: center;
  padding-bottom: 12px;
}
#header #logo {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(201,169,110,0.3);
  display: inline-block;
  transition: text-shadow 0.5s;
}
#header #logo:hover {
  text-shadow: 0 0 40px rgba(201,169,110,0.5), 0 0 80px rgba(201,169,110,0.2);
}
#header .description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 4px;
  letter-spacing: 2px;
}

/* ── Navigation — 剑诀 ── */
#nav-menu {
  text-align: center;
  padding: 14px 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
#nav-menu a {
  display: inline-block;
  padding: 6px 20px;
  color: var(--text-light);
  font-size: 0.95rem;
  letter-spacing: 2px;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: all 0.3s;
  position: relative;
}
#nav-menu a:hover,
#nav-menu a.current {
  color: var(--gold);
  border-color: var(--border-gold);
  background: rgba(201,169,110,0.06);
  text-shadow: 0 0 10px rgba(201,169,110,0.3);
}

/* ── Search — 寻仙 ── */
#search {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0;
}
#search .text {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s;
  width: 180px;
  font-family: inherit;
}
#search .text:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 10px rgba(201,169,110,0.1);
}
#search .text::placeholder { color: var(--text-light); opacity: 0.6; }
#search .submit {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 6px;
  transition: all 0.3s;
  font-family: inherit;
}
#search .submit:hover {
  border-color: var(--gold);
  background: rgba(201,169,110,0.1);
}

/* ── Body Content ── */
#body {
  padding: 30px 0 60px;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Main Content ── */
#main {
  float: left;
}

/* ── Post Card — 功法卷轴 ── */
.post {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s;
  position: relative;
}
.post::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.4), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.post:hover {
  border-color: var(--border-gold);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.post:hover::before { opacity: 1; }

.post-inner { padding: 28px 30px; }

/* ── Post Title — 术法之名 ── */
.post-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.post-title a {
  color: var(--text-heading);
  transition: color 0.3s;
}
.post-title a:hover {
  color: var(--gold);
  text-shadow: 0 0 15px rgba(201,169,110,0.2);
}

/* ── Post Meta — 修炼信息 ── */
.post-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
}
.post-meta li {
  position: relative;
  padding-left: 14px;
}
.post-meta li::before {
  content: '◇';
  position: absolute;
  left: 0;
  color: var(--gold-dim);
  font-size: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.post-meta a { color: var(--gold); font-size: 0.82rem; }

/* ── Post Content — 内功心法 ── */
.post-content {
  color: var(--text);
  line-height: 1.9;
}
.post-content p { margin-bottom: 12px; }
.post-content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--gold-light);
  margin: 20px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--gold-dim);
}

/* ── Read More — 继续修炼 ── */
.post-content .more-link {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 20px;
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 2px;
  transition: all 0.3s;
}
.post-content .more-link:hover {
  background: rgba(201,169,110,0.1);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(201,169,110,0.1);
}

/* ── Sidebar — 灵石栏 ── */
#secondary {
  float: right;
}
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}
.widget:hover { border-color: var(--border-gold); }

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 2px;
}

.widget-list {
  list-style: none;
}
.widget-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.88rem;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a {
  color: var(--text-light);
  transition: color 0.3s;
}
.widget-list a:hover { color: var(--gold); }

/* ── Archive Title ── */
.archive-title {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 20px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  letter-spacing: 2px;
}

/* ── Page Nav — 翻页剑诀 ── */
.page-navigator {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
  padding: 0;
}
.page-navigator li {
  display: inline-block;
}
.page-navigator a,
.page-navigator .current {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.88rem;
  transition: all 0.3s;
  background: var(--bg-card);
}
.page-navigator a:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 10px rgba(201,169,110,0.1);
}
.page-navigator .current {
  background: rgba(201,169,110,0.1);
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* ── Footer — 凡尘 ── */
#footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  color: var(--text-light);
  font-size: 0.85rem;
  letter-spacing: 1px;
  background: var(--bg-header);
}
#footer a { color: var(--text-light); font-size: 0.85rem; }
#footer a:hover { color: var(--gold); }

/* ── Comments — 论道台 ── */
#comments {
  margin-top: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
#comments h3 {
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 2px;
}
.comment-list {
  list-style: none;
  margin: 0; padding: 0;
}
.comment-list li { padding: 0; }
.comment-list .comment-body {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-list .comment-author {
  color: var(--gold);
  font-weight: 600;
}
.comment-list .comment-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}
.comment-list .comment-meta a { color: var(--text-light); }
.comment-list .comment-content {
  margin-top: 8px;
  color: var(--text);
}

/* ── Comment Form — 留墨 ── */
#respond {
  margin-top: 20px;
}
#respond h3 {
  color: var(--gold);
  margin-bottom: 12px;
}
#comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#comment-form input,
#comment-form textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
}
#comment-form input:focus,
#comment-form textarea:focus {
  border-color: var(--gold-dim);
}
#comment-form textarea { min-height: 120px; resize: vertical; }
#comment-form .submit {
  background: rgba(201,169,110,0.1);
  border: 1px solid var(--gold-dim);
  border-radius: 20px;
  padding: 10px 28px;
  color: var(--gold);
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s;
  align-self: flex-start;
}
#comment-form .submit:hover {
  background: rgba(201,169,110,0.2);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(201,169,110,0.15);
}

/* ── Single Post Page ── */
.post-page .post-title {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 16px;
}
.post-page .post-meta { justify-content: center; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #main { float: none; width: 100%; }
  #secondary { float: none; width: 100%; margin-top: 30px; }
  .post-inner { padding: 20px; }
  .post-title { font-size: 1.15rem; }
  #header #logo { font-size: 1.5rem; }
  #search { justify-content: center; }
  #nav-menu { gap: 4px; }
  #nav-menu a { padding: 5px 12px; font-size: 0.82rem; letter-spacing: 1px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 0 12px; }
  .post-inner { padding: 16px; }
  .post-meta { gap: 8px; font-size: 0.75rem; }
  #header { padding: 20px 0 0; }
}

/* ── Scrollbar — 仙气 ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: #2a3a4a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Selection ── */
::selection {
  background: rgba(201,169,110,0.3);
  color: #fff;
}
