* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", system-ui, sans-serif; background: #f5f6fa; color: #23262f; font-size: 14px; }

header { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #fff; border-bottom: 1px solid #e6e8ef; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; color: #6b3fa0; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
.userbar { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.userbar .muted { font-size: 12px; }
.me-name { font-weight: 600; font-size: 14px; padding: 4px 10px; background: #f1f3f7; border-radius: 8px; }
.tab { border: none; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #555; }
.tab.active { background: #f1e9fa; color: #6b3fa0; font-weight: 600; }
.badge { background: #fa5252; color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 6px; display: none; }
/* 来源状态检测 / 全部刷新 进度条 */
.progress-wrap { width: 100%; height: 8px; background: #eee; border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, #8b5cf6, #6b3fa0); transition: width .3s ease; }
/* 权限门控加载态：在 loadMe/applyPermUI 完成前隐藏所有受权限控制的元素，避免未授权菜单闪现
   （[data-admin] 同样要隐藏，否则非管理员刷新时会闪一下「看板」入口） */
body.gate-loading [data-perm],
body.gate-loading [data-admin] { display: none !important; }

/* 数据看板：日期筛选条 + 每日趋势条形图 */
.dash-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.dash-filter input[type=date] { padding: 7px 10px; border: 1px solid #d5d9e2; border-radius: 8px; font-size: 14px; }
.dash-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 0; overflow-x: auto; }
.dash-bar { flex: 1 0 14px; min-width: 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.dash-bar i { display: block; width: 100%; background: linear-gradient(180deg, #8b5cf6, #6b3fa0); border-radius: 4px 4px 0 0; min-height: 2px; }
.dash-bar span { font-size: 10px; color: #8a8fa3; margin-top: 4px; white-space: nowrap; transform: rotate(-60deg); transform-origin: center; }
.dash-legend { font-size: 12px; color: #8a8fa3; margin-top: 26px; }

main { max-width: 1200px; margin: 0 auto; padding: 18px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 10px; }
.searchbar input { flex: 1; padding: 11px 14px; border: 1px solid #d5d9e2; border-radius: 10px; font-size: 15px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
input.small { width: 92px; padding: 7px 10px; border: 1px solid #d5d9e2; border-radius: 8px; }
.chk { display: flex; align-items: center; gap: 4px; color: #555; }

.btn { padding: 9px 16px; border: 1px solid #d5d9e2; background: #fff; border-radius: 9px; cursor: pointer; font-size: 14px; }
.btn:hover { background: #f1f3f9; }
.btn.primary { background: #6b3fa0; border-color: #6b3fa0; color: #fff; }
.btn.primary:hover { background: #5a3390; }
.btn.danger { color: #e03131; border-color: #ffc9c9; }
.btn.mini { padding: 3px 8px; font-size: 12px; border-radius: 6px; }

.card { background: #fff; border: 1px solid #e6e8ef; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; font-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row input { padding: 9px 12px; border: 1px solid #d5d9e2; border-radius: 8px; }
.muted { color: #868e96; font-size: 13px; }
.err { color: #e03131; min-height: 20px; margin-top: 8px; font-size: 13px; }

.sheet-card { background: #fff; border: 1px solid #e6e8ef; border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fafbfe; border-bottom: 1px solid #eef0f6; flex-wrap: wrap; }
.sheet-head .name { font-weight: 700; font-size: 15px; }
.src-tag { background: #e7f5ff; color: #1971c2; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.tbl-wrap { width: 100%; overflow-x: auto; }
.fname-sm { color: #495057; font-size: 12.5px; }
.block-title { padding: 8px 16px 0; font-weight: 600; color: #6b3fa0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 12px; text-align: left; border-bottom: 1px solid #f1f3f8; white-space: nowrap; }
th { background: #fafbfd; color: #666; font-weight: 600; font-size: 12.5px; }
/* 查询表头居中，更整齐美观 */
#results table thead th { text-align: center; }
#results table tbody td:nth-last-child(-n+2) { text-align: center; }
.chg-mini { margin-top: 6px; font-size: 12.5px; color: #e8590c; background: #fff4e6; border: 1px solid #ffe8cc; border-radius: 8px; padding: 6px 10px; }
.tag-proj { background: #e7f5ff; color: #1971c2; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 6px; }
.tag-mon { background: #f3f0ff; color: #6741d9; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 6px; }
tr:hover td { background: #f8f9ff; }
td.price { font-weight: 700; color: #e8590c; }
tr.sold td { color: #adb5bd; }
tr.sold td.price { color: #adb5bd; text-decoration: line-through; }
.tag-sold { background: #f1f3f5; color: #868e96; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tag-on { background: #ebfbee; color: #2b8a3e; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tag-warn { background: #fff3bf; color: #b08900; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tag-gray { background: #f1f3f5; color: #868e96; font-size: 11px; padding: 1px 7px; border-radius: 10px; }

.mon-item, .chg-item { background: #fff; border: 1px solid #e6e8ef; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.chg-item.unread { border-left: 4px solid #fa5252; }
.chg-item .time { color: #868e96; font-size: 12px; font-weight: 400; }
.chg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: #fa5252; display: inline-block; flex: none; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #f1f3f5; color: #495057; white-space: nowrap; }
.chip.f-add { background: #ebfbee; color: #2b8a3e; }
.chip.f-rm { background: #f1f3f5; color: #868e96; }
.chip.f-price { background: #fff4e6; color: #e8590c; }
.chip.f-sold { background: #fff0f0; color: #e03131; }
.chip.f-note { background: #e7f5ff; color: #1971c2; }
.diff-tbl th, .diff-tbl td { padding: 5px 10px; font-size: 12.5px; }
.diff-tbl td.tk { font-weight: 600; color: #364fc7; }
.diff-tbl td.old { color: #868e96; }
.diff-tbl td.new b { color: #e8590c; }
.diff { margin: 4px 0 0 0; }
.diff b { color: #e8590c; }
.arrow { color: #adb5bd; margin: 0 6px; }

.src-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e6e8ef; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; flex-wrap: wrap; }
.src-item .fname { font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: #40c057; } .dot.err { background: #fa5252; } .dot.busy { background: #fab005; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background-color: #f3eafb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ctext x='15' y='55' font-size='40' opacity='0.08'%3E%F0%9F%8D%86%3C/text%3E%3Ctext x='95' y='135' font-size='40' opacity='0.08'%3E%F0%9F%8D%86%3C/text%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.login-card { background: #fff; border: 1px solid #e6e8ef; border-radius: 16px; padding: 36px; width: 360px; box-shadow: 0 8px 30px rgba(107,63,160,.12); text-align: center; }
.brand-mark { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg,#9b6bd0,#6b3fa0); display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 6px 18px rgba(123,78,168,.35); }
.login-card h1 { font-size: 24px; margin-bottom: 18px; color: #6b3fa0; }
.login-card p { margin-bottom: 20px; }
.login-card input { width: 100%; padding: 11px 14px; border: 1px solid #d5d9e2; border-radius: 10px; margin-bottom: 12px; font-size: 15px; text-align: left; }
.login-card .btn.primary { background: #7b4ea8; border-color: #7b4ea8; }
.login-card .btn.primary:hover { background: #6b3fa0; }

#toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #23262f; color: #fff; padding: 10px 22px; border-radius: 10px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 99; }
#toast.show { opacity: .95; }

.status-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.qr-card { display: inline-block; background: #fff; border: 1px solid #e6e8ef; border-radius: 12px; padding: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.04); }

.col-long { display: block; width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; margin-bottom: 10px; }

.select { flex: 1; padding: 11px 14px; border: 1px solid #d5d9e2; border-radius: 10px; font-size: 15px; background: #fff; }
select.small { width: 110px; padding: 7px 10px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; }

/* 邀请 / 会员信息 */
.code-box { font-family: "SFMono-Regular", Consolas, monospace; font-size: 18px; letter-spacing: 3px; background: #f1e9fa; color: #6b3fa0; padding: 4px 12px; border-radius: 8px; border: 1px dashed #b794dd; }
b.warn { color: #e8590c; }
/* 配额角标（找票 / 获取合集 的剩余次数提示） */
.quota-badge { font-size: 12px; color: #2b8a3e; background: #ebfbee; border: 1px solid #b2f2bb; padding: 3px 9px; border-radius: 10px; margin-left: 8px; white-space: nowrap; }
/* 邀请成功通知（醒目提示） */
.invite-notice { background: linear-gradient(90deg,#fff0f6,#fff9db); border: 1px solid #ffd8a8; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.invite-notice.unread { box-shadow: 0 0 0 2px #ffec99 inset; font-weight: 600; }
.login-switch { margin-top: 14px; font-size: 13px; }
.login-switch a { color: #6b3fa0; text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }
.reg-tip { margin-top: 14px; font-size: 12px; text-align: left; line-height: 1.6; }

/* 导航栏状态（会员剩余次数 / 等级 / 到期日） */
.nav-status { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; flex-wrap: wrap; }
.nav-chip { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: #ebfbee; color: #2b8a3e; border: 1px solid #b2f2bb; white-space: nowrap; }
.nav-chip.warn { background: #fff3bf; color: #b08900; border-color: #ffe066; }
.nav-chip.tier-vip { background: #fff0f6; color: #c2255c; border-color: #fcc2d7; }
.nav-chip.tier-svip { background: #f3f0ff; color: #6741d9; border-color: #d0bfff; }

/* 找票结果：来源列可点击（查看该来源的单表图片） */
.src-click { cursor: pointer; text-decoration: underline dotted; }
.src-click:hover { filter: brightness(0.9); }

/* 来源单表图片弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,22,30,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-mask[hidden] { display: none !important; }
.modal-box { background: #fff; border-radius: 14px; width: min(1100px, 96vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #eceef3; }
.modal-body { padding: 14px 16px; overflow: auto; }

/* 合集底部「共 X 张表」 */
.sheet-count { text-align: center; color: #667085; font-size: 14px; padding: 8px 0 4px; }

/* 邀请栏排版：通知区 / 提示 / 信息块之间留白，更有层次感 */
.invite-notices { margin: 4px 0 4px; }
.invite-notices:empty { display: none; }
.invite-notices .invite-notice { margin-bottom: 10px; }
.invite-hint { margin: 14px 0 16px; line-height: 1.7; }
.invite-block { background: #fafbfe; border: 1px solid #eef0f6; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }

/* 邀请奖励标签（VIP 天数） */
.tag-vip { background: #fff0f6; color: #c2255c; font-size: 11px; padding: 1px 7px; border-radius: 10px; }

/* 会员权益对比表 */
.tier-tbl th, .tier-tbl td { white-space: normal; }
.tier-tbl tr.tier-cur { background: #f6f1fc; }
.tier-tbl tr.tier-cur td { font-weight: 500; }

/* 数据看板 */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 12px; }
.dash-card { background: #fafbfe; border: 1px solid #eef0f6; border-radius: 12px; padding: 16px; text-align: center; }
.dash-num { font-size: 30px; font-weight: 700; color: #6b3fa0; line-height: 1.2; }
