/* ==========================================================
   文件：style.css
   说明：安逸观屿 · 全站公共样式（原生 CSS，无任何依赖）
   ========================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --text: #22252a;
  --text-soft: #5c6370;
  --text-mute: #8b919c;
  --line: #ebebed;
  --accent: #2f7d78;
  --accent-hover: #235e5a;
  --radius: 10px;
  --max: 860px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 3. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
}

.logo:hover {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-menu a {
  font-size: 15px;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
}

/* ---------- 4. 首屏简介 ---------- */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.hero p {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 620px;
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 13px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ---------- 5. 文章列表 ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 44px 0 6px;
}

.section-title h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
}

.section-title span {
  font-size: 13px;
  color: var(--text-mute);
}

.post-list {
  padding-bottom: 20px;
}

.post {
  display: block;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: transform 0.18s ease;
}

.post:hover {
  transform: translateX(3px);
}

.post-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 8px;
}

.post-cat {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.post h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
  transition: color 0.18s ease;
}

.post:hover h3 {
  color: var(--accent);
}

.post p {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.post-foot {
  font-size: 13px;
  color: var(--text-mute);
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
  font-size: 13px;
  color: var(--text-mute);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

/* ---------- 7. 登录页 ---------- */
body.page-auth {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 60px;
  background: var(--bg-soft);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 32px 34px;
}

.auth-head {
  text-align: center;
  margin-bottom: 28px;
}

.auth-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.auth-head p {
  font-size: 13px;
  color: var(--text-mute);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.18s ease;
}

.field input:focus {
  border-color: var(--accent);
}

.field input::placeholder {
  color: #c2c6ce;
}

.btn-primary {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  font-size: 15px;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* 表单提示条（错误 / 成功） */
.form-alert {
  display: none;
  margin-bottom: 16px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 6px;
}

.form-alert.error {
  color: #a94442;
  background: #fdf1f0;
  border: 1px solid #f5d8d5;
}

.form-alert.success {
  color: #2f7d78;
  background: #eef7f6;
  border: 1px solid #d0e6e4;
}

/* 导航栏登录状态 */
.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
}

.nav-user .uname {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
}

/* 登录 / 注册 切换 */
.auth-switch {
  display: flex;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.auth-switch a {
  flex: 1;
  padding-bottom: 10px;
  font-size: 15px;
  color: var(--text-mute);
  text-align: center;
}

.auth-switch a.on {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

/* 记住我 / 忘记密码 */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 18px;
  font-size: 13px;
  color: var(--text-soft);
}

.auth-row .remember {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.auth-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-row a:hover {
  color: var(--accent);
}

/* 用户协议 */
.auth-agree {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-mute);
  text-align: center;
}

.auth-agree a {
  color: var(--accent);
}

.auth-tip {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
}

/* 分隔线 */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 20px;
  font-size: 12px;
  color: var(--text-mute);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* QQ 登录按钮：页面加载即可见，无懒加载、无弹窗 */
.btn-qq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  font-size: 15px;
  color: var(--text);
  background: #f4f7fc;
  border: 1px solid #dce6f5;
  border-radius: 6px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-qq:hover {
  background: #e9f0fa;
  border-color: #c6d7ef;
}

/* QQ 官方图标尺寸（图标上传后生效） */
.btn-qq img {
  width: 22px;
  height: 22px;
}

.auth-foot {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
}

.auth-foot a {
  color: var(--accent);
}

/* ---------- 8. 文章详情页 ---------- */
.crumb {
  padding: 26px 0 0;
  font-size: 13px;
  color: var(--text-mute);
}

.crumb a:hover {
  color: var(--accent);
}

.article-head {
  padding: 14px 0 24px;
  border-bottom: 1px solid var(--line);
}

.article-head h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

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

.article-meta .post-cat {
  font-size: 13px;
}

.article-body {
  padding: 30px 0 10px;
  font-size: 16px;
  color: #31353d;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 34px 0 14px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  line-height: 1.4;
}

.article-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 10px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-body ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-body strong {
  font-weight: 600;
  color: var(--text);
}

.article-body a {
  color: var(--accent);
  border-bottom: 1px solid #cfe0de;
}

/* 行内代码 */
.article-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  color: #c0392b;
  background: #f6f7f9;
  border-radius: 4px;
}

/* 代码块 */
.article-body pre {
  margin: 0 0 22px;
  padding: 16px 18px;
  overflow-x: auto;
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: #3a4048;
}

.article-body pre code {
  padding: 0;
  color: inherit;
  background: none;
  font-size: inherit;
}

/* 引用 */
.article-body blockquote {
  margin: 0 0 22px;
  padding: 12px 18px;
  color: var(--text-soft);
  background: var(--bg-soft);
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
}

/* 结尾标记 */
.article-end {
  padding-top: 6px;
  font-size: 14px;
  color: var(--text-mute);
  text-align: center;
}

/* 上一篇 / 下一篇 */
.article-nav {
  display: flex;
  gap: 16px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.article-nav a {
  flex: 1;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.article-nav a:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.article-nav .nav-label {
  display: block;
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 4px;
}

.article-nav .nav-title {
  font-size: 14px;
  line-height: 1.6;
}

.article-nav .next {
  text-align: right;
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  .hero {
    padding: 48px 0 34px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .nav-menu {
    gap: 20px;
  }

  .nav-menu a {
    font-size: 14px;
  }

  .post h3 {
    font-size: 18px;
  }

  .article-head h1 {
    font-size: 23px;
  }

  .article-body {
    font-size: 15.5px;
  }

  .article-nav {
    flex-direction: column;
    gap: 12px;
  }

  .article-nav .next {
    text-align: left;
  }

  .auth-card {
    padding: 30px 22px 28px;
    border: none;
    background: transparent;
  }

  .auth-wrap {
    padding: 24px 18px 40px;
  }
}
