:root {
  --bg: #f5f6f8;
  --bg-2: #eef0f4;
  --card: #ffffff;
  --text: #14161a;
  --text-2: #565c6b;
  --muted: #8b92a1;
  --line: #e8eaef;
  --line-2: #f0f1f5;
  --accent: #ff8200;
  --accent-soft: #fff4e8;
  --accent-2: #ff5a2e;
  --danger: #e5484d;
  --ok: #17a673;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lift: 0 2px 6px rgba(16, 24, 40, .06), 0 14px 34px rgba(16, 24, 40, .09);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 420px at 50% -8%, #fff7ee 0%, rgba(255, 247, 238, 0) 62%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* 字体不做任何压缩：字号给足、行距放宽、字距正常 */
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 14px 104px;
}

/* ---------- header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 246, 248, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(232, 234, 239, .8);
}

.hd {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 56px;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.logo {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-size: 17px; font-weight: 700;
  flex: 0 0 auto;
  box-shadow: 0 3px 10px rgba(255, 106, 46, .32);
}

.hd h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .2px; }
.hd .spacer { flex: 1; }

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 11px;
  display: grid; place-items: center;
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: background .15s, border-color .15s;
}
.icon-btn:active { background: var(--line-2); border-color: #dcdfe6; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
}

.label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px;
}
.label .hint { font-weight: 400; color: var(--muted); font-size: 13px; }

input[type=text], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
  -webkit-appearance: none;
  appearance: none;
}
input[type=text]:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 130, 0, .12);
}
textarea { resize: none; min-height: 66px; }
input::placeholder, textarea::placeholder { color: var(--muted); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b92a1' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .1s, opacity .15s, box-shadow .2s;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 5px 16px rgba(255, 106, 46, .3);
  text-decoration: none;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn.ghost {
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:active { background: var(--line-2); }
.btn.sm { min-height: 42px; font-size: 15px; border-radius: var(--radius-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c2570a;
  font-size: 13px;
  border: 1px solid #ffe3c4;
  cursor: pointer;
}
.chip:active { background: #ffe9d2; }

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  background: var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.note b { color: var(--text-2); font-weight: 600; }

.check {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px;
  font-size: 14px; color: var(--text-2);
  cursor: pointer;
}
.check input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  margin: 0;
}

/* ---------- post preview ---------- */
.post { display: flex; gap: 12px; }
.post .avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--line);
}
.post .who { font-weight: 600; font-size: 15px; }
.post .meta { color: var(--muted); font-size: 13px; }
.post .txt {
  margin-top: 5px; font-size: 15px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- results ---------- */
.summary {
  display: flex; align-items: baseline; gap: 9px;
  margin: 18px 4px 10px;
}
.summary b { font-size: 19px; }
.summary span { color: var(--muted); font-size: 13px; }
.summary .warn-tag {
  align-self: center;
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #8a4b00;
  background: #fff0dc;
  border: 1px solid #ffd9a8;
}

.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}
.item:hover { box-shadow: var(--shadow-lift); }

.item .top { display: flex; align-items: center; gap: 10px; }
.rank {
  width: 26px; height: 26px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: #f0f1f4; color: var(--text-2);
}
.rank.top1 { background: linear-gradient(135deg, #ff9a2e, #ff5a2e); color: #fff; box-shadow: 0 2px 8px rgba(255, 106, 46, .3); }
.rank.top2 { background: linear-gradient(135deg, #ffb86b, #ff8a3d); color: #fff; }
.rank.top3 { background: linear-gradient(135deg, #ffd08a, #ffab5e); color: #fff; }

.item .avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--line);
}
.item .uname {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1 1 auto; min-width: 0;
}
.item .likes {
  margin-left: auto; flex: 0 0 auto;
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.item .likes b { color: var(--accent); font-size: 15px; }

.item .body {
  margin: 11px 0 0;
  font-size: 16px;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}
.item .body mark {
  background: #ffe9a8;
  color: inherit;
  padding: 0 3px;
  border-radius: 4px;
  font-weight: 600;
}

.pics { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.pics img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fafafb;
}

.item .foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px;
}
.item .foot .src { color: var(--muted); font-size: 13px; margin-right: auto; }

/* 直达操作：主按钮唤起 App + 一个复制按钮 */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
/* 主按钮（唤起 App）与「复制」并排 */
.actions .go { flex: 1 1 auto; min-width: 0; }
.actions .cp { flex: 0 0 54px; padding: 0; min-width: 54px; }

/* ---------- misc ---------- */
.msg {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.7;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
}
.msg.err { background: #fff5f5; border-color: #ffd7d8; color: #b4232a; }
.msg.ok { background: #f2fbf6; border-color: #cdefdc; color: #10704f; }

/* ---------- 登录态提示条（Cookie 缺失/失效时顶在最上面，不藏着） ---------- */
.top-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 12px 14px 0;
  padding: 13px 14px;
  border-radius: 16px;
  background: #fff8ed;
  border: 1.5px solid #ffd9a8;
  box-shadow: 0 6px 18px rgba(255, 130, 0, .10);
  animation: taIn .28s ease;
}
.top-alert.expired { background: #fff5f5; border-color: #ffc9ca; box-shadow: 0 6px 18px rgba(229, 72, 77, .12); }
.top-alert.hidden { display: none !important; }

@keyframes taIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.ta-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: #ff8200;
  color: #fff;
  font-size: 14px; font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.top-alert.expired .ta-icon { background: var(--danger); }

.ta-body { flex: 1 1 auto; min-width: 0; }
.ta-body strong {
  display: block;
  font-size: 15px;
  line-height: 1.6;
  color: #8a4b00;
}
.top-alert.expired .ta-body strong { color: #b4232a; }
.ta-body span {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #6b573d;
}
.top-alert.expired .ta-body span { color: #8c3b3f; }

.ta-btn {
  flex: 0 0 auto;
  align-self: center;
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #ff8200;
  cursor: pointer;
}
.top-alert.expired .ta-btn { background: var(--danger); }
.ta-btn:active { transform: scale(.96); }

/* ---------- 结果区醒目提醒：评论没扫全时必须让你看见 ---------- */
.alert {
  display: flex;
  gap: 11px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid #ffd9a8;
  background: #fff8ed;
}
.alert.expired { border-color: #ffc9ca; background: #fff5f5; }

.alert-i {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: #ff8200;
  color: #fff;
  font-size: 14px; font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.alert.expired .alert-i { background: var(--danger); }

.alert-b { flex: 1 1 auto; min-width: 0; }
.alert-b b {
  display: block;
  font-size: 15.5px;
  line-height: 1.6;
  color: #8a4b00;
}
.alert.expired .alert-b b { color: #b4232a; }
.alert-b p {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.72;
  color: #6b573d;
}
.alert.expired .alert-b p { color: #8c3b3f; }
.alert-b p em {
  font-style: normal;
  font-weight: 700;
  color: #8a4b00;
}
.alert.expired .alert-b p em { color: #b4232a; }
.alert-b .link-btn {
  display: inline-block;
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #ff8200;
  cursor: pointer;
}
.alert.expired .alert-b .link-btn { background: var(--danger); }
.alert-b .link-btn:active { transform: scale(.96); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  height: 104px; border-radius: var(--radius);
  background: linear-gradient(90deg, #f0f1f4 25%, #f7f8fa 37%, #f0f1f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  margin-bottom: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

.bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
}
.bottom-bar .inner { max-width: 600px; margin: 0 auto; display: flex; gap: 10px; }

/* ---------- sheet ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16, 24, 40, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  max-height: 88vh; overflow-y: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto;
  box-shadow: 0 -8px 30px rgba(16, 24, 40, .1);
}
.sheet.show { transform: translateY(0); }
.sheet .grab { width: 38px; height: 4px; background: #dcdfe6; border-radius: 2px; margin: 9px auto 6px; }
.sheet h2 { font-size: 17px; margin: 8px 18px 6px; }
.sheet .content { padding: 6px 18px 0; }
.sheet p { color: var(--text-2); font-size: 14px; line-height: 1.75; }
.sheet ol { padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.75; }
.sheet li { margin: 5px 0; }
.sheet .actions { display: flex; gap: 10px; padding: 16px 18px 0; }

code.inline {
  background: #f0f1f4; padding: 2px 6px; border-radius: 6px;
  font-size: 13px; word-break: break-all;
}

.hidden { display: none !important; }

.empty {
  text-align: center; color: var(--muted); font-size: 14px;
  line-height: 1.8;
  padding: 30px 14px;
}
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .55; }
