/* ===== 极影内容工厂 · 应用外壳（第③层）=====
 * 只放外壳专属样式：侧栏 / 顶栏 / 登录门禁 / 充值 / 个人中心。
 * 设计令牌见 tokens.css，通用按钮/表单/弹窗见 components.css。
 * 基调：product register 的克制高级感 —— 精准强调色、中性层次、无彩色发光。
 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.5;
}
.hidden { display: none !important; }

/* ===== 整体骨架：左侧栏 + 右侧（顶栏 + 内容）===== */
.app-shell { display: grid; grid-template-columns: 120px 1fr; height: 100vh; }
@media (max-width: 820px) { .app-shell { grid-template-columns: 62px 1fr; } }

/* ===== 左侧模块导航 ===== */
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 14px 8px; gap: 2px; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 6px 6px 16px; }
.sidebar-brand .logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-dark)); color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.2);
}
.sidebar-brand .logo svg { width: 17px; height: 17px; }
.sidebar-brand .name { font-size: var(--fs-md); font-weight: 650; color: var(--sidebar-text-strong); letter-spacing: -.01em; white-space: nowrap; }
.sidebar-brand .sub { font-size: 10.5px; color: #6b6e78; margin-top: 1px; }
@media (max-width: 820px) { .sidebar-brand .name, .sidebar-brand .sub, .mod-item .label, .mod-section { display: none; } }

.mod-section { font-size: 10px; text-transform: uppercase; color: #63666f; padding: 14px 8px 6px; letter-spacing: .04em; font-weight: 600; }
.mod-item {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--sidebar-text); font-size: var(--fs-base); font-weight: 500;
  border: none; background: none; width: 100%; text-align: left;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.mod-item .icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex: none; color: currentColor; opacity: .82; }
.mod-item .icon svg { width: 18px; height: 18px; }
.mod-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.mod-item:hover .icon { opacity: 1; }
.mod-item.active { background: var(--sidebar-active); color: #fff; }
.mod-item.active .icon { opacity: 1; color: color-mix(in srgb, var(--accent) 62%, #fff); }
.mod-item.active::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent); }
.mod-item:disabled { opacity: .38; cursor: default; }
.mod-item:disabled:hover { background: none; color: var(--sidebar-text); }
.mod-item .soon { display: none; } /* 窄侧栏放不下角标；「即将上线」靠禁用置灰态表达 */
.sidebar-foot { margin-top: auto; font-size: 10px; color: #55585f; padding: 12px 10px 4px; letter-spacing: .01em; }

/* ===== 顶栏（账号 / 积分 / 充值）===== */
.rightcol { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar-shell {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 22px; background: rgba(255,255,255,.82); backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.topbar-title { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.topbar-title .mod-badge { font-size: 11px; background: var(--accent-soft); color: var(--accent-dark); padding: 2.5px 9px; border-radius: var(--radius-pill); font-weight: 600; letter-spacing: .01em; }
.topbar-acct { display: flex; align-items: center; gap: 9px; }
.credits-chip {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px 6px 11px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid var(--border-strong); cursor: pointer; transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.credits-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.credits-chip .coin { width: 13px; height: 13px; border-radius: 50%; background: linear-gradient(150deg, #f7c948, #e8a63c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); flex: none; }
.credits-chip #creditsVal { font-variant-numeric: tabular-nums; }
.credits-chip .cr-label { color: var(--muted); font-weight: 500; }
.btn-recharge {
  padding: 7px 15px; border: none; border-radius: var(--radius-pill); background: var(--accent); color: #fff;
  font-size: var(--fs-sm); font-family: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn-recharge:hover { background: var(--accent-dark); }
.btn-recharge:active { transform: translateY(.5px); }
/* 解锁按钮：未解锁时出现，用琥珀色引导用户去输授权码 */
.btn-unlock {
  padding: 7px 14px; border: 1px solid #e0a92e; border-radius: var(--radius-pill);
  background: #fff7e6; color: #a76a00; font-size: var(--fs-sm); font-family: inherit; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.btn-unlock:hover { background: #ffefc7; }
.btn-unlock:active { transform: translateY(.5px); }
.btn-unlock.hidden { display: none; }
/* 自定义充值金额 */
.custom-amt { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; }
.custom-amt .ca-label { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--muted); }
.custom-amt input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); font-family: inherit; }
.custom-amt input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.custom-amt .ca-hint { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; color: var(--accent-dark); font-variant-numeric: tabular-nums; }

/* 支付成功面板（充值弹窗内） */
.pay-success { text-align: center; padding: 26px 10px 10px; }
.pay-ok-mark { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 32px; line-height: 58px; box-shadow: 0 6px 18px rgba(22,163,74,.35); animation: pay-pop .3s var(--ease-out, ease); }
.pay-ok-title { font-size: 19px; font-weight: 700; margin-bottom: 5px; }
.pay-ok-sub { color: var(--muted); font-size: 13px; }
@keyframes pay-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.acct-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: var(--radius-pill); transition: background var(--dur-1) var(--ease-out); }
.acct-user:hover { background: var(--surface-2); }
.acct-user .avatar { width: 29px; height: 29px; border-radius: 50%; background: #2a2c33; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.acct-user .uname { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.acct-user .uname .u-sub { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ===== 模块内容区 ===== */
.module-host { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.module-pane { display: none; }
.module-pane.active { display: block; animation: pane-in var(--dur-3) var(--ease-out); }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.module-loading { padding: 60px; text-align: center; color: var(--muted); font-size: var(--fs-base); }

/* ===== 外壳级表单（登录/充值，模块加载前也可用）===== */
.auth-gate input, #rechargeMask input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-base); font-family: inherit; background: #fff; color: var(--text); margin-bottom: 10px;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.auth-gate input:focus, #rechargeMask input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
/* 充值/个人中心弹窗盖在最上层 */
#rechargeMask, #profileMask { z-index: var(--z-modal); }

/* ===== 登录门禁：内容工厂品牌页 ===== */
.auth-gate { position: fixed; inset: 0; z-index: var(--z-authgate); display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(120% 120% at 100% 0%, #2a1620 0%, #14101a 55%, #0c0910 100%); }
.auth-gate.hidden { display: none; }
.auth-shell { display: grid; grid-template-columns: 1.02fr .98fr; width: 862px; max-width: 100%; min-height: 520px;
  border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 40px 100px rgba(0,0,0,.5); animation: modal-in var(--dur-3) var(--ease-out); }

/* 品牌 / 工厂面板 */
.auth-hero { position: relative; padding: 40px 34px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; overflow: hidden;
  background: radial-gradient(135% 105% at 0% 0%, #3d1622 0%, #24101a 46%, #170c14 100%); }
.auth-hero::before { content: ""; position: absolute; inset: 0; opacity: .6; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 27px 27px; -webkit-mask-image: radial-gradient(115% 85% at 25% 8%, #000 28%, transparent 72%); mask-image: radial-gradient(115% 85% at 25% 8%, #000 28%, transparent 72%); }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.auth-logo .logo { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(150deg, var(--accent), var(--accent-dark)); box-shadow: 0 4px 14px rgba(240,31,60,.4); flex: none; }
.auth-logo .logo svg { width: 20px; height: 20px; }
.auth-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.18); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.auth-headline { font-size: 29px; line-height: 1.24; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.auth-headline em { font-style: normal; color: #ff5c74; }
.auth-tagline { margin: 13px 0 0; font-size: 13.5px; color: rgba(255,255,255,.64); line-height: 1.65; }
.factory-motif { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 40px); grid-auto-rows: 48px; gap: 9px; width: max-content; }
.factory-motif .tile { border-radius: 6px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); opacity: 0; transform: translateY(9px) scale(.96); animation: tile-in .5s var(--ease-out) forwards; }
.factory-motif .tile.t1 { background: linear-gradient(158deg, var(--accent), var(--accent-dark)); border-color: transparent; animation-delay: .06s; }
.factory-motif .tile.t2 { animation-delay: .14s; }
.factory-motif .tile.t3 { animation-delay: .22s; }
.factory-motif .tile.t4 { animation-delay: .3s; }
.factory-motif .tile.t5 { background: linear-gradient(158deg, #ff6a45, #e2431f); border-color: transparent; animation-delay: .38s; }
.factory-motif .tile.t6 { animation-delay: .46s; }
@keyframes tile-in { to { opacity: 1; transform: none; } }
.auth-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.auth-feats li { font-size: 13px; color: rgba(255,255,255,.74); padding-left: 24px; position: relative; }
.auth-feats li::before { content: ""; position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: rgba(240,31,60,.2); box-shadow: inset 0 0 0 1px rgba(240,31,60,.55); }
.auth-feats li::after { content: ""; position: absolute; left: 5px; top: 5.5px; width: 5px; height: 3px; border-left: 1.7px solid #ff5c74; border-bottom: 1.7px solid #ff5c74; transform: rotate(-45deg); }

/* 表单面板 */
.auth-card { padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; background: #fff; }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.auth-sub { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 20px; line-height: 1.5; }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; width: 420px; min-height: 0; }
  .auth-hero { padding: 26px 26px 22px; gap: 12px; }
  .auth-headline { font-size: 21px; }
  .auth-hero .factory-motif, .auth-hero .auth-feats, .auth-hero .auth-tagline { display: none; }
  .auth-card { padding: 30px 26px 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .factory-motif .tile { animation: none; opacity: 1; transform: none; }
  .auth-shell { animation: none; }
}
.auth-tabs { display: flex; gap: 3px; background: #eeeff2; padding: 3px; border-radius: var(--radius); margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 9px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-base); color: var(--muted); font-weight: 600; transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.auth-tab.active { background: #fff; color: var(--text); box-shadow: var(--shadow-xs); }
.auth-err { color: var(--danger); font-size: var(--fs-sm); min-height: 18px; margin-bottom: 6px; }
.auth-submit { width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: var(--fs-md); font-family: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-xs); transition: background var(--dur-1) var(--ease-out); }
.auth-submit:hover { background: var(--accent-dark); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 手机验证码行 / 登录页底部链接 ===== */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; margin-bottom: 10px; }
.btn-code { flex: 0 0 auto; height: 42px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.btn-code:hover { background: #fff; border-color: var(--accent); color: var(--accent-dark); }
.btn-code:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); color: var(--muted); }
.auth-foot { display: flex; justify-content: space-between; margin-top: 12px; }
.auth-foot a { font-size: var(--fs-sm); color: var(--accent-dark); cursor: pointer; font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }

/* ===== 个人中心 ===== */
.prof-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: var(--fs-base); }
.prof-row > span:first-child { color: var(--muted); }
.prof-row b { font-variant-numeric: tabular-nums; }
.prof-edit { display: flex; gap: 6px; align-items: center; }
.prof-edit input { width: 130px; padding: 6px 10px !important; margin: 0 !important; }
.prof-fold { margin: 10px 0; }
.prof-fold summary { cursor: pointer; font-size: var(--fs-base); font-weight: 600; color: var(--text); padding: 6px 0; }
.prof-fold input { margin-top: 8px; }
.prof-fold .btn-ghost { margin-top: 4px; }
/* 积分计费说明列表 */
.credit-rules { list-style: none; margin: 8px 0 0; padding: 0; }
.credit-rules li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 1px; border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.credit-rules li:last-child { border-bottom: none; }
.credit-rules li > span { color: var(--muted); }
.credit-rules li b { color: var(--accent-dark); white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ===== 充值套餐 ===== */
.pkg-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pkg-card { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 12px; cursor: pointer; text-align: center; background: #fff; transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.pkg-card:hover { border-color: #d2d3d9; box-shadow: var(--shadow-sm); }
.pkg-card.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.pkg-card .pk-amt { font-size: var(--fs-lg); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pkg-card .pk-cr { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.chan-row { display: flex; gap: 12px; margin: 2px 0 16px; font-size: var(--fs-base); }
.chan-row label { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: 1; justify-content: center; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out); }
.chan-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.redeem-fold { margin-top: 6px; }
.pay-area { margin-top: 14px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; }
.pay-area.hidden { display: none; }
.pay-qr { width: 180px; height: 180px; margin: 0 auto 10px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-xs); padding: 12px; word-break: break-all; }
.pay-qr-img { width: 200px; height: 200px; display: block; margin: 0 auto; border-radius: var(--radius-sm); }

/* ===== 积分明细 ===== */
.ledger-list { max-height: 180px; overflow-y: auto; font-size: var(--fs-sm); }
.ledger-row { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px solid var(--border); }
.ledger-row .lg-delta { font-variant-numeric: tabular-nums; }
.ledger-row .lg-delta.pos { color: var(--success); font-weight: 600; }
.ledger-row .lg-delta.neg { color: var(--danger); font-weight: 600; }
.ledger-row .lg-meta { color: var(--muted); }
