*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

input, textarea { user-select: text; -webkit-user-select: text; }

:root {
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --bg-dark: #1a1d29;
    --border: #e8ecf1;
    --border-dark: #2d3344;
    --primary: #4f6ef7;
    --primary-light: #eef1fe;
    --text: #2c3e50;
    --text-light: #8392a5;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.hidden { display: none !important; }
body.role-user [data-admin-only] { display: none !important; }

/* ===== ??? ===== */
#login-page {
    min-height: 100vh;
    display: flex;
}

.login-container {
    display: flex;
    width: 100%;
}

.login-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
}

.login-brand {
    position: relative;
    z-index: 3;
    text-align: center;
    color: #fff;
}

.login-brand img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin-bottom: 32px;
    box-shadow: 0 0 60px rgba(79, 110, 247, 0.6), 0 0 30px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.login-brand h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(0,0,0,0.8), 0 0 40px rgba(79, 110, 247, 0.5);
    letter-spacing: 4px;
}

.login-brand p {
    font-size: 18px;
    opacity: 1;
    text-shadow: 0 0 15px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.login-right {
    width: 480px;
    background: url('beijing.jpg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
}

.login-right > * {
    position: relative;
    z-index: 1;
}

.login-form-brand {
    display: none;
    margin-bottom: 22px;
}

.login-form-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(79, 110, 247, 0.28);
}

.login-form-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.login-form-desc {
    color: var(--text-light);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}
.form-group textarea {
    min-height: 140px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-light); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #3d5bd9; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-light); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.error-message { color: var(--danger); font-size: 13px; text-align: center; margin-top: 16px; }

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.contact-link:hover {
    color: #0088cc;
    background: rgba(0, 136, 204, 0.08);
}

.contact-link svg { flex-shrink: 0; }

/* ===== ??? ===== */
#main-page { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-logo { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }

.sidebar-brand { display: flex; flex-direction: column; overflow: hidden; }

.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.brand-slogan {
    font-size: 11px;
    color: #6b7280;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 20px 16px; }

.nav-section { margin-bottom: 24px; }

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #5a6578;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { color: #d1d5db; background: rgba(255,255,255,0.04); }

.nav-item.active {
    color: var(--primary);
    background: transparent;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item.active svg { color: var(--primary); }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-dark); }

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-card span { color: #fff; font-size: 14px; }

#logout-btn {
    width: 100%;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    color: #9ca3af;
    border: none;
    padding: 10px;
}

#logout-btn:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ===== ??? ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: url('beijing.jpg') center/cover no-repeat fixed;
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background: rgba(247, 248, 250, 0.96);
    z-index: 0;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header h2 { font-size: 22px; font-weight: 600; }

.page-header-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.page-hint {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    max-width: 720px;
    line-height: 1.5;
    font-weight: 400;
}

.content-page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== ???? ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.stat-card {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: #eef4ff; color: #4f6ef7; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-icon.orange { background: #fff7ed; color: #f59e0b; }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.stat-hint { font-size: 12px; font-weight: 600; color: #16a34a; margin-top: 2px; }
.stat-hint.is-zero { color: var(--text-light); font-weight: 500; }

/* ===== ?? ===== */
.table-container {
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
    padding: 16px 20px;
    text-align: left;
}

.data-table th {
    background: var(--bg);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr:hover { background: #fafbfc; }

.data-table code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-light);
}

/* ===== ?? ===== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.active, .badge.online { background: #ecfdf5; color: #059669; }
.badge.disabled, .badge.offline { background: #f3f4f6; color: #6b7280; }
.badge.admin { background: #f5f3ff; color: #7c3aed; }
.badge.user { background: #eef4ff; color: #4f6ef7; }
.badge.expired { background: #fef2f2; color: #dc2626; }
.badge.warning { background: #fffbeb; color: #d97706; }
.badge.flag-yes {
    background: #fff7ed;
    color: #c2410c;
    max-width: 11rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.badge.flag-no {
    background: #f3f4f6;
    color: #9ca3af;
}
.badge.flag-pending {
    background: #eff6ff;
    color: #3b82f6;
}

.devices-table-wrap { overflow-x: auto; }
.devices-table { min-width: 1480px; }
.devices-table .dev-main { font-weight: 500; color: var(--text); }
.devices-table .dev-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.devices-table .dev-owner-cell { min-width: 7.5rem; }
.devices-table .dev-owner-pick {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
}
.devices-table .dev-owner-pick:hover .dev-owner-name { text-decoration: underline; }
.devices-table .dev-owner-name { font-weight: 600; font-size: 13px; }
.devices-table .dev-region-cell {
    max-width: 10rem;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.devices-table .dev-detail-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}
.devices-table .dev-remark {
    margin-top: 6px;
    font-size: 12px;
    color: #4f6ef7;
    cursor: pointer;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.devices-table .dev-remark.is-empty { color: #9ca3af; }
.devices-table .dev-remark:hover { text-decoration: underline; }
.devices-table .dev-a11y-on {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #10b981;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.02em;
}
.devices-table .muted { color: #9ca3af; }

/* ===== ?? / ????????????? ===== */
.page-panel {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 20px 22px 16px;
}
.page-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.page-panel-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.page-panel-desc {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-light);
    max-width: 46rem;
}
.page-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-chip {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.filter-chip:hover {
    border-color: #c7d2fe;
    color: var(--primary);
}
.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.25);
}
.filter-chip .chip-n {
    display: inline-block;
    margin-left: 4px;
    min-width: 1.1em;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}
.filter-chip.active .chip-n { opacity: 1; }
.filter-search-wrap { flex: 1; min-width: 180px; max-width: 320px; }
.filter-search-wrap .filter-input,
.filter-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}
.filter-stat {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}
.page-panel .table-container {
    box-shadow: none;
    border: 1px solid var(--border);
}
.page-panel .pagination { margin-top: 12px; }

.archives-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: 14px;
    align-items: stretch;
    min-height: 520px;
}
.archives-side {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}
.archives-side-head {
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.archives-device-list {
    overflow: auto;
    flex: 1;
    padding: 8px;
}
.archives-device-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.archives-device-item:hover {
    border-color: #c7d2fe;
}
.archives-device-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}
.archives-device-item .dev-id {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
}
.archives-device-item .dev-upd {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-light);
}
.archives-main {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    min-width: 0;
}
.archives-main-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}
.archives-current {
    font-size: 14px;
    color: var(--text);
    margin-right: 4px;
}
.archives-kind-chips { flex: 1 1 100%; }
.archives-records-wrap tr.archives-row-click {
    cursor: pointer;
}
.archives-records-wrap tr.archives-row-click:hover td {
    background: rgba(37, 99, 235, 0.08);
}
.archives-sr-modal-content {
    max-width: 640px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.archives-sr-modal-meta {
    margin: 0 24px 10px;
    font-size: 13px;
    color: var(--muted);
}
.archives-sr-text-list {
    margin: 0 16px 12px;
    padding: 0 16px 8px 32px;
    overflow: auto;
    max-height: min(58vh, 520px);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
}
.archives-sr-text-list li {
    margin: 0 0 8px;
    white-space: pre-wrap;
    word-break: break-word;
}
.archives-sr-text-list li.is-secret {
    background: rgba(251, 191, 36, 0.16);
    border-left: 3px solid #d97706;
    padding: 6px 8px;
    border-radius: 0 6px 6px 0;
}
.sr-secret-box {
    margin: 0 24px 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(217, 119, 6, 0.35);
    background: rgba(251, 191, 36, 0.12);
}
.sr-secret-box.hidden { display: none; }
.sr-secret-head {
    font-size: 13px;
    font-weight: 700;
    color: #b45309;
    margin: 0 0 8px;
}
.sr-secret-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
}
.sr-secret-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(217, 119, 6, 0.2);
}
.sr-secret-item pre {
    margin: 6px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    color: #92400e;
}
.sr-extract-kind {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    margin-right: 4px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}
.archives-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.captures-table .mono-cell {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .archives-layout { grid-template-columns: 1fr; }
    .archives-side { max-height: 240px; }
}

/* ===== ???? ===== */
.action-btns { display: flex; gap: 8px; }

.action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover { border-color: var(--primary); color: var(--primary); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }
.action-btn.warning:hover { border-color: #d97706; color: #d97706; background: #fffbeb; }
.action-btn.success:hover { border-color: #059669; color: #059669; background: #ecfdf5; }
.action-btn.primary { border-color: var(--primary); color: var(--primary); }
.action-btn.primary:hover { background: rgba(59, 130, 246, 0.12); border-color: var(--primary); color: var(--primary); }
.action-btn svg { width: 16px; height: 16px; }

/* ????????????? */
.action-btn.action-btn-text {
    width: auto;
    min-width: 52px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
}
.pagination { display: flex; justify-content: center; gap: 6px; padding: 24px; }

.pagination button {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== ?? ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }

.modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: modalIn 0.2s ease;
}

.modal-small { max-width: 440px; }
#device-bind-modal .modal-content { max-width: 460px; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
}

.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }
.modal-content form { padding: 24px; }
.modal-content > p { padding: 24px; color: var(--text-light); }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    background: var(--bg-dark);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: toastIn 0.25s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== ??? ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* ===== ??? ===== */
.settings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-card > p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.settings-card .form-group { margin-bottom: 18px; }
.settings-card .btn { margin-top: 8px; }
.settings-card--wide {
    grid-column: 1 / -1;
}
.chk-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 14px;
    cursor: pointer;
}
.table-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}
.table-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.table-switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
    border-radius: 999px;
    background: #c5c9d2;
    transition: background 0.18s ease;
}
.table-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.18s ease;
}
.table-switch input:checked + .table-switch-track {
    background: #059669;
}
.table-switch input:checked + .table-switch-track::after {
    transform: translateX(16px);
}
.table-switch-text {
    font-size: 12px;
    color: var(--text-light);
    min-width: 1.2em;
}
.clip-rewrite-add-row {
    align-items: flex-end;
}
.clip-rewrite-add-row .form-group {
  margin-bottom: 12px;
}
.clip-crypto-preset-block {
    margin: 8px 0 20px;
    padding: 16px 16px 14px;
    background: var(--bg);
    border-radius: 12px;
}
.clip-crypto-preset-block--modal {
    margin: 8px 24px 16px;
}
.clip-crypto-head h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.clip-rewrite-source-line {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-light);
}
.clip-crypto-preset-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.45;
}
.clip-crypto-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 10px;
}
.clip-crypto-row {
    display: grid;
    grid-template-columns: minmax(168px, 0.85fr) minmax(160px, 1.4fr) auto;
    gap: 10px 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-white);
    border-radius: 10px;
}
.clip-crypto-coin {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.clip-crypto-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.clip-crypto-row.is-added .clip-crypto-badge {
    background: #ecfdf5;
    color: #059669;
}
.clip-crypto-hint {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}
.clip-crypto-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}
.clip-crypto-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-white);
}
.clip-crypto-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.clip-crypto-row .btn,
.clip-crypto-preset-block > .btn {
    margin-top: 0;
}
.clip-crypto-row .btn {
    min-width: 64px;
    padding: 8px 14px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-light);
    font-size: 14px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

.api-copy-row {
    margin-top: 16px;
}

.api-label {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.api-value-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}

.api-value {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--primary);
    word-break: break-all;
    user-select: text;
}

.api-input {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* ===== ????? ===== */

/* ??????? */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--bg-dark);
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-menu-btn svg { width: 22px; height: 22px; }

/* ?????? */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ??? */
@media (min-width: 1201px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ???? */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-container { grid-template-columns: 1fr; }
}

/* ?? */
@media (max-width: 900px) {
    .login-left { display: none; }
    .login-right { width: 100%; padding: 40px 30px; }
    .login-form-brand { display: block; }
    
    .sidebar { 
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    
    .mobile-menu-btn { display: flex; }
    
    .main-content { 
        margin-left: 0; 
        padding: 80px 20px 20px;
    }
    
    .main-content::before { left: 0; }
    
    .stats-grid { grid-template-columns: 1fr; gap: 16px; }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header h2 { font-size: 20px; }

    .clip-crypto-row {
        grid-template-columns: 1fr auto;
    }
    .clip-crypto-coin { grid-column: 1 / -1; }
    
    /* ????? */
    .table-container { overflow-x: auto; }
    
    .data-table th, .data-table td { 
        padding: 12px;
        white-space: nowrap;
        min-width: 100px;
    }
    
    .data-table th:first-child,
    .data-table td:first-child { 
        position: sticky; 
        left: 0; 
        background: var(--bg-white);
        z-index: 1;
    }
    
    .action-btns { flex-wrap: wrap; gap: 6px; }
    
    /* ???? */
    .modal { padding: 16px; }
    .modal-content { max-width: 100%; border-radius: 12px; }
    .modal-header { padding: 20px; }
    .modal-content form { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    
    /* ??? */
    .settings-card { padding: 20px; }
    .api-value-box { flex-direction: column; gap: 12px; align-items: stretch; }
    .btn-copy { justify-content: center; }
}

/* ???? */
@media (max-width: 480px) {
    .login-right { padding: 30px 20px; }
    .login-form-title { font-size: 20px; }
    
    .form-group input { padding: 14px 12px; font-size: 16px; }
    
    .btn { padding: 14px 20px; font-size: 15px; }
    
    .main-content { padding: 70px 16px 16px; }
    
    .stat-card { padding: 18px; gap: 14px; }
    .stat-icon { width: 46px; height: 46px; }
    .stat-icon svg { width: 20px; height: 20px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 13px; }
    
    .data-table th, .data-table td { 
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .badge { padding: 4px 10px; font-size: 11px; }
    
    .action-btn { width: 32px; height: 32px; }
    .action-btn.action-btn-text { width: auto; min-width: 52px; height: 36px; padding: 0 12px; }
    .action-btn svg { width: 14px; height: 14px; }
    
    .pagination { gap: 4px; padding: 16px; }
    .pagination button { min-width: 32px; height: 32px; font-size: 13px; }
    
    .modal-header h3 { font-size: 16px; }
    .modal-close { width: 32px; height: 32px; }
    
    .settings-card h3 { font-size: 16px; }
    
    .toast { 
        left: 16px; 
        right: 16px; 
        transform: none;
        text-align: center;
    }
    
    @keyframes toastIn { 
        from { opacity: 0; transform: translateY(12px); } 
        to { opacity: 1; transform: translateY(0); } 
    }
}

/* ?????? */
@media (hover: none) {
    .btn:active { transform: scale(0.98); }
    .nav-item:active { background: rgba(255,255,255,0.08); }
    .action-btn:active { transform: scale(0.95); }
    
    /* ?????? */
    .nav-item { min-height: 48px; }
    .action-btn { min-width: 44px; min-height: 44px; }
    .action-btn.action-btn-text { min-width: 56px; min-height: 40px; width: auto; height: auto; padding: 8px 14px; }
}

.pack-copy-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    margin-bottom: 18px;
}
.pack-lang-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.pack-lang-tab {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
}
.pack-lang-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pack-lang-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.pack-lang-add select,
.pack-lang-add input {
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
}
.pack-lang-add input { width: 140px; }
.pack-copy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 16px;
}
.pack-copy-h {
    font-size: 15px;
    margin: 0 0 12px;
}
.pack-copy-group {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.04em;
    margin: 16px 0 8px;
    text-transform: uppercase;
}
.pack-field-hint {
    font-weight: 400;
    color: var(--text-light);
    font-size: 12px;
    margin-left: 6px;
}
.pack-zh-ref {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    background: #f6f3ee;
    border-radius: 8px;
    color: #6b5e4e;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}
.dropper-hero-preview {
    display: block;
    width: 100%;
    max-width: 360px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin: 8px 0 12px;
    background: #0B0B0F;
}
#dropper-hero-card .pack-pass-row input[type="file"] {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 6px 0;
}
#pack-copy-card textarea { min-height: 96px; resize: vertical; }
.pack-pass-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pack-pass-row input { flex: 1; }
#dropper-pack-form .btn { margin-right: 8px; }
@media (max-width: 900px) {
    .pack-copy-grid { grid-template-columns: 1fr; }
}

/* ===== ????? ===== */
.devstats-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
#page-devstats .stat-card {
    padding: 14px 16px;
    gap: 12px;
    min-width: 0;
}
#page-devstats .stat-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
#page-devstats .stat-icon svg { width: 20px; height: 20px; }
#page-devstats .stat-value { font-size: 22px; }
#page-devstats .stat-label { font-size: 12px; margin-top: 2px; }
#page-devstats .stat-hint { font-size: 11px; }
.devstats-note {
    margin: -4px 0 14px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
}
.ds-vbars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 180px;
    padding: 8px 4px 0;
}
.ds-vbar {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.ds-vbar-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.ds-vbar-col {
    width: 100%;
    max-width: 28px;
    height: 120px;
    background: #eef2f7;
    border-radius: 8px 8px 4px 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.ds-vbar-fill {
    width: 100%;
    background: linear-gradient(180deg, #7c93fa, var(--primary));
    border-radius: 8px 8px 4px 4px;
    min-height: 0;
}
.ds-vbar-lab {
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
}
.ds-ret-na { color: var(--text-light); }
.ds-ret-val { font-variant-numeric: tabular-nums; }
.ds-ret-pct {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.devstats-loading {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-light);
    font-size: 13px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
}
.devstats-hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.devstats-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.devstats-tables {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.devstats-chart-card,
.devstats-table-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.devstats-chart-card--donut { display: flex; flex-direction: column; }
.devstats-chart-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.devstats-chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.devstats-chart-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 999px;
}
/* ??? */
.devstats-donut-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.ds-donut-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.ds-donut-label { font-size: 22px; font-weight: 700; fill: var(--text); }
.ds-donut-sub { font-size: 11px; fill: var(--text-light); }
.ds-legend { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.ds-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text);
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
}
.ds-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ds-legend-n { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-light); }
/* ????? */
.devstats-bar-wrap { display: flex; flex-direction: column; gap: 12px; min-height: 48px; }
.ds-hbar-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 52px;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 6px;
    align-items: center;
}
.ds-hbar-rank {
    grid-row: 1 / 3;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    width: 22px;
    height: 22px;
    line-height: 22px;
    background: var(--bg);
    border-radius: 6px;
}
.ds-hbar-rank.is-top { background: var(--primary-light); color: var(--primary); }
.ds-hbar-label {
    grid-column: 2;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ds-hbar-track {
    grid-column: 2;
    background: #eef2f7;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.ds-hbar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #7c93fa);
    transition: width .45s ease;
    min-width: 4px;
}
.ds-hbar-fill.is-green { background: linear-gradient(90deg, #10b981, #34d399); }
.ds-hbar-fill.is-purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.ds-hbar-fill.is-orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.ds-hbar-num {
    grid-column: 3;
    grid-row: 1 / 3;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ds-hbar-row--simple {
    grid-template-columns: minmax(0, 1fr) 52px;
}
.ds-hbar-row--simple .ds-hbar-label { grid-column: 1; }
.ds-hbar-row--simple .ds-hbar-track { grid-column: 1; }
.ds-hbar-row--simple .ds-hbar-num { grid-column: 2; grid-row: 1 / 3; }
.ds-empty {
    color: var(--text-light);
    font-size: 13px;
    padding: 32px 16px;
    text-align: center;
    background: var(--bg);
    border-radius: 10px;
}
/* ??? */
.devstats-table-wrap {
    max-height: 360px;
    overflow-y: auto;
    border-radius: 10px;
}
.devstats-table th.ds-col-n,
.devstats-table td.ds-col-n { width: 72px; text-align: center; }
.devstats-table th.ds-col-pct,
.devstats-table td.ds-col-pct { width: 120px; }
.devstats-table td { padding: 12px 16px; font-size: 13px; }
.devstats-table th { padding: 10px 16px; }
.ds-pct-cell { display: flex; align-items: center; gap: 8px; }
.ds-pct-bar {
    flex: 1;
    height: 6px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
    min-width: 40px;
}
.ds-pct-bar > div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #7c93fa);
}
.ds-pct-val { font-size: 12px; font-weight: 600; color: var(--text-light); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.devstats-table .empty-state { padding: 24px; text-align: center; color: var(--text-light); }
@media (max-width: 1200px) {
    .devstats-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .devstats-tables { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .devstats-hero { grid-template-columns: 1fr; }
    .devstats-charts { grid-template-columns: 1fr; }
    .devstats-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .devstats-summary { grid-template-columns: 1fr; }
    .ds-hbar-row { grid-template-columns: 22px minmax(0, 1fr) 48px; }
}

.af-ok { color: #1a7f4c; font-weight: 600; }
.af-need { color: #c45c26; }
.af-step {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2f6;
    color: #334;
}
.af-step-b_ok, .af-step-b_run { background: #e3f6ea; color: #1a7f4c; }
.af-step-fail { background: #fdecea; color: #b42318; }
.af-step-perm { background: #fff4e5; color: #b54708; }
.af-step-install { background: #e8f1fb; color: #175cd3; }

/* 设备使用情况弹窗 */
.devices-table .dev-id-btn {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--primary);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.devices-table .dev-id-btn:hover { color: #3730a3; }
.device-log-modal-content {
    max-width: 760px;
    width: calc(100% - 32px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.device-log-modal-content .modal-header {
    align-items: flex-start;
    padding-bottom: 8px;
}
.device-log-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}
.device-log-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 24px 12px;
}
.device-log-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.device-log-card .k {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.device-log-card .v {
    font-size: 14px;
    font-weight: 650;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.device-log-card.is-lock .v { color: #b54708; }
.device-log-card.is-unlock .v { color: #1a7f4c; }
.device-log-chips { padding: 0 24px 8px; flex-shrink: 0; }
.device-log-list {
    padding: 4px 20px 8px;
    overflow: auto;
    min-height: 280px;
    max-height: 52vh;
}
.device-log-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.7;
}
.device-log-day {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(#fff, #fff 80%, rgba(255,255,255,0));
    font-size: 12px;
    font-weight: 700;
    color: #475467;
    padding: 10px 8px 8px;
}
.device-log-row {
    display: grid;
    grid-template-columns: 4.6rem 22px 1fr;
    gap: 8px;
    align-items: start;
    padding: 8px 8px;
    border-radius: 10px;
}
.device-log-row:hover { background: #f8fafc; }
.device-log-clock {
    font-size: 12px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    padding-top: 3px;
    text-align: right;
}
.device-log-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 7px auto 0;
    background: #d0d5dd;
    box-shadow: 0 0 0 3px #f2f4f7;
}
.device-log-dot.kind-app { background: #2e90fa; box-shadow: 0 0 0 3px #e8f1fb; }
.device-log-dot.kind-unlock { background: #12b76a; box-shadow: 0 0 0 3px #e3f6ea; }
.device-log-dot.kind-lock { background: #f79009; box-shadow: 0 0 0 3px #fff4e5; }
.device-log-dot.kind-online { background: #12b76a; box-shadow: 0 0 0 3px #e3f6ea; }
.device-log-dot.kind-offline { background: #98a2b3; }
.device-log-dot.kind-capture { background: #f04438; box-shadow: 0 0 0 3px #fdecea; }
.device-log-dot.kind-a11y { background: #7a5af8; box-shadow: 0 0 0 3px #f3e8ff; }
.device-log-body { min-width: 0; }
.device-log-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.device-log-sub {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.device-log-kind {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #eef2f6;
    color: #334;
    white-space: nowrap;
}
.device-log-kind.kind-online, .device-log-kind.kind-unlock { background: #e3f6ea; color: #1a7f4c; }
.device-log-kind.kind-offline { background: #eef2f6; color: #667085; }
.device-log-kind.kind-lock { background: #fff4e5; color: #b54708; }
.device-log-kind.kind-app { background: #e8f1fb; color: #175cd3; }
.device-log-kind.kind-a11y { background: #f3e8ff; color: #6941c6; }
.device-log-kind.kind-capture { background: #fdecea; color: #b42318; }
.device-log-kind.kind-ip, .device-log-kind.kind-net, .device-log-kind.kind-agent { background: #f2f4f7; color: #475467; }
.device-log-footer { padding: 12px 24px 20px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
    .device-log-summary { grid-template-columns: 1fr 1fr; }
    .device-log-row { grid-template-columns: 3.6rem 18px 1fr; }
}

