:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --text: #1a1a1a;
  --text-sub: #8a8a8a;
  --line: #ededed;
  --bg: #f7f7f7;
  --card: #ffffff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 64px;
  position: relative;
}

/* 顶部公众号风格头部 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .5px;
}
.topbar .back {
  position: absolute;
  left: 12px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.topbar .right {
  position: absolute;
  right: 14px;
  font-size: 14px;
  font-weight: 400;
  opacity: .95;
}

/* 头部简介 */
.site-head {
  background: linear-gradient(135deg, #07c160, #10d67a);
  color: #fff;
  padding: 26px 20px 30px;
}
.site-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 1px;
}
.site-head p {
  margin: 0;
  font-size: 13px;
  opacity: .92;
}

/* 分段标题 */
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
}
.sec-title::before {
  content: "";
  width: 4px;
  height: 15px;
  background: var(--green);
  border-radius: 2px;
}

/* 文章卡片（公众号消息列表风格） */
.card-list {
  background: var(--card);
}
.card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.card:active { background: #f3f3f3; }
.card .thumb {
  width: 96px;
  height: 72px;
  flex: 0 0 96px;
  border-radius: 8px;
  object-fit: cover;
  background: #e9e9e9;
}
.card .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}
.pin-badge {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  background: var(--green);
  border-radius: 4px;
  padding: 1px 6px;
  flex: 0 0 auto;
}
.cat-badge {
  font-size: 11px;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 0 5px;
  flex: 0 0 auto;
}

/* 空状态 */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

/* 底部 tab 导航 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1;
  text-align: center;
  padding: 9px 0 7px;
  font-size: 12px;
  color: #9a9a9a;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tabbar a .ico { font-size: 20px; line-height: 1; }
.tabbar a.active { color: var(--green); }

/* 文章详情 */
.article-wrap {
  background: #fff;
  padding: 22px 18px 40px;
}
.article-title {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 14px;
}
.article-meta {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.article-meta .author { color: #576b95; }
.article-cover {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 18px;
}
.article-content {
  font-size: 17px;
  line-height: 1.85;
  color: #333;
  word-break: break-word;
}
.article-content img { border-radius: 8px; margin: 12px 0; }
.article-content h1, .article-content h2, .article-content h3 { line-height: 1.4; }
.article-content a { color: #576b95; text-decoration: underline; }
.article-content pre {
  background: #f6f6f6;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 14px;
}
.article-content blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--green);
  background: #f7fbf8;
  color: #555;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 22px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--green);
  color: #fff;
  transition: background .15s;
}
.btn:active { background: var(--green-dark); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.gray { background: #f0f0f0; color: #555; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 16px; }
.btn.danger { background: #fa5151; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 表单 */
.form-block { padding: 16px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
  font-weight: 600;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
  outline: none;
  transition: border .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green); }
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--text-sub); margin-top: 6px; }

/* 求资源页面卡片 */
.req-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.req-card .rt { font-weight: 600; margin-bottom: 4px; }
.req-card .rd { font-size: 13px; color: #666; margin-bottom: 8px; }
.req-card .rm { font-size: 12px; color: var(--text-sub); display: flex; justify-content: space-between; }
.status-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.status-pending { background: #fff3e0; color: #ef8f1c; }
.status-resolved { background: #e8f9ef; color: var(--green); }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; }

/* 分类页 */
.cat-grid { padding: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  cursor: pointer;
}
.cat-item .cn { font-size: 18px; font-weight: 700; }
.cat-item .cc { font-size: 13px; color: var(--text-sub); }
.cat-item:active { background: #f3f3f3; }

.fab-request {
  position: fixed;
  right: 16px;
  bottom: 78px;
  z-index: 25;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(7,193,96,.4);
  cursor: pointer;
}

.loading { text-align: center; color: var(--text-sub); padding: 30px; font-size: 14px; }

/* 主页搜索框 */
.search-bar {
  position: sticky;
  top: 0;
  z-index: 18;
  background: var(--green);
  padding: 0 12px 10px;
}
.search-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 20px;
  padding: 8px 14px;
}
.search-inner .search-ico { font-size: 15px; opacity: .6; }
.search-inner input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  font-family: inherit;
  color: var(--text);
}
.search-inner .search-clear {
  font-size: 14px;
  color: #9a9a9a;
  cursor: pointer;
  padding: 0 4px;
}
