/* ============================================================
 *  梵蒂尔 · 哥特黑红
 * ============================================================ */

:root {
  --blood: #a91430;
  --blood-lt: #c9203c;
  --gold: #c8a86a;
  --gold-dim: rgba(200, 168, 106, .35);
  --ink: #ece4d8;
  --ink-dim: #b9aea1;
  --muted: #8d8078;
  --line: rgba(200, 168, 106, .16);
  --bg: #08060a;
  --surf: #140e11;
  --surf-2: #1b1317;
  --radius: 18px;
  --serif: Georgia, 'Songti SC', 'STSong', 'Noto Serif SC', serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 700px at 50% -10%, rgba(169, 20, 48, .30), transparent 62%),
    radial-gradient(800px 600px at 90% 110%, rgba(90, 12, 30, .35), transparent 60%),
    #050407;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.stage { display: grid; place-items: center; width: 100%; height: 100%; }

/* ---------------- 手机外壳 ---------------- */
.phone {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 44px;
  background:
    radial-gradient(520px 380px at 50% 0%, rgba(169, 20, 48, .18), transparent 70%),
    linear-gradient(180deg, #0d090c 0%, #0a0709 55%, #120a0d 100%);
  box-shadow:
    0 0 0 1px rgba(200, 168, 106, .22),
    0 0 0 8px #0b0809,
    0 0 0 9px rgba(200, 168, 106, .18),
    0 30px 80px -24px rgba(0, 0, 0, .9),
    0 0 90px rgba(169, 20, 48, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notch {
  position: absolute; top: 11px; left: 50%;
  width: 104px; height: 26px; transform: translateX(-50%);
  background: #000; border-radius: 14px; z-index: 40;
  box-shadow: inset 0 0 0 1px rgba(200, 168, 106, .12);
}

/* ---------------- 状态栏 ---------------- */
.statusbar {
  height: 44px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 22px 0;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  color: var(--ink);
  z-index: 30;
}
.statusbar .sb-right { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-dim); }

/* ---------------- 屏幕 ---------------- */
.screen { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.screen::-webkit-scrollbar { width: 0; }
.screen.anim { animation: screenIn .2s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.homebar { height: 26px; flex: 0 0 auto; display: grid; place-items: center; }
.homebar i { width: 126px; height: 4px; border-radius: 99px; background: rgba(200, 168, 106, .35); }

/* ---------------- 通用 ---------------- */
.pad { padding: 0 18px; }
.card {
  background: linear-gradient(180deg, #1a1216, #140e11);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.dim { color: var(--ink-dim); }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.orn {
  display: flex; align-items: center; gap: 10px;
  color: var(--gold); font-size: 10px; letter-spacing: 4px;
  margin: 18px 0 14px;
}
.orn::before, .orn::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* 阶级徽章 */
.klass {
  font-family: var(--serif);
  font-size: 11px; letter-spacing: 1.4px;
  padding: 2px 9px; border-radius: 3px;
  border: 1px solid currentColor;
  white-space: nowrap;
  display: inline-flex; align-items: center;
  line-height: 1.7;
  vertical-align: middle;
}
.klass.P { color: #e6dcc7; }
.klass.R { color: #c9203c; }
.klass.A { color: #9fb3c8; }
.klass.N { color: #8a8378; }

/* 头像 */
.avatar {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px;
  color: var(--gold);
  background: linear-gradient(160deg, #241419, #160d11);
  border: 1px solid var(--gold-dim);
  box-shadow: inset 0 0 18px rgba(169, 20, 48, .25);
}
.avatar.lg { width: 66px; height: 66px; font-size: 24px; border-radius: 14px; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; border-radius: 8px; }

/* ---------------- 登录 / 注册 ---------------- */
.auth {
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 30px 26px 40px;
  background:
    radial-gradient(360px 300px at 50% 8%, rgba(169, 20, 48, .26), transparent 70%),
    radial-gradient(300px 260px at 50% 100%, rgba(200, 168, 106, .10), transparent 70%);
}
.auth .seal {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: grid; place-items: center;
  border: 1px solid var(--gold-dim); border-radius: 50%;
  color: var(--gold); font-family: var(--serif); font-size: 24px;
  box-shadow: 0 0 30px rgba(169, 20, 48, .35), inset 0 0 20px rgba(169, 20, 48, .2);
}
.auth h1 {
  font-family: var(--serif);
  font-size: 25px; font-weight: 500; letter-spacing: 3px;
  text-align: center; margin: 0;
}
.auth .sub {
  text-align: center; color: var(--muted); font-size: 11px;
  letter-spacing: 2.5px; margin: 8px 0 0; text-transform: uppercase;
}
.auth .quote {
  font-family: var(--serif); font-size: 12.5px; line-height: 1.9;
  color: var(--gold); opacity: .8; text-align: center; margin: 22px 0 26px;
}
.tabs2 {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px; margin-bottom: 20px;
}
.tabs2 button { padding: 9px; border-radius: 999px; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.tabs2 button.on { background: linear-gradient(180deg, #b3173a, #8a0f28); color: #fff; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 10.5px; letter-spacing: 2px;
  color: var(--muted); margin-bottom: 7px; text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-size: 14px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(200, 168, 106, .55);
  box-shadow: 0 0 0 3px rgba(200, 168, 106, .08);
}
.field input::placeholder, .field textarea::placeholder { color: #6b6058; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field select { appearance: none; }

.btn {
  width: 100%; padding: 14px; border-radius: 12px;
  background: linear-gradient(180deg, #b3173a, #8a0f28);
  color: #fff; font-size: 14px; letter-spacing: 2px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 30px -16px rgba(169, 20, 48, .9);
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-dim); box-shadow: none; }
.btn.small { width: auto; padding: 9px 16px; font-size: 12.5px; letter-spacing: 1px; }
.btn.danger { background: transparent; border: 1px solid rgba(201, 32, 60, .5); color: #e0707f; }

.auth .foot { margin-top: 18px; text-align: center; font-size: 11px; color: #6a5f57; line-height: 1.9; }
.err { color: #e0707f; font-size: 12px; min-height: 18px; text-align: center; margin-top: -6px; }

/* ---------------- 桌面 ---------------- */
.home { padding: 6px 16px 12px; display: grid; gap: 12px; }

.ident { display: flex; align-items: center; gap: 12px; padding: 14px 15px; }
.ident .nm { font-family: var(--serif); font-size: 15.5px; letter-spacing: .5px; }
.ident .st { font-size: 11px; color: var(--muted); margin-top: 3px; }

.widget {
  padding: 16px 18px 15px;
  background:
    linear-gradient(150deg, rgba(169, 20, 48, .22), transparent 55%),
    linear-gradient(180deg, #191015, #120c0f);
}
.widget .w-top { display: flex; align-items: baseline; justify-content: space-between; }
.widget .w-time { font-family: var(--serif); font-size: 38px; letter-spacing: -1px; line-height: 1; }
.widget .w-date { font-size: 11px; color: var(--muted); margin-top: 7px; letter-spacing: 1px; }
.widget .w-bal { text-align: right; }
.widget .w-bal .n { font-size: 17px; color: var(--gold); font-family: var(--serif); }
.widget .w-bal .l { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; margin-top: 3px; }

.notice { border-left: 2px solid var(--blood); }
.notice .n-title {
  font-family: var(--serif); font-size: 13px; letter-spacing: 1.5px;
  color: var(--gold); display: flex; align-items: center; gap: 8px;
}
.notice .n-body { font-size: 12.5px; line-height: 1.85; color: var(--ink-dim); margin-top: 8px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 10px; padding: 8px 2px 2px; }
.app-btn { display: grid; justify-items: center; gap: 8px; position: relative; }
.app-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  color: var(--gold);
  background: linear-gradient(170deg, #211419, #140d10);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 20px -14px #000;
  transition: transform .15s ease, border-color .15s ease;
}
.app-btn:active .app-icon { transform: scale(.93); border-color: var(--gold-dim); }
.app-icon svg { width: 26px; height: 26px; }
.app-label { font-size: 11px; color: var(--ink-dim); letter-spacing: .5px; }
.badge {
  position: absolute; top: -4px; right: 8px;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 99px;
  background: var(--blood-lt); color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px #0b080a;
}
.home-hint { text-align: center; font-size: 10.5px; color: #5f554e; letter-spacing: 1px; padding: 8px 0 2px; }

/* ---------------- 应用顶栏 ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 12px;
  background: rgba(10, 7, 9, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar .title {
  font-family: var(--serif); font-size: 15px; letter-spacing: 1.5px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--gold);
}
.icon-btn svg { width: 15px; height: 15px; }

.pagelist { padding: 12px 14px 26px; display: grid; gap: 10px; }
.pagelist > * { min-width: 0; }
.card { min-width: 0; }

/* ---------------- 讯息 ---------------- */
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; min-width: 0; overflow: hidden; }
.chat-item .c-main { flex: 1; min-width: 0; }
.chat-item .c-name { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.chat-item .c-msg {
  font-size: 12px; color: var(--muted); margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item .c-time { font-size: 10.5px; color: #6d6259; }
.c-unread {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--blood-lt); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.empty { text-align: center; color: #6b6058; font-size: 12px; padding: 40px 20px; line-height: 2; }

/* 聊天 */
.thread { height: 100%; display: flex; flex-direction: column; }
.thread-body {
  flex: 1; overflow-y: auto; padding: 16px 14px 10px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  background: radial-gradient(400px 300px at 50% 0%, rgba(169, 20, 48, .08), transparent 70%);
}
.msg { max-width: 78%; }
.msg .bubble {
  padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.7;
  word-break: break-word;
}
.msg.them { align-self: flex-start; }
.msg.them .bubble {
  background: #1a1216; border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg.me { align-self: flex-end; }
.msg.me .bubble {
  background: linear-gradient(160deg, #a5142f, #7d0d22);
  border: 1px solid rgba(255, 255, 255, .1);
  border-bottom-right-radius: 4px;
}
.msg .t { font-size: 9.5px; color: #6d6259; margin-top: 5px; letter-spacing: .5px; }
.msg.me .t { text-align: right; }

/* 转账气泡 */
.transfer {
  width: 200px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(160deg, #2a1d14, #1b1310);
  border: 1px solid rgba(200, 168, 106, .45);
  color: var(--gold);
}
.transfer .tf-t { font-size: 10px; letter-spacing: 2px; opacity: .8; }
.transfer .tf-a { font-family: var(--serif); font-size: 24px; margin: 6px 0 2px; }
.transfer .tf-n { font-size: 11px; color: var(--ink-dim); border-top: 1px solid rgba(200, 168, 106, .2); padding-top: 6px; margin-top: 6px; }

.composer {
  flex: 0 0 auto; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: rgba(10, 7, 9, .92);
  backdrop-filter: blur(10px);
}
.composer input {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 15px; font-size: 13px; outline: none;
}
.composer input::placeholder { color: #6b6058; }
.composer .send {
  flex: 0 0 auto; padding: 10px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #b3173a, #8a0f28); color: #fff;
  font-size: 12.5px; letter-spacing: 1px;
}
.composer .coin {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(200, 168, 106, .45); color: var(--gold);
  display: grid; place-items: center; font-size: 14px; font-family: var(--serif);
}

/* ---------------- 好友 ---------------- */
.searchbar { display: flex; gap: 8px; padding: 12px 14px 0; }
.searchbar input {
  flex: 1; padding: 11px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); outline: none; font-size: 13px;
}
.searchbar input::placeholder { color: #6b6058; }
.searchbar button {
  flex: 0 0 auto; padding: 0 15px; border-radius: 999px;
  border: 1px solid rgba(200, 168, 106, .4); color: var(--gold);
  font-size: 12.5px; letter-spacing: 1px;
}
.friend { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.friend .f-main { flex: 1; min-width: 0; }
.friend .f-name { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.friend .f-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.friend .f-act {
  font-size: 11.5px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid rgba(200, 168, 106, .4); color: var(--gold);
}

/* ---------------- 广场 ---------------- */
.tabs { display: flex; gap: 8px; padding: 12px 14px 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px;
  letter-spacing: .5px;
}
.tab.on { border-color: rgba(200, 168, 106, .5); color: var(--gold); background: rgba(200, 168, 106, .07); }

.post { width: 100%; text-align: left; display: grid; gap: 7px; padding: 15px 15px 14px; }
.post .p-title { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; letter-spacing: .3px; }
.post .p-meta { font-size: 10.5px; color: #6d6259; display: flex; gap: 8px; align-items: center; }
.post .p-body { font-size: 13px; line-height: 1.85; color: var(--ink-dim); white-space: pre-wrap; }
.reply { padding: 11px 0; border-top: 1px dashed var(--line); font-size: 12.5px; line-height: 1.7; }
.reply b { color: var(--gold); font-weight: 500; }

/* ---------------- 百科 ---------------- */
.entry { width: 100%; text-align: left; display: grid; gap: 5px; padding: 14px 15px; }
.entry .e-title { font-family: var(--serif); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.entry .e-sub { font-size: 10.5px; color: #6d6259; letter-spacing: .5px; }
.chip {
  font-size: 9.5px; letter-spacing: 1.5px; color: var(--gold);
  border: 1px solid rgba(200, 168, 106, .3);
  padding: 2px 7px; border-radius: 3px;
}
.e-body { font-size: 13.5px; line-height: 2; color: var(--ink-dim); white-space: pre-wrap; margin-top: 6px; }

/* ---------------- 钱包 ---------------- */
.balance {
  padding: 22px 20px; border-radius: 18px;
  background:
    radial-gradient(220px 160px at 88% 10%, rgba(200, 168, 106, .22), transparent 70%),
    linear-gradient(150deg, #2a0a13, #16090e);
  border: 1px solid rgba(200, 168, 106, .3);
}
.balance .b-label { font-size: 10px; letter-spacing: 3px; color: var(--muted); }
.balance .b-num { font-family: var(--serif); font-size: 40px; letter-spacing: -1px; margin-top: 10px; color: var(--gold); }
.balance .b-num span { font-size: 14px; margin-left: 8px; color: var(--muted); font-family: inherit; }
.bill { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bill:last-child { border-bottom: 0; }
.bill .bl-t { font-size: 13px; }
.bill .bl-s { font-size: 10.5px; color: #6d6259; margin-top: 3px; }
.bill .bl-a { font-size: 14px; font-family: var(--serif); }
.bill .bl-a.neg { color: #d8cdbe; }
.bill .bl-a.pos { color: var(--gold); }

/* ---------------- 设置 / 终端 ---------------- */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .s-label { font-size: 13px; }
.setting .s-value { font-size: 12.5px; color: var(--muted); }
.term {
  background: #060405; border: 1px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 11.5px; line-height: 1.8; color: #9fd8a8;
  padding: 12px; min-height: 96px; max-height: 190px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all;
}
.term .ok { color: var(--gold); }
.term .bad { color: #e0707f; }
.term-in {
  display: flex; gap: 8px; margin-top: 10px;
}
.term-in input {
  flex: 1; background: #060405; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; color: #9fd8a8; outline: none;
}

/* ---------------- 管理后台 ---------------- */
.admin-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(169, 20, 48, .18), transparent);
}
.admin-head .h1 { font-family: var(--serif); font-size: 17px; letter-spacing: 2px; color: var(--gold); }
.admin-head .h2 { font-size: 10.5px; color: var(--muted); letter-spacing: 2px; margin-top: 5px; }
.admin-tabs { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button {
  flex: 0 0 auto; padding: 7px 12px; border-radius: 6px; font-size: 11.5px;
  border: 1px solid var(--line); color: var(--muted); letter-spacing: .5px;
}
.admin-tabs button.on { background: rgba(169, 20, 48, .3); border-color: rgba(201, 32, 60, .55); color: #fff; }
.admin-body { padding: 12px 14px 30px; display: grid; gap: 10px; }

.kv { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; }
.kv .k { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.kv .v { color: var(--gold); font-family: var(--serif); }

.edit-form { display: grid; gap: 0; }
.edit-form .field { margin-bottom: 12px; }
.edit-form .field input, .edit-form .field textarea, .edit-form .field select { font-size: 13px; padding: 10px 12px; }
.actions { display: flex; gap: 8px; margin-top: 6px; }
.actions .btn { flex: 1; }

.mini-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px;
}
.mini-row .m-main { flex: 1; min-width: 0; }
.mini-row .m-t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.mini-row .m-t .klass { flex: 0 0 auto; }
.mini-row .m-s { font-size: 10.5px; color: #6d6259; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .m-op { font-size: 11px; color: var(--gold); padding: 5px 4px; }

/* ---------------- 小屏 ---------------- */
@media (max-width: 520px) {
  body { display: block; background: #08060a; }
  .stage { display: block; }
  .phone {
    width: 100vw; height: 100dvh; border-radius: 0;
    box-shadow: none;
  }
  .notch { display: none; }
  .statusbar { height: auto; min-height: 44px; padding-top: max(6px, env(safe-area-inset-top)); }
  .homebar { height: max(18px, env(safe-area-inset-bottom)); }
}
