* { box-sizing: border-box; }
body {
    margin: 0; background: #f6f8fb; color: #0b1a2b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    font-size: 14px;
}
a { color: inherit; }
.top {
    background: #fff; border-bottom: 1px solid #e9edf2; padding: 0 20px; height: 56px;
    display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-logo { height: 28px; width: auto; display: block; }
.ch-nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; }
.ch-nav a { padding: 7px 12px; border-radius: 8px; font-size: 13.5px; color: #64748b; text-decoration: none; white-space: nowrap; }
.ch-nav a:hover { background: #f8fafc; color: #0b1a2b; }
.ch-nav a.active { background: #eff6ff; color: #2563eb; }
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
    border-radius: 8px; background: #ef4444; color: #fff;
    font-size: 10.5px; font-weight: 700; line-height: 1;
}
.nav-badge.zero { background: #e2e8f0; color: #94a3b8; }
.top-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.top-phone { font-size: 13px; color: #475569; white-space: nowrap; }
.logout { color: #64748b; text-decoration: none; font-size: 13px; margin-left: 10px; }
.logout:hover { color: #dc2626; }
.wrap { max-width: 1400px; margin: 20px auto 60px; padding: 0 16px; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 1100px; }

.msg, .err { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.msg { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.card { background: #fff; border: 1px solid #e9edf2; border-radius: 12px; padding: 18px 20px 20px; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin: 0 0 14px; font-weight: 700; }
.hint { font-size: 12px; color: #94a3b8; margin-top: 8px; line-height: 1.7; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.title-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2563eb; margin-right: 8px; vertical-align: 1px; }
.muted { color: #94a3b8; }
.intro-text { font-size: 14px; line-height: 1.8; color: #475569; margin: 0; word-break: break-word; }
.rate-pill { display: inline-block; padding: 1px 10px; border-radius: 20px; background: #2563eb; color: #fff; font-size: 13px; font-weight: 700; }
.notice-bar { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid #e9edf2; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; line-height: 1.7; color: #475569; }
.notice-bar .notice-ico { font-weight: 700; flex-shrink: 0; }
.notice-bar .notice-title { font-weight: 700; margin-right: 4px; }
.notice-red .notice-ico, .notice-red .notice-title { color: #dc2626; }
.notice-green .notice-ico, .notice-green .notice-title { color: #16a34a; }
.notice-yellow .notice-ico, .notice-yellow .notice-title { color: #d97706; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-2 > .card { margin-bottom: 0; }
.link-label { font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 8px; }
.invite-input { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-input input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; background: #f8fafc; color: #0b1a2b; outline: none; }
.invite-input input:focus { border-color: #2563eb; }
.stat-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stat { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 12px 14px; }
.mini-stat .label { font-size: 12px; color: #94a3b8; }
.mini-stat .value { font-size: 19px; font-weight: 700; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
th { color: #64748b; font-weight: 600; background: #f8fafc; }

.btn {
    display: inline-block; padding: 8px 18px; border: 1px solid #2563eb; border-radius: 8px;
    background: #2563eb; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: inherit; text-decoration: none; text-align: center;
}
.btn:hover { background: #1d4ed8; }
.btn-ghost {
    display: inline-block; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 7px;
    background: #fff; color: #475569; font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn-ghost:hover { border-color: #2563eb; color: #2563eb; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.open-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.open-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px;
    background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.open-badge img { width: 16px; height: 16px; object-fit: contain; }
td.num { color: #94a3b8; }
.badge-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-muted { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-box { flex: 1 1 180px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 14px 16px; }
.stat-box .label { font-size: 12px; color: #94a3b8; }
.stat-box .value { font-size: 24px; font-weight: 700; margin-top: 4px; }

.header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.btn-pill-red { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.btn-pill-blue { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.btn-pill-yellow { background: #fef3c7; color: #d97706; border-color: #fde68a; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 2px 2px; }
.pager-info { font-size: 13px; color: #94a3b8; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: 6px; font-size: 13px; text-decoration: none; border: 1px solid #e9edf2; background: #fff; color: #0b1a2b; }
.pager-links a:hover { background: #f1f5f9; border-color: #2563eb; color: #2563eb; }
.pager-links .active { background: #2563eb; border-color: #2563eb; color: #fff; }
.pager-links .disabled { color: #cbd5e1; pointer-events: none; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.detail-item { min-width: 0; }
.detail-item .k { font-size: 12.5px; font-weight: 600; color: #94a3b8; margin-bottom: 3px; }
.detail-item .v { font-size: 14px; color: #0b1a2b; line-height: 1.7; word-break: break-all; }
.detail-item.full { grid-column: 1 / -1; }
.img-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.img-list a { display: block; width: 110px; height: 110px; border: 1px solid #e9edf2; border-radius: 8px; overflow: hidden; background: #f8fafc; }
.img-list a:hover { border-color: #2563eb; }
.img-list img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.72); cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 6px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 16px; outline: none; font-family: inherit; }
.field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-item { min-width: 0; }
.form-item label { display: block; font-size: 12.5px; color: #64748b; margin-bottom: 4px; font-weight: 600; }
.form-item input, .form-item select { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 13px; font-family: inherit; }

.key-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; }
.key-code { flex: 1; min-width: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

.qr-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); padding: 20px; }
.qr-overlay.show { display: flex; }
.qr-card { position: relative; width: 100%; max-width: 320px; background: #fff; border-radius: 14px; padding: 24px 22px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.qr-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 22px; line-height: 1; color: #94a3b8; cursor: pointer; }
.qr-close:hover { color: #0b1a2b; }
.qr-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.qr-box { display: inline-flex; align-items: center; justify-content: center; min-width: 186px; min-height: 186px; }
.qr-box img, .qr-box canvas { display: block; max-width: 100%; height: auto; }
.qr-desc { font-size: 12px; color: #94a3b8; line-height: 1.7; margin-top: 12px; }

.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f6f8fb; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid #e9edf2; border-radius: 14px; padding: 28px 26px; box-shadow: 0 8px 30px rgba(11,26,43,.06); }
.auth-title { font-size: 21px; font-weight: 700; margin: 0 0 6px; }
.auth-sub { font-size: 13px; color: #94a3b8; margin: 0 0 20px; }
.auth-foot { margin-top: 14px; text-align: center; font-size: 13px; color: #64748b; }
.auth-foot a { color: #2563eb; text-decoration: none; }

@media (max-width: 700px) {
    .wrap { padding: 0 10px; }
    .card { padding: 14px; }
    .top { padding: 0 12px; gap: 8px; }
    .brand { font-size: 14px; }
    .brand-logo { height: 24px; }
    .ch-nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
    .ch-nav a { padding: 6px 8px; font-size: 12.5px; }
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; gap: 12px; }
    .grid-2, .stat-grid-2 { grid-template-columns: 1fr; }
    .grid-2 { gap: 10px; }
    .pager { justify-content: center; }
}

@media (max-width: 480px) {
    .top-phone { display: none; }
    .top-avatar { width: 26px; height: 26px; font-size: 12px; }
    .logout { margin-left: 6px; }
}
