/* ==========================================================
   赛博树洞 · 样式
   隔离原则：本文件不依赖旅行 app 的任何样式，全部自包含
   ========================================================== */

:root {
  --bg: #0A0A0A;
  --ink: #F2F2F2;
  --grey: #8A8A8A;
  --dim: #3A3A3A;
  --line: #1C1C1C;
  --lime: #C8FF00;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.mono {
  font-family: "SF Mono", Menlo, "Courier New", monospace;
}

.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 26px calc(env(safe-area-inset-bottom) + 30px);
  display: flex;
  flex-direction: column;
}

/* 扫描线叠加，营造赛博质感 */
.app::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
  opacity: .55;
  z-index: 9;
}

/* ---------------- 屏幕切换 ---------------- */

.scr {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.scr.on {
  display: flex;
  animation: fadein .45s ease;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #9A9A9A;
  flex: none;
  margin-bottom: 8px;
}

.topbar .mark {
  width: 8px;
  height: 8px;
  background: var(--lime);
  flex: none;
}

/* ---------------- 黑洞 ---------------- */

.hole-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 12px auto 22px;
  flex: none;
  transition: transform .9s cubic-bezier(.4, 0, .9, .6);
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    rgba(200, 255, 0, .5) 36deg,
    rgba(200, 255, 0, .06) 132deg,
    transparent 210deg);
  -webkit-mask: radial-gradient(circle, transparent 0 61%, #000 63% 70%, transparent 72%);
  mask: radial-gradient(circle, transparent 0 61%, #000 63% 70%, transparent 72%);
  animation: spin 7s linear infinite;
}

.core {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, #000 34%, #050505 58%, rgba(200, 255, 0, .09) 80%, transparent 90%);
  box-shadow: 0 0 64px rgba(200, 255, 0, .09), inset 0 0 46px #000;
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .92; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* 吸入 */
.scr.sucking .hole-wrap { transform: scale(1.38); }
.scr.sucking h1,
.scr.sucking .input-wrap,
.scr.sucking .btn,
.scr.sucking .legal,
.scr.sucking .topbar {
  animation: suck .95s cubic-bezier(.45, 0, .9, .55) forwards;
}

@keyframes suck {
  0%   { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
  60%  { opacity: .5; }
  100% { transform: translateY(-190px) scale(.06); opacity: 0; filter: blur(7px); }
}

/* ---------------- 文案 ---------------- */

h1 {
  font-size: 34px;
  line-height: 1.42;
  font-weight: 700;
  letter-spacing: 1px;
  flex: none;
  margin-bottom: 30px;
}

h1 .dim { color: #4A4A4A; }

/* ---------------- 输入 ---------------- */

.input-wrap {
  position: relative;
  border: 1px solid rgba(200, 255, 0, .22);
  background: rgba(255, 255, 255, .012);
  padding: 16px 16px 26px;
  flex: none;
}

textarea {
  width: 100%;
  height: 96px;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .4px;
  caret-color: var(--lime);
}

textarea::placeholder {
  color: #454545;
}

.counter {
  position: absolute;
  right: 14px;
  bottom: 9px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #3E3E3E;
  font-family: "SF Mono", Menlo, monospace;
}

.counter b {
  color: #6E6E6E;
  font-weight: 400;
}

/* ---------------- 按钮（故障风） ---------------- */

.btn {
  position: relative;
  display: block;
  width: 100%;
  flex: none;
  margin-top: 18px;
  padding: 17px 0;
  background: rgba(200, 255, 0, .055);
  border: 1px solid var(--lime);
  color: var(--lime);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: background .18s, color .18s, opacity .2s;
  overflow: hidden;
}

.btn:active {
  background: var(--lime);
  color: #0A0A0A;
}

.btn:disabled {
  border-color: #262626;
  background: transparent;
  color: #333;
  cursor: default;
}

/* 禁用时不做故障闪烁，否则暗色按钮上会浮出红字 */
.btn:disabled::before,
.btn:disabled::after {
  animation: none;
  opacity: 0;
}

.btn.ghost {
  border-color: #2A2A2A;
  background: transparent;
  color: #6E6E6E;
  letter-spacing: 2px;
  font-size: 13px;
  padding: 14px 0;
  margin-top: 10px;
}

.btn.ghost:active {
  background: #141414;
  color: #9A9A9A;
}

/* 故障闪烁 */
.btn::before,
.btn::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  letter-spacing: 3px;
}

.btn::before {
  color: #FF2E6B;
  animation: gl1 4.2s infinite steps(1);
}

.btn::after {
  color: #00E5FF;
  animation: gl2 4.2s infinite steps(1);
}

@keyframes gl1 {
  0%, 92% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  93%     { opacity: .8; transform: translate(-2px, 1px); clip-path: inset(18% 0 62% 0); }
  95%     { opacity: .8; transform: translate(3px, -1px); clip-path: inset(56% 0 24% 0); }
  97%     { opacity: 0; }
}

@keyframes gl2 {
  0%, 90% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  91%     { opacity: .7; transform: translate(2px, -1px); clip-path: inset(40% 0 40% 0); }
  94%     { opacity: .7; transform: translate(-3px, 1px); clip-path: inset(8% 0 76% 0); }
  96%     { opacity: 0; }
}

/* ---------------- 合规小字 ---------------- */

.legal {
  flex: none;
  margin-top: auto;
  padding-top: 26px;
  font-size: 10.5px;
  line-height: 1.95;
  color: #4E4E4E;
  letter-spacing: .5px;
}

/* ---------------- S2 档案袋 ---------------- */

.bag-wrap {
  margin: 0 0 6px;
  flex: none;
  text-align: center;
  margin-top: auto;
}

.bag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 268px;
  padding: 24px 18px;
  border: 1px dashed rgba(200, 255, 0, .34);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 26px;
  line-height: 1.9;
  letter-spacing: 6px;
  white-space: pre-line;
  color: var(--lime);
  text-shadow: 0 0 12px rgba(200, 255, 0, .45);
  transition: opacity .5s, transform .5s;
}

.bag.opened {
  opacity: 0;
  transform: scale(.86) rotate(1.5deg);
  pointer-events: none;
}

.bag-tip {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 2.4px;
  color: #4A4A4A;
}

#open {
  margin-bottom: auto;
}

.echo-box {
  display: none;
  margin-top: 6px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  flex: none;
}

.echo-box.on {
  display: block;
  animation: fadein .55s ease;
  margin-top: auto;
}

/* 拆开后：回音块与按钮作为一组在剩余空间里垂直居中 */
#s2 #toCard {
  margin-bottom: auto;
}

.lab-grey,
.lab-lime {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 9px;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.lab-grey {
  color: #4A4A4A;
}

.lab-lime {
  color: var(--lime);
  opacity: .8;
  margin-top: 30px;
}

.mine-text {
  font-size: 16px;
  line-height: 1.85;
  color: #5E5E5E;
  letter-spacing: .4px;
  font-weight: 400;
}

.echo-text {
  font-size: 25px;
  line-height: 1.72;
  font-weight: 600;
  letter-spacing: .6px;
  color: var(--ink);
  min-height: 88px;
}

.echo-text .caret {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--lime);
  vertical-align: -3px;
  animation: blink .8s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.echo-meta {
  margin-top: 20px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 2.2px;
  color: #3E3E3E;
}

/* ---------------- S3 卡片 ---------------- */

.card-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  flex: none;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
}

.save-hint {
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: #5E5E5E;
  text-align: center;
  flex: none;
}

/* ---------------- S4 兜底（自伤内容） ----------------
   克制：不用红色、不用警告框。红色像报警，会让本来就很难的人更慌。
   节奏靠留白和逐段浮现，跟拆封一样是"慢下来"的信号。
*/

.crisis-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

.crisis-lead,
.crisis-sub,
.crisis-body-txt,
.crisis-help {
  animation: cin .9s ease backwards;
}

.crisis-lead {
  font-size: 33px;
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: .5px;
  animation-delay: .1s;
}

.crisis-sub {
  margin-top: 26px;
  font-size: 16.5px;
  line-height: 2;
  color: #8A8A8A;
  letter-spacing: .5px;
  animation-delay: .45s;
}

.crisis-line {
  width: 40px;
  height: 1px;
  background: #333;
  margin: 34px 0;
  animation: cin .9s ease backwards;
  animation-delay: .7s;
}

.crisis-body-txt {
  font-size: 17px;
  line-height: 2;
  color: #D8D8D8;
  letter-spacing: .5px;
  animation-delay: .9s;
}

.crisis-help {
  margin-top: 40px;
  animation-delay: 1.2s;
}

.crisis-help-t {
  font-size: 12px;
  letter-spacing: 1px;
  color: #6A6A6A;
}

.crisis-tel {
  display: inline-block;
  margin-top: 10px;
  font-family: "SF Mono", Menlo, "Courier New", monospace;
  font-size: 34px;
  letter-spacing: 4px;
  color: var(--lime);
  text-decoration: none;
}

.crisis-tel:active { opacity: .6; }

.crisis-help-s {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #4A4A4A;
}

/* 小屏（iPhone SE 667、安卓 640）收紧一档，避免内容被挤出视口 */
@media (max-height: 700px) {
  .crisis-lead { font-size: 27px; }
  .crisis-sub { margin-top: 18px; font-size: 15px; line-height: 1.85; }
  .crisis-line { margin: 22px 0; }
  .crisis-body-txt { font-size: 15.5px; line-height: 1.85; }
  .crisis-help { margin-top: 26px; }
  .crisis-tel { font-size: 28px; }
}

@keyframes cin {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* QA 用：?noanim=1 时把动画压成立即完成，便于截图核对最终排版 */
.noanim *,
.noanim *::before,
.noanim *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
}

/* ---------------- debug 面板 ---------------- */

#dbg {
  display: none;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #222;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  line-height: 1.9;
  color: #7A7A7A;
  white-space: pre-wrap;
  word-break: break-all;
}

#dbg.on { display: block; }

#dbg b { color: var(--lime); font-weight: 400; }

.hidden { display: none !important; }

/* .app 是纵向 flex 容器，.scr 和它里面的子项都带默认的 min-width: auto ——
   一旦有一行不能断的内容（长句、整体不可断的短语），子项会撑破视口而不是换行，
   表现是"右侧被裁掉一截"。两层都要写：.scr 自己收不住，里面的卡片也收不住。 */
.scr,
.scr > * { min-width: 0; }

/* ==========================================================
   V2 新增：接住（S2） / 我的（S5）
   命名一律用 catch-* / mine-*，不碰 V1 的 bag/echo 那套 ——
   旧样式留着不删，是因为 S3 卡片页还在用一部分。
   ========================================================== */

/* ---------------- 顶栏右侧链接 ---------------- */

.toplink {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 2px;
  color: #6E6E6E;
  text-decoration: none;
}

.toplink:active { color: var(--lime); }

/* ---------------- S2 接住 ---------------- */

.catch-head {
  flex: none;
  margin: 8px 0 26px;
}

.catch-head h2 {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 1px;
  color: var(--ink);
}

.catch-head p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .5px;
  color: #7A7A7A;
}

.catch-card {
  flex: none;
  position: relative;
  padding: 30px 24px;
  border: 1px solid #232323;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008));
  animation: fadein .4s ease;
}

/* 左上角一个小切口，和卡片页的"票据"语言呼应 */
.catch-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 18px;
  height: 18px;
  border-top: 1px solid var(--lime);
  border-left: 1px solid var(--lime);
}

.catch-body {
  font-size: 19px;
  line-height: 1.85;
  letter-spacing: .4px;
  color: #E8E8E8;
  word-break: break-word;
}

.catch-meta {
  margin-top: 20px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #4E4E4E;
}

.catch-empty {
  flex: none;
  padding: 40px 0;
  text-align: center;
}

.catch-empty-t {
  font-size: 20px;
  color: #C8C8C8;
  letter-spacing: 1px;
}

.catch-empty-s {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.9;
  color: #6A6A6A;
}

/* 可选的一句话：不做成"输入框"，做成一条下划线，轻一点 */
.note-wrap {
  flex: none;
  position: relative;
  margin-top: 26px;
  border-bottom: 1px solid #262626;
}

.note-wrap:focus-within { border-bottom-color: var(--lime); }

#noteInput {
  width: 100%;
  padding: 12px 46px 12px 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .5px;
}

#noteInput::placeholder { color: #3E3E3E; }

.note-count {
  position: absolute;
  right: 0;
  top: 12px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  color: #3E3E3E;
}

/* S2 内容块整体在视口里垂直居中：
   上方 auto + 下方 auto，剩余空间被均分；顶栏仍然贴顶，不会被推下去。
   只写 margin-top:auto 会让按钮贴底、中间空一大片。 */
#s2 .catch-head { margin-top: auto; }
#s2 .btn { margin-top: 26px; margin-bottom: auto; }
#s2 .catch-empty { margin-top: auto; }

/* ---------------- S3 底部两个入口 ---------------- */

.s3-links {
  flex: none;
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding-bottom: 4px;
  font-size: 12px;
  letter-spacing: 1px;
}

.s3-links a {
  color: #5E5E5E;
  text-decoration: none;
}

.s3-links a:active { color: var(--lime); }

/* ---------------- S5 我的 ---------------- */

.mine-h {
  flex: none;
  margin: 10px 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
}

.mine-sub {
  flex: none;
  margin-bottom: 24px;
  font-size: 12px;
  letter-spacing: .5px;
  color: #5A5A5A;
}

.mine-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mine-item {
  position: relative;
  padding: 18px 0;
  border-bottom: 1px solid #171717;
}

.mine-item:last-child { border-bottom: 0; }

.mine-body {
  font-size: 16px;
  line-height: 1.8;
  color: #D6D6D6;
  word-break: break-word;
}

.mine-foot {
  margin-top: 10px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #4E4E4E;
}

/* 被接住的：整条亮起来一点，并允许点击升级卡片 */
.mine-item.caught { cursor: pointer; }

.mine-item.caught .mine-body { color: #F2F2F2; }

.mine-note {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--lime);
  font-size: 15px;
  line-height: 1.8;
  color: var(--lime);
  word-break: break-word;
}

.mine-item.caught .mine-foot,
.mine-item.caught .mine-note + .mine-foot { color: #6A6A6A; }

.mine-item.pool .mine-body { color: #9A9A9A; }

.mine-item.burned .mine-body {
  color: #5A5A5A;
  text-decoration: line-through;
  text-decoration-color: #2A2A2A;
}

.mine-empty {
  padding: 60px 0;
  font-size: 13px;
  line-height: 2;
  text-align: center;
  color: #5A5A5A;
}

#s5 .btn { flex: none; margin-top: 20px; }

@media (max-height: 700px) {
  .catch-head { margin-bottom: 18px; }
  .catch-head h2 { font-size: 22px; }
  .catch-card { padding: 24px 20px; }
  .catch-body { font-size: 17px; line-height: 1.8; }
  .note-wrap { margin-top: 18px; }
}

