:root {
  --bg-0: #0a0a0c;
  --bg-1: #121216;
  --bg-2: #1a1a20;
  --card: rgba(255, 255, 255, 0.035);
  --card-solid: #17171d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --txt-0: #f2f2f5;
  --txt-1: #a7a7b3;
  --txt-2: #6b6b78;
  --ember-1: #ff7a3d;
  --ember-2: #ff3d2e;
  --ember-3: #ffb03a;
  --ember-glow: rgba(255, 92, 45, 0.35);
  --ok: #3ddc97;
  --danger: #ff4d4f;
  --radius: 18px;
  --radius-sm: 11px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--txt-0);
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(255, 92, 45, 0.10), transparent 60%),
    radial-gradient(900px 520px at 92% 6%, rgba(255, 176, 58, 0.06), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ambient embers */
.embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.embers i {
  position: absolute; bottom: -20px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--ember-1); opacity: 0; filter: blur(0.3px);
  animation: float-up linear infinite;
}
@keyframes float-up {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .55; }
  90% { opacity: .25; }
  100% { transform: translateY(-105vh) translateX(var(--drift, 20px)); opacity: 0; }
}

.shell { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 46px 22px 80px; }

.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 8px; }
.brand-mark {
  width: 44px; height: 44px; flex: none; border-radius: 13px;
  background: linear-gradient(145deg, var(--ember-3), var(--ember-1) 55%, var(--ember-2));
  display: grid; place-items: center;
  box-shadow: 0 8px 28px var(--ember-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 21px; font-weight: 750; letter-spacing: .3px; }
.brand-name span { color: var(--ember-1); }
.brand-sub { font-size: 12px; color: var(--txt-2); letter-spacing: .4px; margin-top: -2px; }

.headline { margin: 34px 0 26px; }
.headline h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.22; margin: 0 0 10px; font-weight: 760; letter-spacing: -.5px; }
.headline h1 em { font-style: normal; background: linear-gradient(100deg, var(--ember-3), var(--ember-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline p { margin: 0; color: var(--txt-1); font-size: 14.5px; max-width: 540px; }

.card {
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.card + .card { margin-top: 18px; }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 620; color: var(--txt-1); margin-bottom: 9px; }
.label .num { width: 19px; height: 19px; border-radius: 6px; background: rgba(255,122,61,.14); color: var(--ember-1); font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.hint { font-size: 11.5px; color: var(--txt-2); margin-top: 7px; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%; color: var(--txt-0); font-family: var(--font); font-size: 14px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; min-height: 132px; line-height: 1.65; }
textarea:focus, input:focus, select:focus {
  border-color: rgba(255,122,61,.55); box-shadow: 0 0 0 3px rgba(255,122,61,.10); background: #14141a;
}
textarea::placeholder, input::placeholder { color: #55555f; }
select { appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a7a7b3' stroke-width='2.4' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
select option { background: var(--card-solid); color: var(--txt-0); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } .shell { padding: 30px 16px 60px; } .card { padding: 20px; } }

/* image dropzone */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 22px; text-align: center; cursor: pointer; transition: all .2s;
  background: rgba(255,255,255,.012); color: var(--txt-1); font-size: 13px;
}
.dropzone:hover { border-color: rgba(255,122,61,.5); background: rgba(255,122,61,.045); color: var(--txt-0); }
.dropzone svg { width: 26px; height: 26px; margin-bottom: 8px; color: var(--ember-1); display: block; margin-inline: auto; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumb { position: relative; width: 86px; height: 86px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font); font-weight: 680; font-size: 14.5px;
  border-radius: var(--radius-sm); padding: 14px 20px; transition: transform .12s, box-shadow .2s, filter .2s, opacity .2s;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primary {
  color: #1a0d06; background: linear-gradient(100deg, var(--ember-3), var(--ember-1) 62%, var(--ember-2));
  box-shadow: 0 10px 30px var(--ember-glow), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 12px 38px rgba(255,92,45,.5); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
.btn-ghost { background: rgba(255,255,255,.05); color: var(--txt-0); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.25); border-top-color: #1a0d06; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result link */
.result { display: none; margin-top: 22px; }
.result.show { display: block; animation: rise .4s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-box {
  display: flex; gap: 10px; align-items: center; background: var(--bg-1);
  border: 1px solid rgba(255,122,61,.3); border-radius: var(--radius-sm); padding: 10px 10px 10px 14px;
}
.result-box input { flex: 1; min-width: 0; background: transparent; border: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ember-3); }
.result-box input:focus { box-shadow: none; }
.notice { font-size: 12px; color: var(--txt-1); margin-top: 14px; padding-left: 18px; position: relative; }
.notice::before { content: "!"; position: absolute; left: 0; top: 1px; width: 13px; height: 13px; border-radius: 50%; background: rgba(255,176,58,.18); color: var(--ember-3); font-size: 9px; font-weight: 800; display: grid; place-items: center; }

/* sealed view (reveal page) */
.seal-wrap { text-align: center; padding: 16px 6px 6px; }
.seal-orb {
  width: 132px; height: 132px; margin: 10px auto 26px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 38% 32%, #3a2a20, #1a1412 66%);
  border: 1px solid rgba(255,122,61,.3);
  box-shadow: 0 0 0 8px rgba(255,122,61,.045), 0 0 60px var(--ember-glow), inset 0 0 32px rgba(255,92,45,.18);
  display: grid; place-items: center;
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 8px rgba(255,122,61,.045), 0 0 46px var(--ember-glow), inset 0 0 26px rgba(255,92,45,.14); } 50% { box-shadow: 0 0 0 12px rgba(255,122,61,.06), 0 0 78px rgba(255,92,45,.5), inset 0 0 40px rgba(255,92,45,.28); } }
.seal-orb svg { width: 52px; height: 52px; color: var(--ember-1); }
.seal-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 24px; }
.chip { font-size: 11.5px; color: var(--txt-1); background: rgba(255,255,255,.045); border: 1px solid var(--line); padding: 5px 11px; border-radius: 100px; }
.chip b { color: var(--ember-3); font-weight: 700; }

/* revealed content */
.reveal-stage { display: none; }
.reveal-stage.show { display: block; }
.burn-flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(255,140,60,.5), transparent 45%); opacity: 0; }
.burn-flash.fire { animation: flash .9s ease-out; }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

.message-paper {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: unfurl .55s cubic-bezier(.2,.8,.25,1);
}
@keyframes unfurl { from { opacity: 0; transform: translateY(14px) scale(.98); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.message-paper::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,122,61,.06), transparent 30%); }
.msg-text { font-size: 16px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: var(--txt-0); }
.msg-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 18px; }
.msg-images img { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }

.status-bar { display: flex; align-items: center; gap: 9px; font-size: 12.5px; margin-top: 18px; padding: 11px 15px; border-radius: var(--radius-sm); }
.status-bar.burned { background: rgba(255,77,79,.09); color: #ff8f8f; border: 1px solid rgba(255,77,79,.25); }
.status-bar.remain { background: rgba(61,220,151,.08); color: var(--ok); border: 1px solid rgba(61,220,151,.22); }
.status-bar svg { width: 16px; height: 16px; flex: none; }

/* generic states */
.state { text-align: center; padding: 46px 20px; }
.state .big { font-size: 46px; margin-bottom: 14px; }
.state h2 { font-size: 22px; margin: 0 0 8px; }
.state p { color: var(--txt-1); font-size: 14px; margin: 0 0 22px; }

.pw-inline { display: none; margin-top: 18px; text-align: left; }
.pw-inline.show { display: block; animation: rise .3s ease; }

.err { display: none; color: #ff9a9a; background: rgba(255,77,79,.09); border: 1px solid rgba(255,77,79,.25);
  padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.5px; margin-top: 12px; }
.err.show { display: block; }

.footer-note { text-align: center; color: var(--txt-2); font-size: 11.5px; margin-top: 34px; line-height: 1.8; }
.footer-note b { color: var(--ember-1); font-weight: 600; }

/* ===== ownership / revoke feature ===== */
.brand-action {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt-0);
  font-family: var(--font); font-size: 13px; font-weight: 600; padding: 9px 12px;
  border-radius: 11px; cursor: pointer; transition: background .18s, border-color .18s;
}
.brand-action:hover { background: rgba(255,122,61,.1); border-color: rgba(255,122,61,.4); }
.brand-action svg { width: 16px; height: 16px; color: var(--ember-1); }
.brand-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ember-1); color: #1a0d06;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; }
@media (max-width: 480px) { .brand-action { padding: 8px 9px; font-size: 12px; } .brand-name { font-size: 18px; } }

.manage-box { margin-top: 16px; padding: 15px; border-radius: var(--radius-sm);
  background: rgba(255,176,58,.055); border: 1px solid rgba(255,176,58,.22); }
.manage-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ember-3); }
.manage-title svg { width: 16px; height: 16px; }
.manage-box .hint strong { color: var(--txt-1); }

.mine-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.restore-box { display: flex; gap: 10px; margin-bottom: 6px; }
.restore-box input { flex: 1; font-family: var(--mono); font-size: 12px; }
.restore-box .btn { flex: none; }

.mine-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.mine-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px;
  background: rgba(255,255,255,.02); transition: border-color .18s, background .18s; }
.mine-item:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.mine-item.dead { opacity: .55; }
.mine-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mine-title { font-size: 14px; font-weight: 650; color: var(--txt-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-state { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; }
.mine-state.alive { background: rgba(61,220,151,.12); color: var(--ok); }
.mine-state.dead { background: rgba(255,77,79,.12); color: #ff8f8f; }
.mine-meta { font-size: 11.5px; color: var(--txt-2); margin-top: 7px; font-family: var(--mono); word-break: break-all; }
.mine-progress { height: 5px; border-radius: 4px; background: rgba(255,255,255,.07); margin-top: 11px; overflow: hidden; }
.mine-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember-3), var(--ember-2)); border-radius: 4px; }
.mine-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.mini-btn { appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--txt-1);
  font-family: var(--font); font-size: 11.5px; font-weight: 600; padding: 7px 11px; border-radius: 8px; cursor: pointer; transition: all .18s; }
.mini-btn:hover { background: rgba(255,255,255,.09); color: var(--txt-0); }
.mini-btn.danger { color: #ff9a9a; border-color: rgba(255,77,79,.28); background: rgba(255,77,79,.07); }
.mini-btn.danger:hover { background: rgba(255,77,79,.16); }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }
.mine-empty { text-align: center; padding: 40px 16px; color: var(--txt-2); }
.mine-empty .big { font-size: 40px; margin-bottom: 12px; }
.mine-empty p { margin: 0 0 16px; font-size: 13.5px; }

/* confirm dialog */
.confirm-mask { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px; }
.confirm-mask.show { display: flex; }
.confirm-box { width: 100%; max-width: 380px; background: var(--card-solid); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 26px; box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: rise .25s ease; }
.confirm-box h3 { margin: 0 0 10px; font-size: 18px; }
.confirm-box p { margin: 0 0 22px; color: var(--txt-1); font-size: 13.5px; }
.confirm-box .btn-row .btn { flex: 1; }

/* ===== reply feature ===== */
.allow-reply-field { padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255,255,255,.02); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span:first-child { display: flex; flex-direction: column; }
.switch-title { font-size: 13.5px; font-weight: 650; color: var(--txt-0); }
.switch-desc { font-size: 11.5px; color: var(--txt-2); margin-top: 4px; line-height: 1.5; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { flex: none; width: 42px; height: 24px; border-radius: 14px; background: #3a3a44; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-row input:checked + .switch { background: linear-gradient(100deg, var(--ember-3), var(--ember-1)); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }

.reply-box { margin-top: 18px; padding: 18px; border-radius: var(--radius); border: 1px solid rgba(255,122,61,.28);
  background: linear-gradient(180deg, rgba(255,122,61,.06), rgba(255,255,255,.015)); animation: rise .4s ease; }
.reply-head { margin-bottom: 12px; }
.reply-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ember-3); }
.reply-title svg { width: 17px; height: 17px; }
.reply-sub { font-size: 11.5px; color: var(--txt-2); margin-top: 5px; }
.reply-box textarea { min-height: 90px; }
.reply-img-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.reply-add-img { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-1); cursor: pointer;
  border: 1px dashed var(--line-strong); border-radius: 9px; padding: 8px 11px; transition: all .18s; }
.reply-add-img:hover { border-color: rgba(255,122,61,.5); color: var(--txt-0); }
.reply-add-img svg { width: 15px; height: 15px; color: var(--ember-1); }
.reply-result { font-size: 12.5px; color: var(--ok); margin-top: 12px; min-height: 18px; }

.inbox-head { display: flex; align-items: center; justify-content: space-between; }
.inbox-head h3 { margin: 0; }
.inbox-close { background: none; border: 0; color: var(--txt-2); font-size: 26px; line-height: 1; cursor: pointer; }
.inbox-close:hover { color: var(--txt-0); }
.inbox-sub { font-size: 12px; color: var(--txt-2); margin: 8px 0 18px; }
.inbox-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.inbox-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); cursor: pointer; transition: all .18s; }
.inbox-item:hover { border-color: rgba(255,122,61,.45); background: rgba(255,122,61,.06); }
.inbox-item .meta { font-size: 13px; color: var(--txt-0); font-weight: 600; }
.inbox-item .date { font-size: 11px; color: var(--txt-2); margin-top: 3px; }
.inbox-item .open { font-size: 12px; color: var(--ember-1); flex: none; }
.inbox-empty { text-align: center; color: var(--txt-2); font-size: 13px; padding: 30px 10px; }
.inbox-flame { font-size: 30px; margin-bottom: 8px; }

/* ===== share: QR code + one-tap share ===== */
.share-card { margin-top: 18px; padding: 16px; border-radius: var(--radius);
  border: 1px solid rgba(255,122,61,.3); background: linear-gradient(180deg, rgba(255,122,61,.07), rgba(255,255,255,.015)); }
.share-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ember-3); margin-bottom: 13px; }
.share-head svg { width: 17px; height: 17px; }
.share-btns { display: flex; gap: 10px; }
.share-btns .btn { flex: 1; }
.qr-wrap { display: none; flex-direction: column; align-items: center; margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed var(--line); animation: rise .3s ease; }
.qr-wrap.show { display: flex; }
.qr-img { background: #fff; padding: 12px; border-radius: 12px; line-height: 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.qr-img svg, .qr-img img { display: block; width: 190px; height: 190px; }
.qr-tip { font-size: 11.5px; color: var(--txt-2); text-align: center; margin-top: 12px; line-height: 1.6; }
.qr-tip strong { color: var(--ember-2); }
.share-note { font-size: 11.5px; color: var(--txt-2); margin-top: 12px; line-height: 1.6; text-align: center; }
