/* c的mc小站 · 共享主题 (用户端 + 管理端)
   视觉来源: 站点图标(体素机器人 / 霓虹蓝) + truthoflevel-site 的暗色、网格、颗粒、细线、衬线标题语言 */
:root {
  --bg: #050a14;
  --bg-2: #08101f;
  --panel: rgba(12, 21, 40, 0.74);
  --panel-solid: #0b1426;
  --panel-hi: rgba(20, 34, 62, 0.82);
  --line: rgba(130, 190, 255, 0.14);
  --line-strong: rgba(130, 200, 255, 0.34);
  --text: #e8f1ff;
  --muted: #8da2c0;
  --dim: #5f7392;
  --cyan: #3cc8ff;
  --cyan-2: #7ae0ff;
  --blue: #2a7bff;
  --orange: #ff9a3c;
  --purple: #a974ff;
  --green: #4be3a6;
  --gold: #f4c76a;
  --red: #ff5d6c;
  --glow: 0 0 24px rgba(60, 200, 255, 0.28);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --font-body: "Microsoft YaHei UI", "Noto Sans SC", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --pad: clamp(16px, 4vw, 56px);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--font-body); line-height: 1.65;
  background:
    linear-gradient(rgba(130, 190, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 190, 255, 0.03) 1px, transparent 1px),
    radial-gradient(900px 520px at 85% -5%, rgba(42, 123, 255, 0.20), transparent 62%),
    radial-gradient(700px 480px at 4% 28%, rgba(169, 116, 255, 0.10), transparent 60%),
    radial-gradient(800px 500px at 60% 105%, rgba(255, 154, 60, 0.07), transparent 60%),
    var(--bg);
  background-size: 64px 64px, 64px 64px, auto, auto, auto, auto;
  background-attachment: fixed;
  overflow-x: hidden; display: flex; flex-direction: column;
}
/* 颗粒质感 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}
::selection { background: var(--cyan); color: #04101c; }
a { color: var(--cyan-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.8; }
.progress { position: fixed; top: 0; left: 0; z-index: 130; height: 2px; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--blue), var(--cyan), var(--purple), var(--orange)); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-strong); white-space: nowrap;
  background: rgba(60, 200, 255, 0.06); color: var(--text); font-weight: 600; letter-spacing: .02em;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { background: rgba(60, 200, 255, 0.14); border-color: var(--cyan); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .tile:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, #1f7bff, #2fc4ff); border-color: transparent; color: #03101e; box-shadow: 0 8px 26px rgba(42, 160, 255, 0.35); }
.btn-primary:hover { background: linear-gradient(135deg, #3b8bff, #5bd6ff); border-color: transparent; box-shadow: 0 10px 32px rgba(60, 200, 255, 0.5); }
.btn-warn { border-color: rgba(255, 154, 60, .5); background: rgba(255, 154, 60, .08); }
.btn-warn:hover { background: rgba(255, 154, 60, .18); border-color: var(--orange); box-shadow: 0 0 22px rgba(255, 154, 60, .3); }
.btn-danger { border-color: rgba(255, 93, 108, .5); background: rgba(255, 93, 108, .08); }
.btn-danger:hover { background: rgba(255, 93, 108, .2); border-color: var(--red); box-shadow: 0 0 22px rgba(255, 93, 108, .3); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(4, 10, 22, 0.7); outline: none; transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(60, 200, 255, .15); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
select option { background: #0b1426; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=file] { color: var(--muted); font-size: 13px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(60,200,255,.08); color: var(--text); cursor: pointer; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 卡片 ---------- */
.card {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-hi), var(--panel)); backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow); padding: 22px;
}
.card::before, .card::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; opacity: .75; }
.card::before { top: -1px; left: -1px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); border-top-left-radius: var(--radius); }
.card::after { right: -1px; bottom: -1px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); border-bottom-right-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; }
.card-title .idx { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 7px; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }

/* ---------- 徽标 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); background: rgba(130,190,255,.06); white-space: nowrap; }
.badge-ok { color: var(--green); border-color: rgba(75,227,166,.4); background: rgba(75,227,166,.08); }
.badge-warn { color: var(--orange); border-color: rgba(255,154,60,.45); background: rgba(255,154,60,.08); }
.badge-info { color: var(--cyan-2); border-color: rgba(60,200,255,.45); background: rgba(60,200,255,.08); }
.badge-bad { color: var(--red); border-color: rgba(255,93,108,.45); background: rgba(255,93,108,.08); }
.badge-purple { color: var(--purple); border-color: rgba(169,116,255,.45); background: rgba(169,116,255,.1); }
.badge-gold { color: var(--gold); border-color: rgba(244,199,106,.45); background: rgba(244,199,106,.08); }
.badge-copper { color: #e0a074; border-color: rgba(224,160,116,.45); background: rgba(224,160,116,.08); }
.badge-silver { color: #cfd9e8; border-color: rgba(207,217,232,.45); background: rgba(207,217,232,.08); }
.badge-diamond { color: #8df0ff; border-color: rgba(141,240,255,.55); background: rgba(141,240,255,.1); }

/* ---------- 头像 ---------- */
.avatar { --s: 40px; width: var(--s); height: var(--s); border-radius: 12px; flex: none; display: inline-grid; place-items: center; overflow: hidden; font-weight: 800; color: #04101c; font-size: calc(var(--s) * .44); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 0 0 2px rgba(60,200,255,.12); background: linear-gradient(135deg, hsl(var(--hue) 85% 62%), hsl(calc(var(--hue) + 40) 85% 55%)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: rgba(130,190,255,.05); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(60,200,255,.04); }
.empty { padding: 28px; text-align: center; color: var(--dim); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 14, .72); backdrop-filter: blur(6px); animation: fade .18s ease; overflow-y: auto; }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 18px; border: 1px solid var(--line-strong); background: linear-gradient(160deg, #0f1c36, #0a1426); box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 40px rgba(60,200,255,.12); padding: 24px; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { width: min(860px, 100%); }
.modal h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 22px; }
.modal .x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.modal .x:hover { color: var(--text); border-color: var(--cyan); }
.modal .stack { display: grid; gap: 14px; margin-top: 16px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96) } to { opacity: 1; transform: none } }

.lightbox { cursor: zoom-out; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 90vh; border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.7); image-rendering: auto; }

/* ---------- 提示 / 消息 ---------- */
.msg { display: none; padding: 10px 14px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.msg.show { display: block; }
.msg-ok { color: var(--green); background: rgba(75,227,166,.08); border-color: rgba(75,227,166,.3); }
.msg-err { color: #ff8c97; background: rgba(255,93,108,.08); border-color: rgba(255,93,108,.3); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast { padding: 12px 16px; border-radius: 12px; font-size: 14px; border: 1px solid var(--line-strong); background: #0d1a31; box-shadow: var(--shadow); animation: pop .25s ease; }
.toast.ok { border-color: rgba(75,227,166,.5); } .toast.err { border-color: rgba(255,93,108,.55); } .toast.gift { border-color: rgba(244,199,106,.6); box-shadow: 0 0 30px rgba(244,199,106,.2); }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } #fx { display: none; } }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #1d3358; border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }

/* 晶体工坊视觉层：与业务、文案和数据完全解耦 */
:root {
  --bg: #050b17;
  --bg-2: #071528;
  --panel: rgba(8, 21, 42, .94);
  --panel-hi: rgba(19, 40, 70, .96);
  --line: rgba(108, 185, 255, .19);
  --line-strong: rgba(113, 217, 255, .44);
  --text: #f2f8ff;
  --muted: #b0c4dc;
  --dim: #8197b4;
  --cyan: #38d9ff;
  --cyan-2: #a0f2ff;
  --blue: #5188ff;
  --purple: #bd8bff;
  --orange: #ffae64;
  --green: #70efc0;
  --gold: #ffe19a;
  --radius: 18px;
  --font-display: "Microsoft YaHei UI", "Noto Sans SC", "PingFang SC", "Segoe UI", sans-serif;
  --glow: 0 0 0 1px rgba(115, 227, 255, .22), 0 12px 34px rgba(39, 178, 255, .19);
  --shadow: 0 24px 60px rgba(1, 6, 18, .46);
}
body {
  background:
    radial-gradient(800px 600px at 96% 0%, rgba(35, 128, 255, .28), transparent 72%),
    radial-gradient(680px 540px at 1% 30%, rgba(115, 58, 211, .17), transparent 72%),
    radial-gradient(830px 480px at 88% 95%, rgba(10, 173, 215, .12), transparent 75%),
    linear-gradient(rgba(125, 202, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 202, 255, .045) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, auto, 48px 48px, 48px 48px, auto;
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 42%, rgba(53, 156, 233, .045) 42.15%, transparent 42.3%),
    linear-gradient(45deg, transparent 75%, rgba(177, 110, 255, .035) 75.15%, transparent 75.3%);
}
#fx { opacity: .62; }
.card {
  border-color: var(--line-strong);
  background: radial-gradient(400px 220px at 100% 0%, rgba(58, 152, 245, .09), transparent 78%),
    linear-gradient(150deg, rgba(20, 43, 76, .97), rgba(8, 20, 40, .97));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(169, 227, 255, .1);
}
.card::before, .card::after { width: 21px; height: 21px; opacity: .9; }
.card-title { font-weight: 800; letter-spacing: .03em; }
.card-title .idx { color: var(--cyan-2); background: rgba(55, 203, 255, .1); font-weight: 800; }
.eyebrow { color: #9cbed8; font-weight: 700; }
.btn { border-radius: 7px 14px 7px 14px; min-height: 42px; }
.btn-primary { background: linear-gradient(115deg, #81f0ff, #45b7ff 54%, #8b91ff); color: #06172a; box-shadow: inset 0 1px 0 #d2fbff, 0 9px 28px rgba(56, 175, 255, .31); }
.btn-primary:hover { background: linear-gradient(115deg, #a5f6ff, #65d1ff 54%, #b0a1ff); box-shadow: inset 0 1px 0 #e2fcff, 0 13px 35px rgba(56, 175, 255, .43); }
.btn:focus-visible, .back:focus-visible, .nav:focus-visible, .chip:focus-visible, .hub:focus-visible { outline: 2px solid #c2f7ff; outline-offset: 3px; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select { background: rgba(4, 12, 28, .82); border-color: rgba(124, 197, 255, .37); }
input::placeholder, textarea::placeholder { color: #8097b3; }
.modal { border-color: rgba(117, 218, 255, .6); background: radial-gradient(430px 260px at 100% 0%, rgba(63, 120, 250, .2), transparent 75%), linear-gradient(155deg, #162d4f, #09182e 80%); box-shadow: 0 34px 90px rgba(0, 4, 14, .75), 0 0 48px rgba(62, 182, 255, .18); }
.modal .x { width: 40px; height: 40px; }
.table-wrap { border-color: rgba(117, 203, 255, .28); }
th { color: #b3cbe1; background: rgba(54, 137, 203, .12); }
tbody tr:hover { background: rgba(73, 176, 246, .09); }
.toast { border-color: rgba(111, 215, 255, .5); background: #112644; }
@media (prefers-reduced-motion: reduce) { body::before { display: none; } }
