/* 应龙计算 · 投稿模块共用样式
   三套主题：明亮(light) / 暗黑(dark) / 霓虹(neon)，由 <html data-theme="..."> 切换 */

/* ---------- 主题变量 ---------- */
:root{
  --green: #219912;
  --page-bg: #ffffff;
  --ink: #0a0e13;
  --text-soft: #6b7684;
  --muted: #9aa3ad;
  --line: #e6eaef;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --chip-bg: #f2f7f4;
  --tag-bg: #eef8ee;
  --ok-bg: #f0fbf0;   --ok-ink: #14660a;   --ok-line: #bfe6b8;
  --err-bg: #fdf3f2;  --err-ink: #8a1f19;  --err-line: #f0c9c5;
  --glow: none;
}

html[data-theme="dark"]{
  --green: #3ec22c;
  --page-bg: #0d1117;
  --ink: #e6edf3;
  --text-soft: #98a2ad;
  --muted: #6e7781;
  --line: #2a313c;
  --card-bg: #131922;
  --input-bg: #0f141b;
  --chip-bg: rgba(255,255,255,.08);
  --tag-bg: rgba(62,194,44,.16);
  --ok-bg: rgba(62,194,44,.12);   --ok-ink: #8ce87b;  --ok-line: rgba(62,194,44,.35);
  --err-bg: rgba(226,72,60,.12);  --err-ink: #ff9b91; --err-line: rgba(226,72,60,.35);
  --glow: none;
}

html[data-theme="neon"]{
  --green: #2bf5a0;
  --page-bg: #0a0714;
  --ink: #ecf7ff;
  --text-soft: #a99ad6;
  --muted: #8b7cc8;
  --line: rgba(0,240,255,.22);
  --card-bg: rgba(255,255,255,.03);
  --input-bg: rgba(255,255,255,.045);
  --chip-bg: rgba(0,240,255,.12);
  --tag-bg: rgba(0,240,255,.14);
  --ok-bg: rgba(43,245,160,.12);  --ok-ink: #7dffcf;  --ok-line: rgba(43,245,160,.35);
  --err-bg: rgba(255,45,149,.12); --err-ink: #ff8ad0; --err-line: rgba(255,45,149,.35);
  --glow: 0 0 14px rgba(0,240,255,.45);
}

/* ---------- 基础 ---------- */
*{ margin:0; padding:0; box-sizing:border-box; }

html{ height:100%; }

body{
  min-height: 100%;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Source Han Sans CN", "Source Han Sans SC", "Noto Sans SC", "HarmonyOS Sans SC",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  transition: background-color .45s ease, color .45s ease;
}

/* ---------- 顶部导航 ---------- */
.site-nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--pad-x);
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
  flex-wrap: wrap;
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand svg{ width: 34px; height: auto; display: block; }
.brand span{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  transform: skewX(-7deg);
  display: inline-block;
  text-shadow: var(--glow);
}

.nav-right{ display: flex; align-items: center; gap: clamp(14px, 2.5vw, 22px); flex-wrap: wrap; }

.nav-links{ display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
.nav-links a{
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav-links a:hover{ color: var(--ink); }
.nav-links a.active{ color: var(--ink); font-weight: 700; border-bottom-color: var(--green); }

/* ---------- 主题切换按钮（色块 + 文字）---------- */
.theme-switch{ display: flex; align-items: center; gap: 8px; }

.theme-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px 5px 7px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.theme-btn:hover{ color: var(--ink); border-color: var(--green); }
.theme-btn.active{
  color: var(--ink);
  border-color: var(--green);
  background: var(--chip-bg);
  font-weight: 700;
}

.swatch{
  width: 14px; height: 14px;
  border-radius: 4px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(127,127,127,.25);
}
.swatch-neon{ background: linear-gradient(135deg, #00f0ff 0%, #a855f7 55%, #ff2bd6 100%); }
.swatch-dark{ background: linear-gradient(135deg, #252c36 0%, #0d1117 100%); }
.swatch-light{ background: linear-gradient(135deg, #ffffff 0%, #dfe5ec 100%); }

/* ---------- 主体 ---------- */
.container{
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 56px) var(--pad-x) 64px;
  flex: 1;
}

.page-title{
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 900;
  letter-spacing: .04em;
  transform: skewX(-7deg);
  display: inline-block;
  text-shadow: var(--glow);
}
.page-desc{
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* ---------- 表单 ---------- */
.form{ margin-top: 28px; }
.field{ margin-bottom: 20px; }

.label{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.label span:first-child{ font-size: 14px; font-weight: 700; }
.label .optional{ font-size: 12px; color: var(--muted); }
.counter{ font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over{ color: #d0342c; }

input[type="text"], select, textarea{
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .3s ease;
}
textarea{ min-height: 180px; line-height: 1.75; resize: vertical; }
input[type="text"]:focus, select:focus, textarea:focus{
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(33,153,18,.12);
}
select{ cursor: pointer; }
select option{ background: var(--page-bg); color: var(--ink); }

.btn{
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  transition: filter .2s ease, opacity .2s ease;
}
.btn:hover{ filter: brightness(1.08); }
.btn:disabled{ opacity: .55; cursor: not-allowed; }

.msg{
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: none;
}
.msg.show{ display: block; }
.msg.ok{ color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }
.msg.err{ color: var(--err-ink); background: var(--err-bg); border-color: var(--err-line); }

/* ---------- 文章列表 ---------- */
.posts{ margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }

.post{
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  background: var(--card-bg);
  transition: border-color .2s ease, background-color .3s ease;
}
.post:hover{ border-color: var(--green); }

.post-head{ display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.tag{
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 3px 10px;
}
.post-title{ font-size: 18px; font-weight: 800; line-height: 1.4; word-break: break-word; }
.post-meta{ margin-bottom: 12px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.post-body{
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty, .loading{ font-size: 14px; color: var(--muted); padding: 24px 0; }

/* ---------- 底部 ---------- */
.site-footer{
  padding: 18px var(--pad-x) 26px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .52em;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
