/* ============================================================
   limi 的影集 · 胶片手账 / 复古影集 主题
   配色：牛皮纸米黄 #f5f0e6 / 焦糖棕 #8b5e34 / 褪红 #c4574e / 深墨 #2b2620
   无外部资源，全部为系统字体栈 + 纯 CSS 装饰
   ============================================================ */

:root {
  --paper: #f5f0e6;
  --paper-deep: #ece4d2;
  --paper-card: #fbf8f1;
  --caramel: #8b5e34;
  --caramel-deep: #6b4a28;
  --faded-red: #c4574e;
  --faded-red-deep: #a8433c;
  --ink: #2b2620;
  --ink-soft: #5c5347;
  --line: #d9cdb4;
  --mono: "Courier New", "Nimbus Mono PS", "Cutive Mono", monospace;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif-bold: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 纸张噪点（内联 SVG noise，无外部图） ---------- */
.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.55 0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0.06 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ---------- 页头 ---------- */
.site-header {
  padding: 28px 0 10px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-text strong {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 1px;
}

.brand-text small {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 2px;
}

/* 印章风圆形徽章 */
.brand-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--faded-red);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: bold;
  font-size: 24px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px rgba(245, 240, 230, 0.55);
  transform: rotate(-8deg);
  flex: none;
}

.brand-stamp.small { width: 38px; height: 38px; font-size: 20px; }

.site-nav { display: flex; gap: 6px; }

.site-nav a {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px dashed transparent;
  transition: color .2s, border-color .2s;
}

.site-nav a:hover { color: var(--faded-red); border-color: var(--faded-red); }

/* ---------- 胶片齿孔边框 ---------- */
.film-strip { padding: 4px 0; position: relative; z-index: 1; }

.film-strip-inner {
  height: 26px;
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  background-image: radial-gradient(circle at center, var(--paper) 0 4px, transparent 4.5px);
  background-size: 34px 26px;
  background-position: center;
  background-repeat: repeat-x;
}

/* ---------- flash 消息 ---------- */
.flash-area { margin: 18px 0; }

.flash {
  padding: 10px 16px;
  border: 1px dashed var(--caramel);
  background: var(--paper-card);
  font-family: var(--mono);
  font-size: 14px;
  margin-bottom: 10px;
}

.flash-success { border-color: #5d7a4e; color: #44603a; }
.flash-error { border-color: var(--faded-red); color: var(--faded-red-deep); }

/* ---------- 主区 ---------- */
.main-wrap { padding: 30px 20px 60px; min-height: 55vh; }

/* Hero */
.hero { text-align: center; padding: 40px 0 30px; }

.hero-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--caramel);
  margin: 0 0 10px;
}

.hero-title {
  font-family: var(--serif-bold);
  font-weight: 900;
  font-size: clamp(38px, 8vw, 64px);
  letter-spacing: 6px;
  margin: 0;
  color: var(--ink);
  /* 打字机下划光标 */
  border-bottom: 4px solid var(--faded-red);
  display: inline-block;
  padding-bottom: 6px;
}

.hero-sub { color: var(--ink-soft); margin-top: 16px; }

/* ---------- 拍立得卡片 ---------- */
.polaroid-row {
  display: flex;
  gap: 28px;
  align-items: stretch;
  flex-wrap: wrap;
  margin: 30px 0 10px;
}

.polaroid {
  background: #fffdf8;
  padding: 12px 12px 0;
  box-shadow: 0 4px 18px rgba(43, 38, 32, 0.18);
  margin: 0;
  flex: 0 0 240px;
  transition: transform .25s ease, box-shadow .25s ease;
}

.polaroid:hover {
  transform: translateY(-5px) rotate(0deg) !important;
  box-shadow: 0 10px 26px rgba(43, 38, 32, 0.24);
}

.polaroid.tilt-left { transform: rotate(-3deg); }
.polaroid.tilt-right { transform: rotate(2.5deg); }
.polaroid.small { flex-basis: 200px; }

.polaroid-photo { background: #ddd; overflow: hidden; }
.polaroid-photo svg { display: block; width: 100%; height: auto; }

.polaroid-caption {
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
  color: var(--ink-soft);
  padding: 10px 4px 14px;
}

/* ---------- 简介卡 ---------- */
.intro-card {
  flex: 1 1 320px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--faded-red);
  padding: 22px 26px;
  box-shadow: 2px 3px 0 rgba(43, 38, 32, 0.08);
}

.intro-title {
  font-family: var(--serif-bold);
  margin: 0 0 10px;
  font-size: 24px;
}

.intro-facts { list-style: none; margin: 14px 0 0; padding: 0; }

.intro-facts li {
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}

.intro-facts li span {
  display: inline-block;
  min-width: 52px;
  font-family: var(--mono);
  color: var(--caramel);
  margin-right: 10px;
}

/* ---------- 分区 ---------- */
.home-section { margin-top: 44px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif-bold);
  font-size: 22px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--faded-red);
  transform: rotate(45deg);
  flex: none;
}

.section-more {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--caramel);
  text-decoration: none;
  letter-spacing: 1px;
}

/* 做旧下划线 hover 动效 */
.section-more, .post-link, a { text-underline-offset: 3px; }

a {
  background-image: linear-gradient(var(--faded-red), var(--faded-red));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size .3s ease, color .2s;
}

a:hover { background-size: 100% 1px; }

.section-more:hover, .brand:hover { color: var(--faded-red); }

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }

.post-item {
  border-bottom: 1px dashed var(--line);
}

.post-item:first-child { border-top: 1px dashed var(--line); }

.post-link {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  grid-template-areas: "date title meta" "date excerpt meta";
  gap: 2px 18px;
  align-items: center;
  padding: 14px 8px;
  text-decoration: none;
  color: var(--ink);
  transition: background .2s, transform .2s;
}

.post-link:hover { background: rgba(139, 94, 52, 0.07); transform: translateX(4px); }

.post-date {
  grid-area: date;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--caramel);
}

.post-title {
  grid-area: title;
  font-weight: 700;
  font-size: 17px;
  font-family: var(--serif-bold);
}

.post-excerpt {
  grid-area: excerpt;
  font-size: 13px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-meta {
  grid-area: meta;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- 友链 ---------- */
.friend-links {
  list-style: none;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.friend-link {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper-card);
  border: 1px dashed var(--caramel);
  padding: 16px 18px;
  transition: transform .2s;
}

.friend-link:hover { transform: translateY(-3px); }

.friend-badge {
  width: 40px; height: 40px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--faded-red);
  color: var(--faded-red);
  font-family: var(--mono);
  font-weight: bold;
  transform: rotate(-6deg);
}

.friend-link strong { display: block; font-size: 15px; }
.friend-link small { color: var(--ink-soft); }

/* ---------- 访客统计小字 ---------- */
.visit-note {
  margin-top: 50px;
  padding: 14px 18px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.visit-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--faded-red);
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---------- 页面头（列表页/留言板） ---------- */
.page-head { padding: 26px 0 8px; }

.page-title {
  font-family: var(--serif-bold);
  font-size: clamp(30px, 6vw, 42px);
  margin: 0 0 6px;
  letter-spacing: 3px;
}

.page-sub { color: var(--ink-soft); margin: 0; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 46px 20px;
  border: 1px dashed var(--line);
  background: rgba(251, 248, 241, 0.6);
}

.empty-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 74px;
  padding: 0 10px;
  border: 3px double var(--faded-red);
  border-radius: 50%;
  color: var(--faded-red);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 3px;
  transform: rotate(-9deg);
  margin-bottom: 14px;
  opacity: 0.8;
}

.empty-state p { color: var(--ink-soft); margin: 0; }

/* ---------- 文章详情 ---------- */
.post-full {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 40px 44px 46px;
  box-shadow: 3px 4px 0 rgba(43, 38, 32, 0.08);
}

.post-full-head { position: relative; margin-bottom: 22px; }

.post-full-title {
  font-family: var(--serif-bold);
  font-size: clamp(26px, 5vw, 36px);
  margin: 0;
  line-height: 1.4;
  padding-right: 60px;
}

/* 手账胶带 */
.tape {
  position: absolute;
  top: -14px;
  width: 96px;
  height: 26px;
  background: rgba(196, 87, 78, 0.32);
  border-left: 1px dashed rgba(255,255,255,0.7);
  border-right: 1px dashed rgba(255,255,255,0.7);
  transform: rotate(-4deg);
  pointer-events: none;
}

.tape-left { left: -30px; }
.tape-right {
  right: -26px;
  top: auto;
  bottom: -18px;
  transform: rotate(5deg);
  background: rgba(139, 94, 52, 0.3);
}

.post-full-body { font-size: 16px; }

.post-full-body h2, .post-full-body h3 { font-family: var(--serif-bold); }

.post-full-body img { max-width: 100%; height: auto; border: 6px solid #fffdf8; box-shadow: 0 3px 12px rgba(43,38,32,0.2); }

.post-full-body blockquote {
  margin: 1em 0;
  padding: 8px 18px;
  border-left: 4px solid var(--faded-red);
  background: rgba(196, 87, 78, 0.06);
  color: var(--ink-soft);
}

.post-full-body code {
  font-family: var(--mono);
  background: var(--paper-deep);
  padding: 2px 6px;
  font-size: 0.9em;
}

.post-full-body pre {
  background: var(--ink);
  color: var(--paper);
  padding: 16px;
  overflow-x: auto;
}

.post-full-body pre code { background: none; padding: 0; color: inherit; }

.post-full-body a { color: var(--faded-red-deep); }

/* ---------- 评论区 ---------- */
.comment-section { margin-top: 46px; }

.comment-list { list-style: none; margin: 0 0 30px; padding: 0; }

.comment-item {
  display: flex;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px dashed var(--line);
}

.comment-item:first-child { border-top: 1px dashed var(--line); }

.comment-avatar {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--caramel);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: bold;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-4deg);
}

.comment-admin .comment-avatar { background: var(--faded-red); }

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comment-author { font-weight: 700; font-family: var(--serif-bold); }

.comment-badge {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--paper);
  background: var(--faded-red);
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: 1px;
}

.comment-time { font-size: 12px; font-family: var(--mono); color: var(--ink-soft); }

.comment-content { font-size: 15px; word-break: break-word; }
.comment-content p { margin: 0 0 6px; }
.comment-content p:last-child { margin-bottom: 0; }

.comment-empty {
  padding: 26px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 14px;
}

/* ---------- 表单 ---------- */
.comment-form, .edit-form {
  background: var(--paper-card);
  border: 1px solid var(--line);
  padding: 24px 26px;
  box-shadow: 2px 3px 0 rgba(43, 38, 32, 0.08);
}

.comment-form-title {
  font-family: var(--serif-bold);
  margin: 0 0 16px;
  font-size: 20px;
}

.form-field { display: block; margin-bottom: 16px; }

.form-field > span {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--caramel);
  margin-bottom: 6px;
}

.form-field input[type="text"],
.form-field input[type="password"],
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}

.form-field textarea { resize: vertical; min-height: 110px; }

.form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--caramel);
  box-shadow: 0 0 0 3px rgba(139, 94, 52, 0.15);
}

.field-hint { color: var(--ink-soft); font-size: 12px; display: block; margin-top: 4px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 14px;
  cursor: pointer;
}

.form-check input { accent-color: var(--faded-red); width: 16px; height: 16px; }

.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

.form-hint { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.form-hint.is-error { color: var(--faded-red-deep); }
.form-hint.is-ok { color: #44603a; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 2px;
  padding: 9px 22px;
  border: 1px solid var(--ink);
  background: var(--paper-card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn:active { transform: translate(0, 0); box-shadow: none; }

.btn-primary {
  background: var(--faded-red);
  border-color: var(--faded-red-deep);
  color: #fff8ee;
}

.btn-primary:hover { box-shadow: 2px 2px 0 var(--faded-red-deep); }

.btn-primary[disabled] { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }

.btn-ghost { background: transparent; }

.btn-danger {
  background: #fff;
  border-color: var(--faded-red);
  color: var(--faded-red-deep);
}

.btn-danger:hover { box-shadow: 2px 2px 0 var(--faded-red); }

.btn-small { padding: 4px 12px; font-size: 12px; letter-spacing: 1px; }

.btn-block { width: 100%; }

/* ---------- 页脚 ---------- */
.site-footer { padding: 20px 0 46px; position: relative; z-index: 1; }

.footer-rule {
  height: 10px;
  background-image: repeating-linear-gradient(90deg,
    var(--caramel) 0 10px, transparent 10px 20px);
  opacity: 0.4;
  margin-bottom: 18px;
}

.footer-line { text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); margin: 4px 0; }
.footer-dim { font-size: 12px; opacity: 0.75; }

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--caramel);
  background: var(--paper-card);
  color: var(--caramel);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  z-index: 50;
  box-shadow: 0 3px 10px rgba(43,38,32,0.18);
}

.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.back-to-top:hover { background: var(--caramel); color: var(--paper); }

/* ============================================================
   登录页
   ============================================================ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 15%, rgba(196, 87, 78, 0.08), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(139, 94, 52, 0.1), transparent 45%),
    var(--paper);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  box-shadow: 4px 5px 0 rgba(43, 38, 32, 0.12);
  padding: 38px 34px 30px;
  text-align: center;
}

.login-stamp {
  width: 62px; height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px double var(--faded-red);
  color: var(--faded-red);
  font-family: var(--mono);
  font-weight: bold;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
}

.login-title { font-family: var(--serif-bold); margin: 0 0 4px; font-size: 26px; letter-spacing: 4px; }
.login-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); letter-spacing: 2px; margin: 0 0 22px; }
.login-back { display: inline-block; margin-top: 18px; font-family: var(--mono); font-size: 13px; color: var(--caramel); text-decoration: none; }

/* ============================================================
   后台
   ============================================================ */
.admin-body { background: #efe8d8; }

.admin-shell {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-sidebar {
  width: 210px;
  flex: none;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 20px;
  border-bottom: 1px dashed rgba(245, 240, 230, 0.25);
}

.admin-brand strong { display: block; font-family: var(--mono); font-size: 15px; }
.admin-brand small { color: rgba(245, 240, 230, 0.6); font-size: 11px; letter-spacing: 2px; }

.admin-nav { display: flex; flex-direction: column; padding: 16px 0; flex: 1; }

.admin-nav a {
  color: rgba(245, 240, 230, 0.75);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 3px;
  padding: 11px 22px;
  border-left: 3px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}

.admin-nav a:hover { color: var(--paper); background: rgba(245, 240, 230, 0.06); }

.admin-nav a.active {
  color: var(--paper);
  border-left-color: var(--faded-red);
  background: rgba(196, 87, 78, 0.18);
}

.admin-logout { padding: 14px 18px 0; border-top: 1px dashed rgba(245, 240, 230, 0.25); }

.admin-logout .btn-ghost { color: rgba(245, 240, 230, 0.7); border-color: rgba(245, 240, 230, 0.4); width: 100%; }
.admin-logout .btn-ghost:hover { color: var(--ink); background: var(--paper); box-shadow: none; }

.admin-main { flex: 1; min-width: 0; padding: 30px 30px 60px; }

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.admin-title { font-family: var(--serif-bold); margin: 0; font-size: 28px; letter-spacing: 2px; }
.admin-sub { color: var(--ink-soft); margin: 0; font-size: 14px; }

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--caramel);
  padding: 16px 18px 12px;
  box-shadow: 2px 3px 0 rgba(43, 38, 32, 0.08);
}

.stat-card.accent { border-top-color: var(--faded-red); }

.stat-num {
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: bold;
  color: var(--ink);
  line-height: 1.2;
}

.stat-label { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); letter-spacing: 1px; }

/* 面板 */
.admin-panel {
  background: var(--paper-card);
  border: 1px solid var(--line);
  box-shadow: 2px 3px 0 rgba(43, 38, 32, 0.08);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.admin-panel-title {
  font-family: var(--serif-bold);
  margin: 0 0 16px;
  font-size: 19px;
}

/* 纯 CSS 柱状图 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 0 6px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.bar-stack {
  width: 70%;
  max-width: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: calc(100% - 40px);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.bar { width: 45%; min-height: 2px; transition: height .6s ease; }
.bar-pv { background: var(--caramel); }
.bar-uv { background: var(--faded-red); opacity: 0.85; }

.bar-label {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.bar-value {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--caramel);
}

.bar-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.legend-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 6px;
  vertical-align: middle;
}

.sw-pv { background: var(--caramel); }
.sw-uv { background: var(--faded-red); }

/* 表格 */
.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--caramel);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
  white-space: nowrap;
}

.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px dashed var(--line);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(139, 94, 52, 0.06); }

.nowrap { white-space: nowrap; }

.title-cell { font-weight: 700; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.path-cell, .ua-cell, .ref-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 12px;
}

.table-empty { text-align: center; color: var(--ink-soft); padding: 26px 10px; }

.action-cell { white-space: nowrap; }
.inline-form { display: inline-block; margin: 0; }

/* 标签 */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  white-space: nowrap;
}

.tag-on { border-color: #5d7a4e; color: #44603a; }
.tag-off { border-color: var(--faded-red); color: var(--faded-red-deep); }

/* 过滤导航 */
.filter-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  padding: 5px 14px;
  border: 1px dashed var(--caramel);
}

.filter-nav a.active { background: var(--caramel); color: var(--paper); border-style: solid; }

/* 留言管理卡片 */
.comment-admin-list { display: flex; flex-direction: column; gap: 14px; }

.comment-admin-item {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--caramel);
  padding: 14px 18px;
  box-shadow: 2px 3px 0 rgba(43, 38, 32, 0.08);
}

.comment-admin-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.comment-admin-meta form { margin-left: auto; }

.comment-ip { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { flex-wrap: wrap; }

  .post-link {
    grid-template-columns: 1fr;
    grid-template-areas: "date" "title" "excerpt" "meta";
    gap: 2px;
  }

  .post-full { padding: 26px 20px 30px; }
  .tape { display: none; }

  .polaroid { flex: 1 1 200px; margin: 0 auto; }

  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }
  .admin-brand { border: none; padding: 0; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; padding: 0; flex: 1; }
  .admin-nav a { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; }
  .admin-nav a.active { border-bottom-color: var(--faded-red); }
  .admin-logout { border: none; padding: 0; }
  .admin-logout .btn-ghost { width: auto; padding: 6px 12px; }
  .admin-main { padding: 20px 16px 50px; }
  .bar-chart { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
