* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0c0c1d; --card: #171730; --card2: #1e1e3d; --ink: #eceaf6;
  --dim: #9a97b8; --acc: #ff2e88; --acc2: #7b5cff; --line: #2a2a4d;
}
html { -webkit-text-size-adjust: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a1450 0%, var(--bg) 55%);
  color: var(--ink); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom);
}
header {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between;
  align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(12,12,29,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.logo { font-size: 20px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, #ff5ea8, #a78bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.head-right { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-on { background: #3ddc84; box-shadow: 0 0 6px #3ddc84; }
.dot-off { background: #666; }
.icon-btn { background: var(--card2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; }
main { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.view { display: none; }
.view.active { display: block; }
.hero { padding: 26px 4px 20px; }
.hero-title { font-size: 27px; font-weight: 800; line-height: 1.45; }
.hero-sub { color: var(--dim); margin-top: 10px; line-height: 1.7; font-size: 15px; }
button { font-family: inherit; cursor: pointer; }
.primary { background: linear-gradient(90deg, var(--acc), var(--acc2)); color: #fff; border: none;
  border-radius: 14px; padding: 0 18px; height: 46px; font-size: 16px; font-weight: 700; }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; height: 46px; font-size: 15px; }
.big { width: 100%; margin-top: 12px; height: 52px; font-size: 17px; }
.text-btn { background: none; border: none; color: var(--dim); font-size: 15px; padding: 12px 4px; }
.hidden { display: none !important; }
.msg { color: #ff8fb3; min-height: 22px; margin-top: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
h1 { font-size: 24px; margin: 10px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.tag { background: #2a1450; color: #d9c8ff; border: 1px solid #46307a; font-size: 13px;
  padding: 4px 10px; border-radius: 999px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 12px; }
.card.accent { border-color: #5a2450; background: linear-gradient(180deg, #221233, var(--card)); }
.card-title { font-size: 13px; color: var(--acc); letter-spacing: 2px; margin-bottom: 8px; font-weight: 700; }
.card p { line-height: 1.75; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.card p.info { font-weight: 700; }
.card p.state { color: #ffc2d9; }
.opening { color: #ffd9a8; line-height: 1.7; margin: 6px 2px 4px; font-size: 15px; }
.cover-wrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; }
.cover-wrap img { width: 100%; display: block; }
#reader-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
#reader-title { font-weight: 800; font-size: 17px; }
.panel { margin-bottom: 18px; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.panel img { width: 100%; display: block; min-height: 180px; background: #141428; }
.caption { padding: 12px 14px; line-height: 1.8; font-size: 15.5px; background: var(--card); white-space: pre-wrap; }
.round-anchor { height: 2px; }
.actions { margin-top: 8px; }
.actions-title { color: var(--dim); margin-bottom: 10px; font-size: 14px; }
.action-btn { display: block; width: 100%; text-align: left; background: var(--card2);
  color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font-size: 15.5px; margin-bottom: 10px; }
.action-btn:active { border-color: var(--acc); }
.free-row { display: flex; gap: 10px; margin-top: 4px; }
.free-row input { flex: 1; }
input[type="text"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; font-size: 16px; margin: 6px 0 14px; font-family: inherit;
}
label { display: block; color: var(--dim); font-size: 14px; margin-top: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; margin: 10px 0; }
.check-row input { width: 20px; height: 20px; }
.loading { position: fixed; inset: 0; background: rgba(8,8,20,.78); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.spinner { width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--acc); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: var(--dim); font-size: 15px; padding: 0 30px; text-align: center; line-height: 1.6; }
