:root {
  --brand: #1d3f63;
  --brand-strong: #142e49;
  --brand-title: #1d3f63;
  --brand-soft: #eef2f7;
  --link: #1f5c96;
  --link-hover: #14406c;
  --text: #111;
  --body-text: #333;
  --muted: #999;
  --faint: #bbb;
  --line: #eee;
  --line-strong: #dfe3e9;
  --warm: #f7f8fa;
  --max-width: 1080px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  color: var(--text);
  font: 14px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.muted { color: var(--muted); }

/* ---------- 顶栏 ---------- */

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

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand { flex: none; }
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  color: var(--brand);
}

.brand:hover .brand-mark { color: var(--brand-strong); }

.searchbox {
  position: relative;
  flex: 0 1 360px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
}

.searchbox input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--body-text);
  background: transparent;
}

.searchbox input[type="search"]::placeholder { color: #b8b8b8; }

.searchbox button {
  flex: none;
  border: 0;
  background: #fafafa;
  color: #999;
  padding: 7px 11px;
  cursor: pointer;
  border-left: 1px solid var(--line);
}

.searchbox button:hover { color: var(--brand); background: #f4f4f4; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.link-muted { color: var(--muted); }
.link-muted:hover { color: var(--brand); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--body-text);
  font-size: 13px;
}

.user-chip:hover { color: var(--brand); text-decoration: none; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 9px 16px;
  font-family: inherit;
  transition: background-color .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }

.btn-ghost { background: #fff; color: var(--brand); border-color: #c9d7e6; }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand-strong); }

.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- 页面容器 ---------- */

.page { min-height: 60vh; padding-bottom: 40px; }

.page > .flash {
  max-width: var(--max-width);
  margin: 14px auto 0;
}

.flash {
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 10px;
}

.flash-ok { background: #eef3f9; border: 1px solid #d6e2ef; color: #23557f; }
.flash-warn { background: #fdf6e8; border: 1px solid #f2e2c0; color: #9a6b16; }

.form-error {
  background: #fdf0f0;
  border: 1px solid #f2d5d5;
  color: #b23c3c;
  padding: 9px 12px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 12px;
}

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

.empty-sm { padding: 16px 0; font-size: 13px; }

/* ---------- 站内搜索：站点结果 ---------- */
.site-result {
  padding: 18px 20px;
  margin: 4px 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--warm);
}

.site-result-title { font-size: 15px; margin-bottom: 4px; }
.site-result-title a { color: var(--link); }
.site-result-tagline { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.site-result-desc { font-size: 14px; line-height: 1.85; color: var(--body-text); }

/* ---------- 头像 ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  border-radius: var(--radius);
  background: #dde3ea;
  flex: none;
  overflow: hidden;
}

.avatar-letter { color: #fff; font-weight: 600; }

.avatar-xs { width: 20px; height: 20px; font-size: 11px; }
.avatar-sm { width: 26px; height: 26px; font-size: 13px; }
.avatar-md { width: 36px; height: 36px; font-size: 16px; }
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 30px; }
.avatar-grid { width: 62px; height: 62px; font-size: 24px; }

/* ---------- 首页 hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);
  border-bottom: 1px solid #eceff3;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before { width: 420px; height: 420px; background: #e2e9f2; right: -90px; top: -170px; }
.hero::after { width: 250px; height: 250px; background: #f0e7dc; left: -70px; bottom: -150px; }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 20px 48px;
  display: flex;
  align-items: center;
  gap: 48px;
}

.hero-copy { flex: 1; min-width: 0; }

.hero-title {
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--brand-strong);
  margin-bottom: 14px;
}

.hero-lead {
  font-size: 15px;
  line-height: 1.9;
  color: #48505a;
  max-width: 30em;
  margin-bottom: 22px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stat { margin-top: 18px; font-size: 13px; color: #7c848d; }
.hero-stat strong { color: var(--brand-strong); font-size: 15px; }

.hero-auth { flex: none; width: 340px; }

/* ---------- 登录 / 注册卡片 ---------- */

.auth-card {
  position: relative;
  background: #fff;
  border: 1px solid #e6eaf0;
  border-radius: 6px;
  padding: 18px 22px 22px;
  box-shadow: 0 3px 14px rgba(30, 55, 85, .08);
  width: 340px;
  max-width: 100%;
}

.auth-card-welcome { display: flex; flex-direction: column; gap: 12px; }

.welcome-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.welcome-name { font-size: 16px; font-weight: 600; }
.welcome-sub { font-size: 12px; color: var(--muted); }

.tab-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auth-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.auth-tabs label {
  cursor: pointer;
  padding: 4px 2px 11px;
  font-size: 15px;
  color: #9c9c9c;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
}

.auth-tabs label:hover { color: var(--brand); }

#tab-login:checked ~ .auth-tabs label[for="tab-login"],
#tab-register:checked ~ .auth-tabs label[for="tab-register"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

.auth-panel { display: none; }
#tab-login:checked ~ .auth-panel-login { display: block; }
#tab-register:checked ~ .auth-panel-register { display: block; }

.auth-closed {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.field { margin-bottom: 12px; }

.field input,
.form-row input[type="text"],
.form-row textarea {
  width: 100%;
  border: 1px solid #dde1e7;
  border-radius: 3px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--body-text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.field input:focus,
.form-row input[type="text"]:focus,
.form-row textarea:focus { border-color: var(--brand); }

.field input::placeholder,
.form-row input::placeholder,
.form-row textarea::placeholder { color: #b8b8b8; }

/* ---------- 卡片式内容块 ---------- */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title { font-size: 16px; color: var(--brand-title); }
.section-more { font-size: 13px; color: var(--link); margin-left: auto; }
.section-count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ---------- 分享条目 ---------- */

.feed-item { padding: 20px 0; border-bottom: 1px solid #f2f2f2; }

.feed-body { display: flex; gap: 28px; align-items: flex-start; }
.feed-main { flex: 1; min-width: 0; }

.feed-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-author-name { font-size: 13px; color: var(--link); }

.feed-title { font-size: 15px; line-height: 1.6; margin-bottom: 6px; }
.feed-title a { color: var(--link); }

.feed-excerpt { font-size: 14px; line-height: 1.85; color: var(--body-text); margin-bottom: 10px; }
.feed-excerpt a { color: var(--body-text); }
.feed-excerpt a:hover { color: var(--link); text-decoration: none; }

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.feed-meta a { color: var(--muted); }
.feed-meta a:hover { color: var(--brand); }
.feed-pubdate-wrap { color: #b0b0b0; }
.feed-pubdate { color: #8f8f8f; }

.feed-thumb { flex: none; display: block; }
.feed-thumb img {
  width: 132px;
  height: 96px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line);
  display: block;
}

.feed-more { padding: 20px 0; font-size: 13px; }

/* ---------- 分页 ---------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0 0;
  font-size: 13px;
}

.pagination-info { color: var(--muted); }

/* ---------- 详情页 ---------- */

.detail-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 0;
  display: flex;
  gap: 46px;
  align-items: flex-start;
}

.detail-main { flex: 1; min-width: 0; }
.detail-side { flex: none; width: 296px; }

.post-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.post-head-text { min-width: 0; }

.post-author { font-size: 16px; font-weight: 400; line-height: 1.4; }
.post-author a { color: var(--link); }
.post-says { color: var(--body-text); }

.post-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
}

.post-pubdate { color: #8f8f8f; }
.post-location { color: #8f8f8f; }
.post-views { color: #b0b0b0; }

.post-title { font-size: 20px; line-height: 1.5; margin-bottom: 14px; }

.post-content { font-size: 15px; line-height: 1.95; color: var(--body-text); }
.post-content p { margin-bottom: 14px; }
.post-content p:last-child { margin-bottom: 0; }

.post-figure { margin: 22px 0 0; }
.post-figure img { display: block; width: 100%; border-radius: 3px; }
.post-figure figcaption { margin-top: 9px; font-size: 12px; color: var(--faint); }

.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.inline-form { display: inline; }

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e2c9c9;
  background: #fff;
  color: #c0533f;
  border-radius: 3px;
  padding: 7px 15px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s;
}

.btn-like:hover { background: #fdf3f1; color: #c0533f; text-decoration: none; }
.btn-like.is-active { background: #fbeceb; border-color: #e0b3ae; }
.btn-like-icon { font-size: 13px; line-height: 1; }

.btn-plain {
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 7px 15px;
  background: #fff;
}

.btn-plain:hover { color: var(--brand); border-color: #c9d7e6; text-decoration: none; }

/* ---------- 侧栏 ---------- */

.author-card {
  background: var(--warm);
  border: 1px solid #eef0f4;
  border-radius: var(--radius);
  padding: 16px;
}

.author-card-head { display: flex; align-items: flex-start; gap: 14px; }
.author-card-name { flex: 1; min-width: 0; }
.author-card-name a { font-size: 15px; color: var(--link); }
.author-card-loc { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.author-card-bio { font-size: 13px; line-height: 1.8; color: #666; margin-top: 12px; }

.back-link { margin: 20px 0; font-size: 13px; }
.back-arrow { color: var(--muted); margin-right: 4px; }

.likers { margin-top: 6px; }
.likers-count { font-size: 14px; color: var(--brand-title); margin-bottom: 14px; }

.likers-grid { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.likers-grid li { width: 62px; }
.likers-grid a { display: block; text-align: center; }
.likers-grid a:hover { text-decoration: none; }
.likers-grid a:hover .liker-name { color: var(--brand); }

.liker-name {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 评论 ---------- */

.comments { margin-top: 34px; }

.comments-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.comments-head h2 { font-size: 16px; color: var(--brand-title); }
.comments-count { font-size: 13px; color: var(--muted); font-weight: 400; }

.comment-form { margin-bottom: 26px; }

.comment-form textarea {
  width: 100%;
  border: 1px solid #dde1e7;
  border-radius: 3px;
  padding: 11px;
  font-size: 14px;
  line-height: 1.8;
  font-family: inherit;
  color: var(--body-text);
  resize: vertical;
  outline: none;
}

.comment-form textarea:focus { border-color: var(--brand); }
.comment-form-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.comment-login { font-size: 13px; color: var(--muted); margin-bottom: 22px; }

.comment-list { border-top: 1px solid #f4f4f4; }

.comment-item {
  display: flex;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #f4f4f4;
}

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

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 7px;
}

.comment-author { color: var(--link); }
.comment-pubdate { color: var(--faint); font-size: 12px; }

.comment-content { font-size: 14px; line-height: 1.85; color: var(--body-text); }
.comment-content p { margin-bottom: 8px; }
.comment-content p:last-child { margin-bottom: 0; }

/* ---------- 作者页 ---------- */

.user-head {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 34px 20px 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.user-name { font-size: 22px; margin-bottom: 6px; }

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.user-bio { font-size: 14px; line-height: 1.85; color: #555; margin-top: 10px; max-width: 46em; }

/* ---------- 表单页 ---------- */

.form-page { max-width: 720px; margin: 0 auto; padding: 34px 20px 0; }

.form-head { margin-bottom: 22px; }
.form-title { font-size: 22px; color: var(--brand-strong); margin-bottom: 8px; }
.form-lead { font-size: 14px; color: var(--muted); }

.card-form {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 24px;
}

.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 600;
}

.label-hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.label-required { font-weight: 400; font-size: 12px; color: #c0533f; }

.form-row textarea { resize: vertical; line-height: 1.85; }

.form-row input[type="file"] {
  width: 100%;
  font-size: 13px;
  color: #666;
  background: #fff;
  border: 1px dashed #d6dae1;
  border-radius: 3px;
  padding: 12px;
}

.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-note { font-size: 12px; color: var(--faint); margin-left: auto; }

/* ---------- 登录 / 注册独立页 ---------- */

.auth-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.auth-page-copy { flex: 1; min-width: 0; max-width: 26em; }
.auth-page-title { font-size: 28px; color: var(--brand-strong); margin-bottom: 14px; letter-spacing: 1px; }
.auth-page-lead { font-size: 14px; line-height: 1.9; color: #5a626c; }

/* ---------- 页脚 ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 46px; }

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 20px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer-links { margin-left: auto; display: flex; gap: 16px; }
.site-footer-links a { color: var(--muted); }
.site-footer-links a:hover { color: var(--brand); }

/* ---------- 时间因子声明 ---------- */

.time-decl {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--warm);
  padding: 6px 12px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--body-text);
  white-space: nowrap;
}

.time-decl-key {
  color: var(--brand);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-weight: 500;
}

.time-decl-val { color: #5b626d; }

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; }
  .searchbox { order: 3; flex: 1 1 100%; }
  .hero-inner { flex-direction: column; align-items: stretch; gap: 28px; }
  .hero-auth { width: 100%; }
  .auth-card { width: 100%; }
  .detail-layout { flex-direction: column; gap: 30px; }
  .detail-side { width: 100%; }
  .auth-page { flex-direction: column; gap: 30px; }
  .feed-thumb img { width: 104px; height: 78px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-footer-links { margin-left: 0; }
}
