/* ===== TreeHole 设计系统 =====
   风格：Soft Dark（柔和暗色，森林夜语）
   字体：标题/卡片正文 Noto Serif SC（衬线，阅读感），UI Noto Sans SC
   图标：内联 SVG（Lucide 风格），禁用 emoji 图标
*/
:root {
  --bg: #0d1411;
  --bg-soft: #131d18;
  --card: #182420;
  --card-hover: #1e2d27;
  --line: #2a3d33;
  --text: #e9f1ec;
  --text-dim: #9aafa2;
  --accent: #82cba7;
  --accent-deep: #4ea97f;
  --warn: #e3b061;
  --danger: #e07575;
  --radius: 18px;
  --font-serif: "Noto Serif SC", "Lora", "Songti SC", "STSong", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1100px 550px at 85% -10%, rgba(130, 203, 167, 0.09), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(78, 169, 127, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

::selection { background: rgba(130, 203, 167, .3); }

/* 焦点可见性（键盘导航无障碍） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== 顶栏 ===== */
.topbar {
  width: 100%;
  max-width: 720px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
}
.brand svg { width: 22px; height: 22px; }

.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a, .energy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
  cursor: pointer;
}
.nav a svg, .energy-pill svg { width: 14px; height: 14px; }
.nav a:hover, .nav a.active { color: var(--accent); border-color: var(--accent-deep); background: rgba(130, 203, 167, .08); }
.energy-pill { color: var(--warn); border-color: rgba(227, 176, 97, .45); }
.energy-pill b { font-size: 15px; font-weight: 700; }

main {
  width: 100%;
  max-width: 720px;
  padding: 12px 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

/* ===== 进入页 ===== */
.enter-wrap {
  margin-top: 10vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeUp .5s var(--ease);
  padding: 0 8px;
}
.enter-logo { width: 64px; height: 64px; color: var(--accent); opacity: .95; }
.enter-wrap h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  letter-spacing: 6px;
  font-weight: 700;
}
.enter-wrap .sub { color: var(--text-dim); line-height: 2; font-size: 15px; max-width: 430px; }
.enter-form { display: flex; gap: 10px; margin-top: 10px; width: 360px; max-width: 100%; }
.enter-form input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.enter-form input:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(130, 203, 167, .15); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  border-radius: 13px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #0b120e;
  font-weight: 700;
  transition: filter .18s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(78, 169, 127, .3); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-deep);
  font-weight: 500;
}
.btn.ghost:hover { background: rgba(130, 203, 167, .08); box-shadow: none; }

/* ===== 卡片 ===== */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
  animation: fadeUp .35s var(--ease);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 8px; }
.badge { font-size: 12px; padding: 4px 13px; border-radius: 999px; font-weight: 600; letter-spacing: 1px; }
.badge-A { background: rgba(227, 176, 97, .14); color: var(--warn); border: 1px solid rgba(227, 176, 97, .38); }
.badge-B { background: rgba(130, 203, 167, .14); color: var(--accent); border: 1px solid rgba(130, 203, 167, .38); }
.badge-C { background: rgba(135, 165, 224, .14); color: #9db7ec; border: 1px solid rgba(135, 165, 224, .38); }
.badge-D { background: rgba(200, 135, 224, .14); color: #cf9dec; border: 1px solid rgba(200, 135, 224, .38); }
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
}
.source-tag svg { width: 13px; height: 13px; }
.card-body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: .5px;
}

.card-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
}
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 17px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.react-btn svg { width: 15px; height: 15px; }
.react-btn:hover { border-color: var(--accent-deep); color: var(--text); }
.react-btn.on-like { color: var(--accent); border-color: var(--accent); background: rgba(130, 203, 167, .12); }
.react-btn.on-like svg { fill: var(--accent); }
.react-btn.on-dislike { color: var(--danger); border-color: var(--danger); background: rgba(224, 117, 117, .1); }

.actions-row { display: flex; gap: 12px; margin-top: 24px; width: 100%; justify-content: center; flex-wrap: wrap; }

/* ===== 提示/占位 ===== */
.placeholder { margin-top: 9vh; text-align: center; color: var(--text-dim); line-height: 2.1; animation: fadeUp .4s var(--ease); }
.placeholder svg { width: 46px; height: 46px; margin-bottom: 12px; color: var(--accent-deep); }
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-hover);
  border: 1px solid var(--accent-deep);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  animation: fadeUp .25s var(--ease);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  max-width: 90vw;
}
.toast.error { border-color: var(--danger); }

/* ===== Give 表单 ===== */
.give-card { width: 100%; }
.give-card h2 { font-family: var(--font-serif); font-size: 21px; margin-bottom: 6px; letter-spacing: 1px; }
.give-card .hint { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; line-height: 1.7; }
.field-label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.cat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-opt {
  padding: 8px 19px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
  user-select: none;
}
.cat-opt:hover { color: var(--text); }
.cat-opt.selected { color: var(--accent); border-color: var(--accent); background: rgba(130, 203, 167, .12); }
textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  padding: 15px 17px;
  font-size: 16px;
  line-height: 1.9;
  font-family: var(--font-serif);
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
textarea:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(130, 203, 167, .13); }
.char-count { text-align: right; font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ===== Likes 列表 ===== */
.list { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.list-item .card-body { font-size: 16px; }
.list-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
}
.list-time svg { width: 12px; height: 12px; fill: var(--accent); color: var(--accent); }
.empty { text-align: center; color: var(--text-dim); margin-top: 13vh; line-height: 2.3; }
.empty svg { width: 44px; height: 44px; color: var(--accent-deep); margin-bottom: 12px; }

/* ===== 认证表单（登录/注册/重置/设置） ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 360px;
  max-width: 100%;
  margin-top: 6px;
}
.auth-form input {
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.auth-form input:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(130, 203, 167, .15); }
.auth-links { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-dim); }
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.reset-result {
  margin-top: 8px;
  padding: 16px 22px;
  border: 1px solid var(--accent-deep);
  border-radius: var(--radius);
  background: rgba(130, 203, 167, .08);
  line-height: 2;
  font-size: 15px;
}
.reset-result b { color: var(--accent); font-size: 18px; letter-spacing: 1px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== 管理页 ===== */
.admin-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-filters select, .admin-filters input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.admin-filters input { flex: 1; min-width: 160px; }
.admin-filters select:focus, .admin-filters input:focus { border-color: var(--accent-deep); }
.admin-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(42, 61, 51, .5);
  vertical-align: top;
}
.admin-table tbody tr:hover { background: rgba(130, 203, 167, .04); }
.admin-body { word-break: break-all; line-height: 1.6; }
.admin-op {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
  font-family: inherit;
  transition: all .15s var(--ease);
}
.admin-op:hover { color: var(--accent); border-color: var(--accent-deep); }
.admin-op.danger:hover { color: var(--danger); border-color: var(--danger); }
.admin-pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 16px; font-size: 13px; color: var(--text-dim); }

/* ===== 全局页脚 ===== */
.site-footer {
  width: 100%;
  padding: 20px 16px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.footer-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 500;
}
.footer-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: block;
}

/* ===== 动画 ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 尊重减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .enter-wrap h1 { font-size: 34px; }
  .enter-form { flex-direction: column; }
  .card { padding: 22px 18px 16px; }
  .card-body { font-size: 17px; }
  .topbar { padding: 14px 14px; }
  main { padding: 8px 14px 56px; }
}
