:root {
  --bg: #f4efe6;
  --paper: #fffaf3;
  --ink: #1d1a16;
  --muted: #6d6458;
  --line: #e4d8c6;
  --accent: #c45c26;
  --accent-2: #2f5d50;
  --shadow: 0 18px 40px rgba(60, 40, 20, .08);
  --radius: 18px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { margin: 0; padding: 0; background: radial-gradient(1200px 600px at 10% -10%, #fff7ea, var(--bg)); color: var(--ink); }
body { line-height: 1.6; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }

.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); background: rgba(244, 239, 230, .88); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 66px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topnav { display: flex; gap: 18px; font-size: 14px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--accent); }

.hero { padding: 26px 0 6px; }
.kicker { letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-size: 12px; font-weight: 600; }
.hero h1, .section-head h2 { font-size: 24px; margin: 6px 0 12px; letter-spacing: -.02em; }
.nav-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.nav-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px;
  display: flex; align-items: center; gap: 7px; color: inherit; min-height: 38px;
  box-shadow: 0 2px 10px rgba(60, 40, 20, .05);
  transition: box-shadow .15s, transform .15s;
}
a.nav-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.nav-card.empty { opacity: .45; }
.nav-index {
  width: 21px; height: 21px; border-radius: 7px; background: rgba(196, 92, 38, .12); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none;
}
.nav-card strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.blog { padding: 30px 0 16px; }
.post-list { display: grid; gap: 12px; }
.post-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.post-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.tag { font-size: 12px; padding: 1px 9px; border-radius: 999px; }
.tag.dim { background: rgba(47, 93, 80, .12); color: var(--accent-2); }
.tag.pin { background: rgba(196, 92, 38, .14); color: var(--accent); }
.post-card h3 { font-size: 17px; margin: 6px 0 4px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--accent); }
.post-preview { color: var(--muted); font-size: 14px; }
.post-preview.blurred p { filter: blur(5px); user-select: none; }
.post-single { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.post-single h1 { font-size: 24px; margin: 6px 0 16px; }
.post-content { color: var(--ink); }
.post-content img.post-img { max-width: 100%; border-radius: 12px; margin: 10px 0; display: block; }
.back-link { margin-top: 22px; font-size: 14px; }
.back-link a { color: var(--accent); }

.att-box { margin-top: 18px; background: rgba(47, 93, 80, .06); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.att-title { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.att-files { list-style: none; }
.att-files li { padding: 3px 0; font-size: 14px; }
.att-files a { color: var(--accent-2); text-decoration: underline; }
.att-files .dim { color: var(--muted); font-size: 12px; margin-left: 8px; }

.cmt-box { margin-top: 18px; }
.cmt-box h3 { margin-bottom: 10px; }
.cmt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cmt-box input[type="text"], .cmt-box input[type="email"], .cmt-box textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  background: #fffdf9; color: var(--ink); margin: 0; font-family: inherit;
}
.cmt-box textarea { margin-top: 10px; resize: vertical; }
.cmt-box button {
  margin-top: 12px; background: var(--accent); border: none; color: #fff; padding: 9px 20px;
  border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.cmt-box button:hover { background: #a94d1e; }
.cmt-tip { margin-left: 10px; font-size: 12px; color: var(--muted); }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }

.admin { padding: 26px 0 30px; }
.admin-msg { background: rgba(47, 93, 80, .1); border: 1px solid rgba(47, 93, 80, .3); color: var(--accent-2); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; margin-bottom: 14px; }
.panel label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.panel label.chk { display: flex; align-items: center; gap: 6px; }
.panel input[type="text"], .panel input[type="password"], .panel input[type="email"], .panel textarea, .login-box input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  background: #fffdf9; color: var(--ink); font-family: inherit;
}
.panel textarea { resize: vertical; }
.panel button, .login-box button {
  margin-top: 14px; background: var(--accent); border: none; color: #fff; padding: 9px 20px;
  border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.panel button:hover, .login-box button:hover { background: #a94d1e; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.btn-tool {
  background: rgba(196, 92, 38, .1); color: var(--accent); border: 1px solid rgba(196, 92, 38, .3); padding: 6px 14px;
  border-radius: 8px; font-size: 13px; cursor: pointer; margin-top: 0; font-family: inherit;
}
.btn-tool:hover { background: rgba(196, 92, 38, .18); }
.upload-status { font-size: 12px; color: var(--muted); }
.preview {
  border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px;
  font-size: 14px; color: var(--ink); background: #fffdf9; max-height: 420px; overflow: auto;
}
.preview img { max-width: 100%; border-radius: 10px; margin: 6px 0; display: block; }
.preview .dim { color: var(--muted); }
.attlist { display: flex; flex-wrap: wrap; gap: 8px; min-height: 10px; }
.att-chip {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(47, 93, 80, .08); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ink);
}
.att-del { color: var(--accent); font-weight: 700; text-decoration: none; }
.hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.inline-h { display: inline; }
.panel summary { cursor: pointer; margin-bottom: 10px; }
.panel summary h2 { display: inline; }
.cmt-text { max-width: 260px; word-break: break-all; }
details.panel > table { margin-top: 6px; }
.btn-ghost { display: inline-block; margin-top: 14px; margin-left: 10px; color: var(--muted); font-size: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid rgba(228, 216, 198, .5); vertical-align: middle; }
.tbl td input { padding: 7px 10px; }
.tbl .ops { display: flex; gap: 12px; align-items: center; }
.tbl .ops form { display: inline; }
.link-danger { background: none; border: none; color: #b23c17; cursor: pointer; font-size: 14px; padding: 0; margin: 0; font-family: inherit; }
.link-danger:hover { text-decoration: underline; background: none; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 10% -10%, #fff7ea, var(--bg)); }
.login-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px; width: 92%; max-width: 380px; box-shadow: var(--shadow); }
.login-box .brand { margin-bottom: 18px; }
.login-box input { margin: 8px 0; }
.form-err { color: #b23c17; font-size: 13px; margin-bottom: 6px; }
.login-tip { margin-top: 16px; text-align: center; font-size: 13px; }
.login-tip a { color: var(--accent); }

.footer { padding: 26px 0 34px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .hero { padding-top: 20px; }
  .hero h1, .section-head h2 { font-size: 20px; }
  .topnav { gap: 14px; }
  .post-single { padding: 20px; }
  .nav-grid { grid-template-columns: repeat(3, 1fr); }
  .cmt-grid { grid-template-columns: 1fr; gap: 0; }
  .cmt-grid input { margin-top: 8px; }
  .tbl { font-size: 13px; }
}
