/* 客户后台补充样式（通用的在 base.css）。不写内联样式：页面要的样式都放这里。 */

/* ---------- 页面头 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin-bottom: 4px; }
.app-title { display: flex; gap: 14px; align-items: center; }
.app-name { display: inline-flex; align-items: center; gap: 8px; }
.icon-sm { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.icon-lg { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--line); background: #fff; flex: none; }
.icon-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; background: #fafbfc; }

/* ---------- 顶部 ---------- */
.topbar .who { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; color: var(--muted); }
.bell .dot { position: absolute; top: 1px; right: -7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.banner { font-weight: 500; }
.impersonate-bar { position: sticky; top: 0; z-index: 20; }

/* ---------- 布局小件 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid-2 > .card, .grid-2 > div > .card { margin-bottom: 16px; }
.mt-s { margin-top: 6px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-info { color: var(--primary); }
.card h2 .small, .card h2 a.small { font-weight: 400; margin-left: 8px; }

/* ---------- 用量 ---------- */
.usage-row { margin-bottom: 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.stat .progress { margin-top: 8px; }

/* ---------- 通知 ---------- */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { padding: 8px 0 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--primary); margin-bottom: 4px; }
.notice-list li.notice-warn { border-left-color: var(--warn); }
.notice-list li.notice-danger { border-left-color: var(--danger); }
.notice-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-item.unread .notice-head strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
.notice-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }

/* ---------- 应用详情 ---------- */
.link-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; align-items: start; }
.copy-row { display: flex; gap: 6px; align-items: center; max-width: 640px; }
.copy-row input { flex: 1; min-width: 0; max-width: none; }
.qr-box { text-align: center; }
.qr { display: inline-block; min-height: 40px; }
.qr canvas, .qr img { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.qr-download { margin-top: 8px; }
.pause-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pause-form input[type=text] { flex: 1; min-width: 180px; max-width: 360px; }
@media (max-width: 760px) {
  .link-grid { grid-template-columns: 1fr; }
}

/* ---------- 版本页 ---------- */
.versions table td { vertical-align: top; }
.row-current td { background: #f3fbf6; }
.row-extra td { border-top: 0; padding-top: 0; background: #fff; }
.row-extra details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.row-extra textarea { margin-top: 6px; min-height: 70px; }
.ops form { margin: 0 4px 4px 0; }
.ops { white-space: nowrap; }
.warn-list { margin: 0 0 6px; padding: 6px 10px 6px 28px; background: #fff7e6; border: 1px solid #ffd591; border-radius: 6px; color: #8a5300; font-size: 12.5px; }

/* ---------- 上传 ---------- */
.radio { display: inline-flex !important; align-items: center; gap: 6px; margin-right: 18px; color: var(--text) !important; font-size: 14px !important; cursor: pointer; }
.radio.muted { color: var(--muted) !important; cursor: not-allowed; }
.upload-progress { margin-top: 16px; max-width: 640px; }
.upload-progress .progress { height: 12px; border-radius: 6px; }
.upload-progress .progress > span { transition: width .3s; }
#up-result { max-width: 640px; }

/* ---------- 统计 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
.filter-bar select { width: auto; min-width: 140px; }
.day-table td { padding-top: 5px; padding-bottom: 5px; }
.bar-cell { width: 40%; vertical-align: middle !important; }
.bar-cell .progress { min-width: 60px; }

/* ---------- 账号 ---------- */
.kv th { width: 120px; background: transparent; }
.kv th, .kv td { border-bottom: 1px solid var(--line); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.totp-qr { display: block; margin: 10px 0 6px; }
.secret { font-size: 14px; letter-spacing: 1px; }
.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-size: 14px !important; }

/* ---------- 登录等单独页面 ---------- */
.console-auth .auth-box { margin-top: 8vh; }
.auth-box.auth-wide { max-width: 760px; }
.auth-brand { text-align: center; margin-bottom: 8px; font-size: 13px; }
.error-msg { font-size: 15px; }
.terms-scroll { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 16px; background: #fafbfc; }
.terms-text h2 { font-size: 15px; margin: 16px 0 6px; }
.terms-text ul { padding-left: 20px; }

/* ---------- 帮助 ---------- */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.card ul, .card ol { padding-left: 20px; }
.card li { margin-bottom: 4px; }

/* ---------- 操作记录 ---------- */
.row-imp td { background: #fffaf0; }

/* ---------- 确认对话框（data-confirm） ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 10px; padding: 22px 24px 18px; max-width: 440px; width: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.modal-text { white-space: pre-wrap; margin-bottom: 18px; line-height: 1.7; }
.modal-actions { justify-content: flex-end; }

/* 只读时写操作的按钮置灰：停服（data-readonly=1）还能改密码、验证码、退出；代登录（all）只能退出 */
body[data-readonly="1"] form[method="post"]:not([data-allow-readonly]) button,
body[data-readonly="all"] form[method="post"]:not(.logout-form) button,
body:not([data-readonly="0"]) #uploader button,
body:not([data-readonly="0"]) [data-cancel-upload],
body:not([data-readonly="0"]) [data-resume] { opacity: .5; cursor: not-allowed; pointer-events: none; }
