/* ==========================================================================
   东北电刀东方同好会 — 站点样式
   美术风格：参照《凉宫春日的忧郁》官方站 haruhi.tv
             白底、黑字、红色大标题、居中单栏、细分割线、访客计数器
             但链接不使用老式带下划线的纯蓝，间距放宽，手机上也可读
   ========================================================================== */

:root {
  --paper:      #ffffff;
  --paper-soft: #fafafa;
  --ink:        #16181d;
  --ink-soft:   #4a4f58;
  --ink-faint:  #878d97;

  --red:        #d61f2c;   /* SOS 红：标题 */
  --red-deep:   #a8161f;
  --blue:       #1a4fd0;   /* 链接：干净蓝，不带老式下划线 */
  --blue-deep:  #123a9c;

  --line:       #dcdcdc;
  --line-soft:  #ececec;
  --tag-bg:     #fff3d1;
  --tag-line:   #e8c86a;

  --maxw:       880px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
          "Source Han Sans SC", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px 60px;
}

/* ---------- 顶部访客计数器（haruhi.tv 左上/右上那一行小字）---------- */
.visitor {
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 10px 2px 0;
  letter-spacing: .02em;
}
.visitor b {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: .12em;
}

/* ---------- 站头 ---------- */
.masthead {
  text-align: center;
  padding: 18px 0 26px;
}

.site-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 5.6vw, 46px);
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.25;
  color: var(--red);
  text-shadow: 0 1px 0 rgba(214, 31, 44, .12);
}
.site-title a { color: inherit; }
.site-title a:hover { color: var(--red-deep); text-decoration: none; }

.site-sub {
  margin: 0 0 22px;
  font-size: 12.5px;
  letter-spacing: .22em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.emblem-wrap { display: inline-block; margin-bottom: 24px; }
.emblem {
  width: min(240px, 52vw);   /* 内页：小一点的页面标记 */
  height: auto;
  cursor: zoom-in;
  transition: transform .3s ease;
}
.emblem--home { width: min(360px, 70vw); }   /* 首页：一点开就能看到的主视觉 */
.emblem:hover { transform: scale(1.02); }

/* 导航：老站风格的一行小字，用竖线分隔 */
.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 2px;
  font-size: 15px;
}
.menu a {
  padding: 5px 12px;
  color: var(--blue);
  border-radius: 3px;
}
.menu a:hover { color: var(--red); background: var(--paper-soft); text-decoration: none; }
.menu a.is-active { color: var(--red); font-weight: 700; }
.menu .sep { color: var(--line); }

/* ---------- 分割线 ---------- */
.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 30px 0;
}
.rule-soft { border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* ---------- 小标题：红色，居中，前后带小方块 ---------- */
.sec-title {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--red);
  text-align: center;
}
.sec-title::before, .sec-title::after {
  content: "■";
  font-size: 11px;
  color: var(--red);
  opacity: .45;
  vertical-align: 2px;
  margin: 0 10px;
}

.sec-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: -8px 0 18px;
}

.sec-more { text-align: center; margin-top: 20px; font-size: 14px; }

/* ---------- 活动预告：一行行小字 ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: flex;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px dotted var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.news li:last-child { border-bottom: none; }
.news .date {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  padding-top: 3px;
  min-width: 52px;
}
.news strong { color: var(--ink); }
.news .hot {
  font-size: 11px;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 2px;
  padding: 0 4px;
  margin-right: 6px;
  letter-spacing: .06em;
  vertical-align: 1px;
}

/* ---------- 文章列表 ---------- */
.postlist { list-style: none; margin: 0; padding: 0; }
.postlist li { border-bottom: 1px solid var(--line-soft); padding: 16px 2px; }
.postlist li:last-child { border-bottom: none; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-bottom: 5px;
}
.post-meta .date { font-family: var(--font-mono); letter-spacing: .04em; }

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 2px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-line);
  color: #7a5a00;
  letter-spacing: .05em;
}

.post-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--red); text-decoration: none; }

.post-excerpt { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 文章详情 ---------- */
.article-head { text-align: center; margin-bottom: 26px; }
.article-head h1 {
  margin: 6px 0 10px;
  font-size: clamp(22px, 4.2vw, 30px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .02em;
}
.article-head .post-meta { justify-content: center; }

.article-body { font-size: 16px; color: #24262b; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 18px; }
.article-body h2 {
  margin: 34px 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: .06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.article-body h3 {
  margin: 26px 0 10px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
}
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 7px; }
.article-body strong { font-weight: 700; color: #000; }
.article-body code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--red-deep);
}
.article-body blockquote {
  margin: 0 0 18px;
  padding: 12px 18px;
  background: var(--paper-soft);
  border-left: 3px solid var(--red);
  color: var(--ink-soft);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr { border: none; border-top: 1px dashed var(--line); margin: 28px 0; }
.article-body a { border-bottom: 1px solid rgba(26, 79, 208, .35); }
.article-body a:hover { text-decoration: none; border-bottom-color: var(--red); }

.article-foot {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
}
.article-foot a { margin: 0 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { border-color: var(--red); color: var(--red); text-decoration: none; }

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

.btn-row { text-align: center; margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 数据条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 23px;
  color: var(--red);
  letter-spacing: .02em;
}
.stat span { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- 成员 ---------- */
.members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.member { display: flex; gap: 14px; align-items: flex-start; }
.member .avatar {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--red);
  background: var(--paper-soft);
}
.member .who { font-weight: 700; font-size: 16px; }
.member .role { font-size: 12.5px; color: var(--ink-faint); letter-spacing: .06em; }
.member .bio { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.timeline li:last-child { border-bottom: none; }
.timeline .when {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-faint);
  padding-top: 3px;
  min-width: 66px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-faint);
}
.site-footer p { margin: 0 0 6px; }
.site-footer strong { color: var(--ink-soft); }

/* ---------- 图片放大 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 26px;
  background: rgba(255, 255, 255, .96);
  cursor: zoom-out;
}
.lightbox.is-open { display: grid; }
.lightbox img {
  max-width: min(900px, 92vw);
  max-height: 84vh;
  width: auto;
  transition: transform .2s ease;
}
.lightbox-hint {
  position: absolute;
  bottom: 20px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------- 编辑器（写文章页）---------- */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink-soft);
}
.field .hint { font-weight: 400; font-size: 12.5px; color: var(--ink-faint); }
.field input[type=text], .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}
.field textarea { min-height: 300px; resize: vertical; font-size: 14.5px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 79, 208, .1);
}
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

.preview-pane {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  background: var(--paper-soft);
  min-height: 200px;
  font-size: 15px;
  max-height: 560px;
  overflow: auto;
}
.preview-pane .ph { color: var(--ink-faint); font-size: 13.5px; }

.tip-box {
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 3px;
  padding: 14px 18px;
  background: var(--paper-soft);
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}
.tip-box code {
  font-family: var(--font-mono);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}
.tip-box ol, .tip-box ul { margin: 8px 0 0; padding-left: 20px; }

.status-line {
  margin-top: 12px;
  font-size: 13.5px;
  min-height: 20px;
}
.status-ok { color: #17703a; font-weight: 700; }
.status-err { color: var(--red); font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .page { padding: 0 16px 46px; }
  .visitor { text-align: center; }
  .members { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .field textarea { min-height: 220px; }
  .menu { font-size: 14.5px; }
  .menu .sep { display: none; }
  .menu a { padding: 6px 10px; }
  .news .date { min-width: 46px; }
}
