:root {
  --blue: #0090ce;
  --blue-deep: #046bb0;
  --blue-hover: #00a4dc;
  --blue-logo: #377bee;
  --bg: #f1f1f1;
  --line: #ececec;
  --ink: #333;
  --mute: #666;
  --soft: #999;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body, div, p, ol, ul, li, h1, h2, h3, h4, form, input, button, textarea {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--mute);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

ul, ol { list-style: none; }
img { max-width: 100%; border: 0; display: block; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { color: var(--blue-hover); }

.wrap {
  width: min(100% - 24px, 1200px);
  margin: 0 auto;
}

.top { background: #fff; border-bottom: 1px solid var(--line); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 10px 0;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.page-header-right {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.header-search {
  display: flex;
  align-items: stretch;
  flex: 1;
  max-width: 380px;
  min-width: 200px;
}
.header-search input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 34px;
  border: 1px solid #e0e0e0;
  border-radius: 3px 0 0 3px;
  padding: 0 12px;
  color: #333;
  background: #fafafa;
  outline: none;
}
.header-search input:focus {
  border-color: var(--blue);
  background: #fff;
}
.header-search button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}
.header-search button:hover { background: var(--blue-deep); }
.header-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.header-links a {
  display: inline-block;
  padding: 6px 12px;
  color: #555;
  font-size: 13px;
  border-radius: 3px;
  white-space: nowrap;
}
.header-links a:hover {
  background: #f3f8fc;
  color: var(--blue-deep);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-logo);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.brand:hover { color: var(--blue-deep); }
.brand img, .brand-mark {
  width: 36px;
  height: 36px;
}
.site-desc {
  color: var(--soft);
  font-size: 13px;
  margin-left: 4px;
  display: none;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .site-desc { display: inline; }
  .page-header-right { display: flex; }
}

.nav {
  background: var(--blue);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
}
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 45px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(0,0,0,0.12); }
.nav-menu {
  display: none;
  width: 100%;
  background: var(--blue);
}
.nav-menu.is-open { display: block; }
.nav-menu a {
  display: block;
  color: #fff;
  line-height: 45px;
  padding: 0 22px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  background: rgba(0,0,0,0.12);
  color: #fff;
}
.nav-search {
  display: none;
}
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-inner { gap: 12px; }
  .nav-menu {
    display: flex !important;
    width: auto;
    background: transparent;
  }
  .nav-menu a { display: inline-block; }
}

.layout {
  display: grid;
  gap: 16px;
  padding: 16px 0 28px;
}
@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.panel:last-child { margin-bottom: 0; }

.notice {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.7;
}

.post-block {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 16px;
  overflow: hidden;
}
.post-block:last-child { margin-bottom: 0; }
.post-block h2 {
  margin: 0 0 10px;
  font-size: 1.15em;
  font-weight: 500;
  line-height: 1.4;
}
.post-block h2 a { color: #000; }
.post-block h2 a:hover { color: var(--blue-hover); }
.post-preview {
  color: #737373;
  font-size: 0.92em;
  line-height: 1.65;
  margin-bottom: 12px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--soft);
  font-size: 13px;
  align-items: center;
}
.post-meta .more {
  margin-left: auto;
}
.post-meta .more a {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #ddd;
  color: var(--blue-deep);
  font-size: 12px;
  background: #fff;
}
.post-meta .more a:hover {
  background: #0086e3;
  border-color: #0086e3;
  color: #fff;
}

.tag {
  display: inline-block;
  color: #666;
  font-size: 12px;
  padding: 2px 8px;
  background: #f3f3f3;
  border-radius: 3px;
  margin: 0 2px;
}
.tag:hover {
  background: #08a5e0;
  color: #fff;
}

.widget { margin-bottom: 16px; }
.widget:last-child { margin-bottom: 0; }
.widget-title {
  position: relative;
  margin: 0 0 10px;
  padding: 0 0 8px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  border-bottom: 1px solid #f0f0f0;
}
.widget-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 9px;
  width: 4px;
  background: var(--blue);
  border-radius: 2px;
}
.widget-list li {
  border-bottom: 1px dashed #eee;
  padding: 8px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.widget-list li:last-child { border-bottom: 0; }
.widget-list .rank {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 2px;
  background: #e9eef3;
  color: #667;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.widget-list .rank.is-top {
  background: var(--blue);
  color: #fff;
}
.widget-list .item {
  min-width: 0;
  flex: 1;
}
.widget-list a {
  color: #444;
  font-size: 13px;
  line-height: 1.45;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.widget-list a:hover { color: var(--blue-hover); }
.widget-list .date {
  display: block;
  color: var(--soft);
  font-size: 12px;
  margin-top: 2px;
}
.tag-cloud { line-height: 1.9; }
.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #eee;
  padding: 8px 0;
}
.cat-list li:last-child { border-bottom: 0; }
.cat-list a {
  color: #444;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-list a:hover,
.cat-list li.is-active a {
  color: var(--blue-hover);
}
.cat-list em {
  font-style: normal;
  color: var(--soft);
  font-size: 12px;
  background: #f3f3f3;
  padding: 1px 7px;
  border-radius: 10px;
}
.post-meta .cat {
  color: var(--blue-deep);
  font-weight: 600;
}
.post-meta .cat:hover { color: var(--blue-hover); }
.about-box {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.7;
}

.sider .panel {
  padding: 12px 14px;
}

.article-header h1 {
  margin: 0 0 12px;
  color: #222;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
}
.article-body {
  color: #444;
  font-size: 1em;
  line-height: 1.85;
}
.article-body h2,
.article-body h3 {
  margin: 1.5em 0 0.6em;
  color: #222;
}
.article-body p { margin: 0 0 1em; }
.article-body ul,
.article-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
  list-style: disc;
}
.article-body ol { list-style: decimal; }
.article-body pre {
  overflow-x: auto;
  padding: 12px 14px;
  background: #2b2b2b;
  color: #f5f5f5;
  border-radius: 4px;
  margin: 0 0 1em;
  font-size: 0.9em;
}
.article-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}
.article-body :not(pre) > code {
  padding: 2px 4px;
  color: #c7254e;
  background: #f9f2f4;
  border-radius: 4px;
}
.article-body blockquote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 4px solid var(--blue);
  background: #f7fbfd;
  color: #666;
}

.seo-block {
  margin-top: 8px;
  color: var(--soft);
  font-size: 13px;
}
.seo-block .panel { padding: 16px 18px; }
.seo-block h2 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #444;
}
.seo-block article + article { margin-top: 14px; }
.faq-item { margin-top: 8px; }
.faq-item h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #555;
}
.faq-item p { margin: 0; }

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--soft);
  font-size: 13px;
  text-align: center;
}

.status-msg {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--mute);
}
.status-msg.error {
  color: #c0392b;
  border-color: #f0c2c2;
  background: #fff6f6;
}

.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Admin reuse */
.admin-shell {
  width: min(100% - 30px, 900px);
  margin: 20px auto 40px;
}
.admin-shell .panel h1 {
  margin: 0 0 12px;
  color: #222;
  font-size: 1.4rem;
}
.form-grid { display: grid; gap: 12px; }
label { display: grid; gap: 6px; color: #333; font-weight: 600; }
input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #333;
}
textarea {
  min-height: 200px;
  resize: vertical;
  font-family: Consolas, monospace;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 0;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--blue-deep); color: #fff; }
button.secondary, .button.secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}
button.danger { background: #d9534f; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  background: #e8f6fc;
  color: var(--blue-deep);
}
.badge.draft { background: #fff3e0; color: #c27800; }
.preview-pane {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #ddd;
  background: #fafafa;
}