/* ============================================================
 * apps.css —— 各软件专属样式（1:1 还原向）
 *
 * 首页上每个 App 有自己的一块颜色（A.color）。这里把同一块颜色
 * 换算成 AppBar：不许各写各的渐变，统一用一条规则 ——
 * 色块本身就是 AppBar 的底色，底部压 12% 的暗调出体积。
 * 这样"桌面图标 → 打开后的顶栏"是同一个颜色，切换时眼睛不用重新对。
 * 需要主题色的地方直接写 background: var(--app-bg, ...)。
 * ============================================================ */

/* ============ QQ ============ */
.qq-root { background: var(--bg); }

/* 顶部：跟聊天页同一条骨架，切换时不跳 */
.qq-appbar {
  --app-bg: #4A9BC9;
  background: linear-gradient(168deg, color-mix(in srgb, var(--app-bg) 88%, #FFFDFB) 0%, var(--app-bg) 100%);
  box-shadow: 0 1px 2px rgba(42, 49, 56, .10), 0 4px 14px rgba(74, 155, 201, .20);
}
.qq-appbar .qq-un {
  margin-right: 12px;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .24);
  border: 1px solid rgba(255, 255, 255, .3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600;
}

.qq-search {
  margin: 10px 12px;
  background: var(--surface);
  border-radius: var(--r);
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-3);
  font-size: 13px;
  gap: 7px;
  box-shadow: var(--e1);
}
.qq-search .ic-svg { opacity: .7; flex: none; }
.qq-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-tabbar {
  display: flex;
  height: 46px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  flex: none;
}
.qq-tabbar .qt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13.5px;
  color: var(--text-2);
  position: relative;
  transition: color var(--fast);
}
.qq-tabbar .qt .qt-ic { display: inline-flex; align-items: center; opacity: .8; }
.qq-tabbar .qt.on { color: #3B7EA8; font-weight: 500; }
.qq-tabbar .qt.on .qt-ic { opacity: 1; }
.qq-tabbar .qt.on::after {
  content: ''; position: absolute; bottom: 0; left: 22%; right: 22%; height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, #5B90AF, #3B7EA8);
}
.qq-tabbar .qt .badge { margin-left: 4px; }

/* 列表空态：不再用 62px 的圆角方块兜住图标 —— 空态本来就该"轻" */
.q-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.q-empty .qe-ic {
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  opacity: .42;
}

/* ---------- 收款页 ----------
 * 这是整个 QQ 里唯一"跟钱有关"的一屏，所以给它一块浅色卡片做底，
 * 让余额从聊天列表的灰白里跳出来 —— 但也只跳一档，不做成金色横幅。
 * 钱这种事，克制比醒目更让人信服。
 */
.pay-hero {
  margin: 12px 12px 4px;
  padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(168deg, #FFFDFB 0%, #F7F6F3 100%);
  box-shadow: var(--e2);
}
.pay-hero .ph-label {
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: 1.6px; text-transform: uppercase;
}
.pay-hero .ph-amount {
  font-size: 34px; font-weight: 300; letter-spacing: -1.3px;
  color: #243038; line-height: 1.1; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.pay-hero .ph-split {
  display: flex; gap: 28px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--divider);
}
.pay-hero .ph-split > div { display: flex; flex-direction: column; gap: 3px; }
.pay-hero .phs-k { font-size: 11px; color: var(--text-3); }
.pay-hero .phs-v {
  font-size: 15px; font-weight: 500; color: #2F6B45;
  font-variant-numeric: tabular-nums;
}
.pay-hero .phs-v.warn { color: #A8762A; }

/* 流水行 */
.pay-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px 11px 16px; background: var(--surface);
  position: relative;
}
.pay-row + .pay-row::before {
  content: ''; position: absolute; left: 42px; right: 0; top: 0;
  height: 1px; background: var(--divider);
}
.pay-row .pr-ic {
  width: 22px; height: 22px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #E8F1EA; color: #3F7A52;
}
.pay-row .pr-main { flex: 1; min-width: 0; }
.pay-row .pr-t {
  font-size: 14.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pay-row .pr-s {
  font-size: 11.5px; color: var(--text-3); margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pay-row .pr-amt {
  flex: none; font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.pay-row .pr-amt.in { color: #2F6B45; }

/* 待收行：左侧一道短竖线，跟入账行分开 */
.pay-row.warn::after {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 0 3px 3px 0; background: #D9A63F;
}
.pay-row.warn .pr-amt { color: #A8762A; }

/*
 * 会话行：头像 + 主体两列。
 * 角标挂在头像右上角（.conv-av 相对定位），不占行尾位置 ——
 * 之前角标和"3月12日"都在右端，谁后渲染谁盖住谁，
 * 结果是时间被红点啃掉半个字。
 */
.conv {
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 12px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.conv:active { background: #EDF0F1; }
.conv + .conv::before {
  content: ''; position: absolute; left: 68px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.conv .conv-av { position: relative; flex: none; isolation: isolate; }
.conv .conv-av .badge {
  position: absolute; top: -4px; right: -5px;
  box-shadow: 0 1px 3px rgba(60, 70, 66, .22);
}
.conv .c-body { flex: 1; min-width: 0; margin-left: 12px; }
.conv .c-top { display: flex; align-items: baseline; gap: 8px; }
.conv .c-name {
  font-size: 15px;
  flex: 1;
  min-width: 0;
  letter-spacing: -.05px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .c-time { font-size: 11px; color: var(--text-3); flex: none; }
.conv .c-msg {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv .c-msg.dim { color: var(--text-3); }
.conv .c-msg.draft { color: #C0504A; }
.conv.pin { background: var(--surface-2); }

/* 聊天页 */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-scroll {
  flex: 1; overflow-y: auto; padding: 12px 12px 6px;
  /* 聊天底用暖调网格，比纯色有"纸"的质感 */
  background:
    radial-gradient(circle at 1px 1px, rgba(150, 150, 140, .13) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(178deg, #F2F1EE 0%, #EDECE8 100%);
  scroll-behavior: smooth;
}
.msg-row { display: flex; margin-bottom: 12px; align-items: flex-start; }
.msg-row.me { flex-direction: row-reverse; }
.msg-row .m-av { flex: none; }
.msg-row .m-col { max-width: 74%; margin: 0 9px; min-width: 0; }
.msg-row.me .m-col { text-align: right; }
.msg-row .m-name { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.bubble {
  display: inline-block;
  text-align: left;
  background: var(--surface);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 14.5px;
  line-height: 1.55;
  box-shadow: var(--e1);
  position: relative;
  word-break: break-word;
}
.bubble::before {
  content: ''; position: absolute; top: 13px; left: -5px;
  width: 0; height: 0; border: 5px solid transparent; border-right-color: var(--surface); border-left: 0;
}
/* 自己说的话：暖蓝气泡，跟别人的白气泡分开 */
.msg-row.me .bubble {
  background: linear-gradient(160deg, #C8E2F0 0%, #BCDCEE 100%);
  box-shadow: 0 1px 2px rgba(74, 128, 160, .14), 0 3px 10px rgba(74, 128, 160, .12);
}
.msg-row.me .bubble::before {
  left: auto; right: -5px;
  border-right-color: transparent; border-right: 0;
  border-left-color: #C2DFEF;
}
.bubble.sys {
  background: rgba(90, 110, 122, .08);
  color: var(--text-2);
  font-size: 12px;
  box-shadow: none;
  border-radius: 9px;
  padding: 5px 11px;
}
.bubble.sys::before { display: none; }
.msg-time {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin: 8px 0 12px;
}
.msg-row .m-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-start;
}
.msg-row.me .m-actions { justify-content: flex-end; }
.m-actions .btn { height: 30px; font-size: 12.5px; padding: 0 12px; letter-spacing: 0; font-weight: 400; }
.m-actions .btn.done { color: var(--text-3); box-shadow: none; background: transparent; }

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  flex: none;
}
.chat-input textarea {
  flex: 1;
  border: 0;
  background: #F2F4F5;
  border-radius: var(--r);
  padding: 9px 11px;
  font-size: 14px;
  outline: 0;
  resize: none;
  max-height: 84px;
  line-height: 1.45;
}
.chat-input .ci-send {
  width: 42px; height: 36px; flex: none; border-radius: var(--r);
  background: #E7EAEB; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast), transform var(--mag);
}
.chat-input .ci-send:active { transform: scale(.92); }
.chat-input .ci-send.on { background: #2E7CB8; color: #FFFDFB; }
.quick-replies {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px 0; background: var(--surface); flex: none;
}
.quick-replies .chip { margin-bottom: 6px; background: #EEF1F2; }

.group-members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; padding: 14px 12px; }
.gm { text-align: center; font-size: 11px; color: var(--text-2); }
.gm .avatar { margin: 0 auto 4px; }
.gm .gm-tag { font-size: 10px; color: var(--text-3); }

/* ============ 魔方后台（WHMCS 风） ============ */
.mf-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
.mf-stat .st {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--e1);
  padding: 11px 12px;
}
.mf-stat .st .st-k { font-size: 11px; color: var(--text-2); }
.mf-stat .st .st-v { font-size: 21px; font-weight: 400; margin-top: 2px; letter-spacing: .3px; }
.mf-stat .st .st-v small { font-size: 12px; color: var(--text-2); }
.mf-stat .st.up .st-v { color: var(--ok); }
.mf-stat .st.down .st-v { color: var(--danger); }

.mf-tabs { display: flex; border-bottom: 1px solid var(--divider); background: var(--surface); flex: none; }
.mf-tabs .mt {
  flex: 1; text-align: center; padding: 12px 0; font-size: 13.5px; color: var(--text-2);
  position: relative; overflow: hidden;
}
.mf-tabs .mt.on { color: var(--md-primary); font-weight: 500; }
.mf-tabs .mt.on::after {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 0; height: 2px; background: var(--md-primary);
}

.cust-row { display: flex; align-items: center; padding: 11px 14px; background: var(--surface); position: relative; }
.cust-row + .cust-row::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.cust-row .cr-main { flex: 1; min-width: 0; margin-left: 12px; }
.cust-row .cr-name { font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.cust-row .cr-meta { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.cust-row .cr-right { text-align: right; flex: none; }
/* 客户状态点。Active 那个会喘气 —— 客户列表上"谁还活着"一眼看得出来 */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; position: relative; isolation: isolate; }
.status-dot.Active { background: var(--ok); }
.status-dot.Suspended { background: var(--warn); }
.status-dot.Terminated { background: var(--dead); }
.status-dot.Overdue { background: var(--danger); }

.ticket {
  background: var(--surface);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.ticket + .ticket::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.ticket:active { background: #F4F6F7; }
.ticket .tk-top { display: flex; align-items: center; gap: 8px; }
.ticket .tk-id { font-size: 11px; color: var(--text-3); font-family: monospace; }
.ticket .tk-subj { font-size: 14.5px; margin-top: 3px; }
.ticket .tk-meta { font-size: 11.5px; color: var(--text-2); margin-top: 4px; display: flex; gap: 10px; }
.tk-pri { font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.tk-pri.High { background: #F2D9D6; color: #8E3F38; }
.tk-pri.Medium { background: #F3E3C6; color: #8A6A22; }
.tk-pri.Low { background: #E2E8EA; color: #5A7079; }

.tk-detail { padding: 14px; }
.tk-msg { background: var(--surface); border-radius: var(--r); box-shadow: var(--e1); padding: 12px; margin-bottom: 10px; }
.tk-msg .tm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tk-msg .tm-name { font-size: 13.5px; font-weight: 500; }
.tk-msg .tm-time { font-size: 11px; color: var(--text-3); margin-left: auto; }
.tk-msg .tm-body { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.tk-msg.admin { background: #EEF3F5; }

/*
 * 表格：自己就是白底 + 圆角，所以**外层要用 .md-card 托盘**（底色下沉一档），
 * 让表格浮出来。这就是"卡片套卡片"的正确解法 —— 不是禁止嵌套，
 * 而是两层的底色必须不同，否则叠出来的就是一块没有边界的大白。
 */
.mf-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 13px;
}
.mf-table th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-2);
  padding: 10px 12px; border-bottom: 1px solid var(--divider); background: var(--surface-2);
}
.mf-table td { padding: 10px 12px; border-bottom: 1px solid var(--divider); }
.mf-table tr:last-child td { border-bottom: 0; }

/*
 * 语义化告警条。
 * 以前这种条子是在 JS 里写内联 style 上色的，绕过设计系统 —— 改配色时
 * 会漏掉，而且同一个"报错"在不同页面长得不一样。现在统一成类。
 */
.banner {
  border-radius: var(--r-lg);
  padding: 12px;
  font-size: 13px;
  border: 1px solid transparent;
}
.banner.err { background: #F9E7E4; color: #8E3F38; border-color: #EBC9C4; }
.banner.warn { background: #F8EFDC; color: #8A6520; border-color: #E9D8B4; }
.banner.ok { background: #E6EFE7; color: #3E6B4B; border-color: #C7DBCB; }
.banner.info { background: var(--surface-2); color: var(--text); border-color: var(--divider); }

/* 安装向导 */
.wiz-step { padding: 16px; }
.wiz-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--md-primary); color: #FFFDFB;
  font-size: 12px; margin-right: 8px;
}
.wiz-log {
  background: #1E272B; color: #9FB6A8; font-family: monospace; font-size: 11.5px;
  border-radius: var(--r-sm); padding: 10px; margin-top: 10px; white-space: pre-wrap; line-height: 1.6;
  max-height: 160px; overflow-y: auto;
}
.wiz-log .err { color: #D98A7F; }
.wiz-log .ok { color: #8FB89C; }

/* ============ 浏览器 / BBS（Discuz 移动版） ============ */
.br-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2);
  border-bottom: 1px solid var(--divider); flex: none;
}
.br-url {
  flex: 1; background: var(--surface); border-radius: var(--r-sm); height: 32px; display: flex; align-items: center;
  padding: 0 12px; font-size: 12px; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--divider);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.br-url .u-host { color: var(--text-3); }

.bbs-head {
  background: #FFFDFB; color: var(--text); padding: 10px 14px; display: flex; align-items: center;
  flex: none; border-bottom: 1px solid var(--divider);
}
.bbs-head .bh-logo { font-size: 16px; font-weight: 500; letter-spacing: .5px; }
.bbs-head .bh-sub { font-size: 11px; color: var(--text-2); margin-left: 8px; }
.bbs-forum {
  display: flex; align-items: center; padding: 12px 14px; background: var(--surface); position: relative;
}
.bbs-forum + .bbs-forum::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.bbs-forum .bf-ic {
  width: 38px; height: 38px; border-radius: var(--r); background: #E7EBEC; color: #6E838C;
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none;
}
.bbs-forum .bf-m { flex: 1; margin-left: 11px; min-width: 0; }
.bbs-forum .bf-t { font-size: 14.5px; }
.bbs-forum .bf-s { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.bbs-forum .bf-n { font-size: 11.5px; color: var(--text-3); flex: none; text-align: right; }

.thread {
  padding: 11px 14px; background: var(--surface); position: relative; overflow: hidden;
}
.thread + .thread::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--divider);
}
.thread:active { background: #F4F6F7; }
.thread .th-t { font-size: 14.5px; line-height: 1.45; }
.thread .th-t .tag { color: #8A6A22; }
.thread .th-m { font-size: 11.5px; color: var(--text-3); margin-top: 5px; display: flex; gap: 12px; }
.thread.hot .th-t { font-weight: 500; }

.post { background: var(--surface); padding: 12px 14px; position: relative; }
.post + .post { border-top: 6px solid var(--bg); }
.post.op { background: #FBF9F4; }
.post .p-head { display: flex; align-items: center; gap: 9px; }
.post .p-name { font-size: 13.5px; font-weight: 500; }
.post .p-lz { font-size: 10px; background: var(--md-primary); color: #FFFDFB; padding: 0 4px; border-radius: 2px; }
.post .p-floor { margin-left: auto; font-size: 11px; color: var(--text-3); }
.post .p-time { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.post .p-body { font-size: 14.5px; line-height: 1.75; margin-top: 9px; white-space: pre-wrap; }
.post .p-quote {
  background: var(--surface-2); border-left: 3px solid #CBD3D6; padding: 7px 10px;
  font-size: 13px; color: var(--text-2); margin-bottom: 8px;
}
.post .p-foot { margin-top: 8px; font-size: 11.5px; color: var(--text-3); display: flex; gap: 14px; }

/* 搜索引擎 */
.se-hero { padding: 30px 16px 8px; }
.se-logo {
  font-size: 40px; letter-spacing: -1.6px; font-weight: 300;
  text-align: left; color: var(--md-primary); line-height: 1;
}
/* 字标下面一行小字，说明这不是真·巨硬 —— 顺便把"搜索"这件事讲清楚 */
.se-tag {
  font-size: 11.5px; color: var(--text-3);
  letter-spacing: 1.6px; text-transform: uppercase;
  margin-top: 8px;
}
.se-box {
  display: flex; align-items: center; background: var(--surface); border-radius: var(--r-lg); height: 44px;
  box-shadow: var(--e2); padding: 0 6px 0 16px; margin-top: 16px;
  transition: box-shadow var(--fast);
}
.se-box:focus-within { box-shadow: 0 0 0 2px rgba(78, 100, 114, .18), var(--e2); }
.se-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14.5px; }
.se-box .se-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); color: #FFFDFB;
  background: var(--md-primary);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--mag), background var(--fast);
}
.se-box .se-btn:active { transform: scale(.9); background: var(--md-primary-d); }
.se-res { padding: 13px 16px; background: var(--surface); position: relative; }
.se-res + .se-res::before { content: ''; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--divider); }
.se-res:active { background: #F7F6F3; }
.se-res .sr-t { font-size: 15.5px; color: #1A5C8A; line-height: 1.4; letter-spacing: -.1px; }
.se-res .sr-u { font-size: 11.5px; color: #4B7A4C; margin-top: 2px; }
.se-res .sr-d { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }
.se-res.ad .sr-u::after { content: '广告'; background: #E8EDEE; color: var(--text-2); padding: 0 4px; margin-left: 6px; font-size: 10.5px; }
.se-res .sr-t .hl { color: #B4524A; font-weight: 500; }

/* ============ 母鸡监控（Grafana 风） ============ */
.mon-root { background: #F4F3F0; color: var(--text); }
/*
 * 唯一不跟 --app-bg 规则的 AppBar。
 * 别的界面是"用户在自己手机里办事"，顶栏就该是那个 App 的品牌色；
 * 监控是"机器报出来的数"，它模仿的是 Grafana 这类运维看板 ——
 * 这类面板没有品牌色，只有一张浅色底 + 细分隔线。所以这里刻意留白底。
 */
.mon-appbar {
  background: linear-gradient(168deg, #FCFCFA 0%, #F2F2EF 100%);
  color: var(--text);
  box-shadow: none;
  border-bottom: 1px solid var(--divider);
}
/* 监控面板是"机器报出来的数"，所以圆角一律收小，跟游戏别的界面分开 */
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; padding: 10px; }
.node {
  aspect-ratio: 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: rgba(255, 255, 255, .8); font-family: monospace; position: relative;
}
.node.g { background: #5C8A6B; }
.node.y { background: #C99A2E; }
.node.r { background: #B4524A; animation: pulse 1.4s infinite; }
.node.gray { background: #CBD3D6; color: #7C8A90; }
@keyframes pulse { 50% { opacity: .45; } }
.mon-panel { background: var(--surface); border-radius: var(--r-lg); margin: 8px 10px; padding: 10px; border: 1px solid var(--divider); }
.mon-panel .mp-t { font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.mon-panel .mp-v { font-size: 22px; font-weight: 300; font-family: monospace; }
.spark { display: block; width: 100%; height: 42px; color: var(--ok); }
/* 语义色调：JS 只传 tone，色值在这里定 */
.spark.ok { color: var(--ok); }
.spark.warn { color: var(--warn); }
.spark.danger { color: var(--danger); }
.spark.accent { color: var(--md-accent); }
.mon-row { display: flex; gap: 10px; }
.mon-row > * { flex: 1; }
.mon-lock {
  margin: 10px; padding: 10px 12px; border: 1px dashed #C3CBD0; border-radius: 10px;
  font-size: 12px; color: var(--text-2); text-align: center;
  display: flex; align-items: flex-start; justify-content: center; gap: 8px;
  line-height: 1.6;
}
.mon-lock .ml-ic {
  flex: none; width: 20px; height: 20px; border-radius: 7px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(90, 110, 122, .10); color: #5A6E7A;
}

/* ============ 终端 ============ */
.term-root { background: #FFFDFB; color: #2C363C; font-family: monospace; font-size: 12.5px; }
.term-scroll { flex: 1; overflow-y: auto; padding: 10px 12px; white-space: pre-wrap; line-height: 1.65; }
.term-line .p { color: #3E7A55; }
.term-line .cmd { color: #1F2A2F; }
.term-line .err { color: #A8473D; }
.term-line .dim { color: #8A9AA1; }
.term-input {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #F5F4F1;
  border-top: 1px solid var(--divider); flex: none;
}
.term-input span { color: #6FA87F; }
.term-input .term-ps { display: inline-flex; align-items: center; color: #6FA87F; }
.term-input input {
  flex: 1; background: transparent; border: 0; outline: 0; color: #2C363C;
  font-family: monospace; font-size: 12.5px;
}
.term-keys { display: flex; gap: 6px; overflow-x: auto; padding: 6px 12px; flex: none; }
.term-keys .chip { background: #E9E7E3; color: var(--text-2); margin: 0; font-family: monospace; }

/* ============ B 站 ============ */
.bili-root { background: #F4F3F0; }
.bili-appbar {
  --app-bg: #FB7299;
  background: linear-gradient(168deg, color-mix(in srgb, var(--app-bg) 88%, #FFFDFB) 0%, var(--app-bg) 100%);
}
.bili-card {
  background: var(--surface); margin: 0 0 8px;
  border-radius: 0; overflow: hidden;
}
.bili-cover {
  height: 128px; display: flex; align-items: flex-end; padding: 10px;
  color: #FFFDFB; font-size: 12px; position: relative; overflow: hidden;
}
.bili-cover .bc-meta { display: flex; gap: 12px; text-shadow: 0 1px 3px rgba(42,49,56,.6); align-items: center; }
.bili-cover .bc-mi { display: inline-flex; align-items: center; gap: 4px; }
.bili-cover .bc-mi .ic-svg { opacity: .9; }
/* 封面正中的播放键 */
.bili-cover .bc-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .2);
  border: 1.5px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #FFFDFB; padding-left: 2px;
  box-shadow: 0 3px 12px rgba(42, 49, 56, .18);
  transition: transform var(--fast);
}
.bili-card:active .bc-play { transform: translate(-50%, -50%) scale(.92); }
.bili-card .bc-t { font-size: 14.5px; padding: 11px 12px 3px; line-height: 1.45; }
.bili-card .bc-u { font-size: 12px; color: var(--text-2); padding: 4px 12px 12px; }
.cmt { display: flex; gap: 10px; padding: 12px; position: relative; }
.cmt + .cmt::before { content: ''; position: absolute; left: 12px; right: 0; top: 0; height: 1px; background: var(--divider); }
.cmt .c-main { flex: 1; min-width: 0; }
.cmt .c-name { font-size: 12.5px; color: #5A7079; }
.cmt .c-txt { font-size: 14px; margin-top: 3px; line-height: 1.5; }
.cmt .c-foot { font-size: 11.5px; color: var(--text-3); margin-top: 5px; display: flex; gap: 14px; align-items: center; }
.cmt .c-foot .c-like { display: inline-flex; align-items: center; gap: 4px; }
.cmt .c-dm {
  background: #F0F3F4; border-radius: var(--r-sm); padding: 4px 10px; font-size: 12px; color: #FB7299;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ============ 术语图鉴 ============ */
.codex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.cdx {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--e1);
  padding: 10px 8px; text-align: center; position: relative; overflow: hidden;
}
.cdx .cx-n { font-size: 14px; font-weight: 500; }
.cdx .cx-c { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
/* 右上角一枚状态标记：解锁=对勾，未解锁=锁 */
.cdx .cx-mark {
  position: absolute; right: 6px; top: 6px;
  width: 20px; height: 20px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(88, 135, 106, .13); color: var(--ok);
}
.cdx .cx-mark .ic-svg { width: 12px; height: 12px; }
.cdx.lock .cx-mark { background: rgba(147, 157, 164, .16); color: #A8B4B9; }
.cdx.lock { background: #EAEDEE; box-shadow: none; color: #A8B4B9; }
.cdx.lock .cx-n { color: #A8B4B9; }
.cdx.fresh { box-shadow: 0 0 0 2px var(--md-accent), var(--e1); }

/* ============ 记事本 ============ */
.note-item { padding: 12px 14px; background: var(--surface); position: relative; }
.note-item + .note-item::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--divider); }
.note-item .ni-d { font-size: 11px; color: var(--text-3); }
.note-item .ni-t { font-size: 14px; margin-top: 3px; line-height: 1.5; }
.note-item.flag { border-left: 3px solid var(--md-accent); }

/* ============ 计算器 ============ */
/*
 * height:100% 在 flex 子项上会被 auto 基高架空，顶栏下面就会空一块。
 * 直接用 flex:1 让它把剩下的高度吃满。
 */
.calc-root {
  background: linear-gradient(178deg, #FBFBF9 0%, #F3F2EF 100%);
  color: var(--text);
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
}
/*
 * 输出区吃掉键盘之外剩下的全部高度，算式贴着键盘上沿右对齐。
 * 之前它只有 min-height:88px，结果顶栏下面空出一大块死区，
 * 而键盘又被压在最底下 —— 中间那段真空最伤"做完度"。
 */
.calc-out {
  flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 22px 20px; text-align: right;
  font-size: 44px; font-weight: 300; word-break: break-all;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.4px;
  line-height: 1.1;
}
.calc-out .expr {
  font-size: 15px; color: var(--text-3); min-height: 22px; margin-bottom: 8px;
  letter-spacing: 0;
}
/*
 * 显示区既然吃了整块剩余高度，上面就得有点东西交代它是"显示区"。
 * 贴一行很淡的提示在右上角，跟下面的算式同一条右对齐基线 ——
 * 空白因此变成留白，而不是"没加载出来"。
 */
.calc-out::before {
  content: 'AC 归零 · ⌫ 退格 · % 取余';
  font-size: 10.5px; letter-spacing: 1.4px; color: var(--text-3);
  opacity: .5; margin-bottom: auto; text-transform: uppercase;
  align-self: flex-end; padding-top: 4px;
}
/* 按键之间留缝，各自圆角 —— 这样才有"一块块按钮"的手感，而不是一张表格 */
.calc-pad {
  flex: none;
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 62px;
  gap: 8px; padding: 0 12px 16px;
}
.calc-pad button {
  background: var(--surface); color: var(--text); font-size: 22px;
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  transition: transform var(--mag), box-shadow var(--fast), background var(--fast);
}
.calc-pad button:active {
  background: var(--surface-2);
  transform: scale(.94);
  box-shadow: 0 1px 2px rgba(42, 49, 56, .08);
}
.calc-pad button.fn { color: var(--text-2); font-size: 18px; background: var(--surface-3); }
.calc-pad button.fn .ic-svg { opacity: .72; }
.calc-pad button.eq {
  background: linear-gradient(160deg, #D99645 0%, #C07E2C 100%);
  color: #FFFDFB;
  box-shadow: 0 2px 6px rgba(192, 126, 44, .30), 0 8px 22px rgba(192, 126, 44, .22);
}
.calc-pad button.eq:active {
  background: linear-gradient(160deg, #C07E2C 0%, #A96A1F 100%);
  box-shadow: 0 1px 3px rgba(192, 126, 44, .34);
}

/* ============ 场景 CG ============ */
.cg {
  position: absolute; inset: 0; background: #F0EFEC; z-index: 95;
  display: flex; flex-direction: column; animation: fade .5s;
}
.cg-art {
  flex: 1; margin: 12px; border-radius: var(--r-lg); position: relative; overflow: hidden;
  background: linear-gradient(160deg, #DDE4E6 0%, #EAEFF0 55%, #E1E8E9 100%);
  box-shadow: inset 0 0 60px rgba(90, 110, 115, .10);
}
.cg-art .cg-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #93A2A8; font-size: 12px; gap: 6px;
}
.cg-art .cg-placeholder .pk { font-size: 11px; letter-spacing: 2px; opacity: .6; }
/* 场景氛围层：由 CG 数据注入的色块 */
.cg-art .cg-layer { position: absolute; }
.cg-art .cg-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(70, 90, 95, .16) 100%);
}
.cg-cap { flex: none; padding: 16px 22px 8px; color: var(--text); }
.cg-cap .cg-line { font-size: 15.5px; line-height: 1.75; }
.cg-choices { flex: none; padding: 6px 16px 22px; display: flex; flex-direction: column; gap: 8px; }
.cg-choices .btn { background: #FFFDFB; color: var(--text); box-shadow: var(--e1); height: 44px; justify-content: flex-start; }
.cg-choices .btn:active { background: #F1F0ED; }

/* ============ 结束今天 / 日结算 ============ */
.dayend {
  position: absolute; inset: 0; background: rgba(248, 249, 248, .97); z-index: 92;
  display: flex; flex-direction: column; padding: 34px 26px; color: var(--text);
  animation: fade .3s;
}
.dayend .de-d { font-size: 12px; letter-spacing: 3px; color: var(--text-3); }
.dayend .de-t { font-size: 24px; font-weight: 300; margin-top: 6px; }
.dayend .de-lines { margin-top: 22px; flex: 1; overflow-y: auto; }
.dayend .de-line { font-size: 13.5px; line-height: 1.9; color: var(--text-2); display: flex; gap: 10px; }
.dayend .de-line b { color: var(--text); font-weight: 500; }
.dayend .de-line .v { margin-left: auto; font-family: monospace; }
.dayend .de-act { flex: none; padding-top: 12px; }

/* ---------- 魔方后台：登录闸门 ---------- */
/*
 * 还没拿到账号密码时看到的界面。
 * 视觉上刻意做成"一台没登录的机器"：冷灰、克制、卡片居中，
 * 和登录后那套有数据的仪表盘形成对比。
 */
.mf-login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  /* 顶部跟 AppBar 等高留白：状态栏是浮在上面的（z-index: 30），
     别的页都有 AppBar 把这段撑开，登录页没有 —— 不留白的话
     系统时间就直接压在字标上了。 */
  padding: 68px 28px 42px;
  background:
    radial-gradient(560px 360px at 50% 6%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(176deg, #F2F1EE 0%, #E9E8E4 100%);
  text-align: left;
  animation: fade .3s;
}
.mf-login-brand { margin-bottom: 30px; text-align: left; }
/*
 * 登录页的字标不再顶一枚 62px 的圆角方块。
 * 换成"一条品牌色横线 + 字"：机器的身份靠字和排版说，
 * 不靠一个谁都能套上去的方块。
 */
.mlb-mark {
  width: 44px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #5C7382 0%, #3F5462 100%);
  margin-bottom: 18px;
}
.mlb-name { font-size: 23px; font-weight: 600; letter-spacing: -.5px; color: #2F3A41; line-height: 1.15; }
.mlb-ver { font-size: 10.5px; color: var(--text-3); letter-spacing: 1.8px; margin-top: 8px; text-transform: uppercase; }

/*
 * 登录卡底下是静态渐变，不是滚动内容 —— 玻璃在这里糊不到东西，
 * 只会让卡片发灰。改实心暖白，纸感更实，还省一层合成开销。
 */
.mf-login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  box-shadow: var(--e3), inset 0 1px 0 rgba(255, 253, 251, .9);
  padding: 18px 18px 16px;
  text-align: left;
}
.mfl-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mfl-row + .mfl-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--divider); }
.mfl-k {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-2); flex: none; width: 62px; font-size: 12px;
}
.mfl-v { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--text); }
.mfl-v.lack { color: var(--text-3); font-family: inherit; font-style: italic; }

.mf-login-hint {
  width: 100%;
  margin-top: 24px;
}
.mfh-t { font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: -.1px; }
.mfh-d { font-size: 13px; color: var(--text-2); margin-top: 7px; line-height: 1.7; }
.mf-login-foot {
  font-size: 11px; color: var(--text-3); margin-top: auto; padding-top: 32px; line-height: 1.65;
}
