/* 登录注册 / 会员中心 / 后台共用组件, 颜色变量来自 site.css */

/* 表单 */
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 10px; font: inherit; font-size: 15px; color: var(--fg);
  background: rgba(5, 7, 15, .6); border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.check input { margin-top: 4px; accent-color: var(--violet); }
.check a, .link { color: var(--cyan); }
.link:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(120deg, #ef4444, #db2777); box-shadow: none; }
.btn-xs { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
button.btn { border: 0; cursor: pointer; font-family: inherit; }
button.btn-ghost { border: 1px solid var(--line); }
.inline { display: inline; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 160px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 提示条 */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.alert-ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); color: #86efac; }
.alert-error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.alert-info { background: rgba(34, 211, 238, .08); border-color: rgba(34, 211, 238, .3); color: #a5f3fc; }
.alert form { display: inline; }
.alert button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* 登录注册页 */
.auth { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 100px 16px 60px; overflow: hidden; }
.auth .hero-grid, .auth .aurora { position: absolute; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 36px 32px; border-radius: 20px; box-shadow: var(--glow); }
.auth-card h1 { margin: 0 0 6px; font-size: 28px; }
.auth-card .sub { text-align: left; margin: 0 0 26px; font-size: 14px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 14px; color: var(--muted); }

/* 会员中心 / 后台布局 */
.panel { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; padding-top: 68px; position: relative; z-index: 1; }
.side { position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(5, 7, 15, .5); }
.side h4 { margin: 18px 12px 8px; font: 600 11px var(--mono); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.side h4:first-child { margin-top: 0; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 14px; color: #b7c0d8; transition: background .15s, color .15s; }
.side a:hover { background: rgba(255, 255, 255, .04); color: var(--fg); }
.side a.on { background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(139, 92, 246, .08)); color: #fff; box-shadow: inset 2px 0 0 var(--cyan); }
.side .who { padding: 14px 12px; margin-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); word-break: break-all; }
.main { padding: 32px 36px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 26px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.crumb { font: 12px var(--mono); color: var(--muted); margin-bottom: 6px; }
.crumb a:hover { color: var(--cyan); }

.box { border-radius: 16px; padding: 24px; margin-bottom: 22px; }
.box > h3 { margin: 0 0 16px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.box > h3 small { font: 400 13px inherit; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { position: relative; overflow: hidden; border-radius: 16px; padding: 20px 22px; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--grad); opacity: .7; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font: 700 28px/1.3 var(--display); margin-top: 6px; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid rgba(148, 163, 255, .07); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-size: 13px; white-space: nowrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); font-size: 14px; }

.badge-s { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge-s.ok, .badge-s.paid, .badge-s.active { color: #86efac; border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .08); }
.badge-s.pending { color: #fde68a; border-color: rgba(234, 179, 8, .4); background: rgba(234, 179, 8, .08); }
.badge-s.error, .badge-s.banned, .badge-s.disabled, .badge-s.closed, .badge-s.refunded, .badge-s.revoked { color: #fca5a5; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .07); }
.badge-s.plan { color: #c4b5fd; border-color: rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .1); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); color: var(--muted); }
.pager a:hover { border-color: var(--cyan); color: var(--fg); }
.pager .on { background: var(--grad); color: #fff; border-color: transparent; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 150px; padding: 9px 12px; font-size: 14px; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .bar i { width: 100%; max-width: 34px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--cyan), var(--violet)); opacity: .85; position: relative; }
.bars .bar i:hover { opacity: 1; box-shadow: 0 0 14px rgba(34, 211, 238, .5); }
.bars .bar i::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: 11px var(--mono); color: var(--fg); opacity: 0; white-space: nowrap; padding-bottom: 4px; }
.bars .bar i:hover::after { opacity: 1; }
.bars .bar span { font: 10px var(--mono); color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* 新 Key 只显示一次 */
.secret { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 10px; background: rgba(5, 7, 15, .8); border: 1px dashed var(--cyan); font: 14px var(--mono); word-break: break-all; }
.secret code { flex: 1; color: #a5f3fc; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

/* 套餐选择 */
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.plan-pick .plan { padding: 24px; }
.plan-pick .plan .btn { margin-top: auto; }
.plan .msrp { font-size: 14px; color: var(--muted); text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.current-tag { position: absolute; top: 14px; right: 14px; font-size: 11px; color: var(--cyan); border: 1px solid rgba(34, 211, 238, .4); padding: 2px 8px; border-radius: 99px; }

/* 网页版对话 */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 460px; border-radius: 16px; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.chat-log .msg { max-width: 80%; white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { min-height: 48px; max-height: 160px; flex: 1; }
.chat-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chat-bar select { width: auto; padding: 6px 34px 6px 10px; font-size: 13px; }

/* 导航里的用户菜单 */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user form { margin: 0; }
.nav-user .link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.nav-user .link-btn:hover { color: var(--fg); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .panel { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; display: none; }
  .side.open { display: block; }
  .menu-toggle { display: inline-block; }
  .main { padding: 22px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .chat-log .msg { max-width: 92%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}

/* 条款页 */
.legal h1 { font-size: 36px; margin: 0 0 6px; }
.legal h3 { margin: 30px 0 8px; font-size: 18px; }
.legal p { color: #c3cbe0; margin: 0 0 12px; }
