:root {
    --bg-root: #08090b;
    --bg-header: #111317;
    --bg-main: #202228;
    --bg-panel: #090b10;
    --bg-card: #101419;
    --bg-input: #05070a;
    --line-soft: #2b2f36;
    --line-mid: #3b4048;
    --text-main: #f4f7fb;
    --text-muted: #a9b0be;
    --text-dim: #838a98;
    --accent-red: #63e05c;
    --accent-red-strong: #7af56f;
    --accent-red-soft: rgba(99, 224, 92, 0.34);
    --warn: #f8cf79;
    --ok: #74da95;
    --shell-pad: clamp(6px, 0.55vw, 8px);
    --shell-gap: clamp(6px, 0.55vw, 8px);
    --header-height: clamp(74px, 10.5vh, 94px);
    --header-pad-x: clamp(12px, 1.25vw, 20px);
    --brand-width: clamp(152px, 14.8vw, 190px);
    --icon-btn-size: clamp(32px, 2.5vw, 36px);
    --sidebar-width: clamp(304px, 27vw, 364px);
    --workspace-head-y: clamp(12px, 1.2vw, 16px);
    --workspace-head-x: clamp(16px, 1.8vw, 24px);
    --h1-size: clamp(32px, 2.6vw, 52px);
    --page-title-size: clamp(24px, 1.9vw, 28px);
    --device-card-width: clamp(220px, 20.5vw, 270px);
    --device-card-min-h: clamp(234px, 27vh, 280px);
    --device-card-img: clamp(116px, 10.8vw, 140px);
    --field-label-size: clamp(16px, 1.15vw, 18px);
    --perf-left-col: clamp(220px, 21vw, 280px);
    --perf-min-h: clamp(420px, 54vh, 500px);
    --sidebar-title-size: clamp(26px, 2.1vw, 34px);
    --sidebar-model-size: clamp(18px, 1.45vw, 21px);
    --tool-btn-size: clamp(56px, 4.5vw, 64px);
    --settings-title-size: clamp(28px, 2.15vw, 34px);
    --led-rgb: 99, 224, 92;
    --led-alpha: 0.42;
    --led-period-ms: 500ms;
    --led-cycle-ms: 1500ms;
    --led-breath-gap-ms: 1000ms;
    --fx-strength: 0.64;
    --fx-cyan: #46c9ff;
    --fx-green: #63e05c;
    --fx-amber: #ffc85a;
    --fx-blue: #4d7dff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    color: var(--text-main);
    background: #050608;
    font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

body {
    overflow: hidden;
}

body[data-fx-level="low"] {
    --fx-strength: 0.38;
}

body[data-fx-level="medium"] {
    --fx-strength: 0.64;
}

body[data-fx-level="high"] {
    --fx-strength: 0.92;
}

@keyframes fx-pan-slow {
    0% { transform: translate3d(-1.2%, -1%, 0) scale(1); }
    50% { transform: translate3d(1.4%, 1.1%, 0) scale(1.02); }
    100% { transform: translate3d(-1.2%, -1%, 0) scale(1); }
}

@keyframes fx-grid-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(18px); }
}

button,
input,
select,
textarea {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-rows: var(--header-height) minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    padding: var(--shell-pad);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    gap: var(--shell-gap);
    background: var(--bg-root);
}

.app-shell > * {
    position: relative;
    z-index: 2;
}

.app-shell::before {
    content: "";
    position: absolute;
    inset: -12%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(52% 42% at 14% 24%, rgba(70, 201, 255, calc(0.12 * var(--fx-strength))) 0%, rgba(70, 201, 255, 0) 70%),
        radial-gradient(46% 38% at 82% 80%, rgba(99, 224, 92, calc(0.11 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 72%);
    animation: fx-pan-slow 18s ease-in-out infinite;
}

.app-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: calc(0.12 * var(--fx-strength));
    background-image: linear-gradient(to bottom, rgba(140, 188, 255, 0.1) 1px, transparent 1px);
    background-size: 100% 4px;
    mix-blend-mode: screen;
    animation: fx-grid-drift 7s linear infinite;
}

body[data-current-page="devices"] .app-shell::before {
    background:
        radial-gradient(56% 46% at 15% 30%, rgba(99, 224, 92, calc(0.14 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 72%),
        radial-gradient(48% 38% at 78% 78%, rgba(70, 201, 255, calc(0.13 * var(--fx-strength))) 0%, rgba(70, 201, 255, 0) 70%);
}

body[data-current-page="performance"] .app-shell::before {
    background:
        radial-gradient(58% 44% at 18% 66%, rgba(77, 125, 255, calc(0.12 * var(--fx-strength))) 0%, rgba(77, 125, 255, 0) 72%),
        radial-gradient(44% 36% at 78% 26%, rgba(99, 224, 92, calc(0.16 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 72%);
}

body[data-current-page="keyassignment"] .app-shell::before {
    background:
        radial-gradient(56% 42% at 62% 32%, rgba(99, 224, 92, calc(0.15 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 70%),
        radial-gradient(44% 34% at 26% 72%, rgba(70, 201, 255, calc(0.12 * var(--fx-strength))) 0%, rgba(70, 201, 255, 0) 70%);
}

body[data-current-page="lighting"] .app-shell::before {
    background:
        radial-gradient(56% 42% at 34% 62%, rgba(255, 200, 90, calc(0.13 * var(--fx-strength))) 0%, rgba(255, 200, 90, 0) 72%),
        radial-gradient(45% 35% at 74% 22%, rgba(99, 224, 92, calc(0.15 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 70%);
}

.top-header {
    border: 1px solid #20232a;
    border-radius: 8px;
    background: linear-gradient(180deg, #111318, #0e1014);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--header-pad-x);
}

.brand-wrap {
    display: flex;
    align-items: center;
}

.brand-logo {
    width: var(--brand-width);
    height: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header .header-actions .icon-btn {
    width: calc(var(--icon-btn-size) * 1.3);
    height: calc(var(--icon-btn-size) * 1.3);
}

.icon-btn {
    width: var(--icon-btn-size);
    height: var(--icon-btn-size);
    position: relative;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: pointer;
    transition: color 140ms ease;
}

.notification-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 4px;
    background: #d94141;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 1px rgba(12, 16, 24, 0.95);
}

@keyframes notification-badge-pulse {
    0% { transform: scale(0.86); filter: brightness(1); }
    30% { transform: scale(1.2); filter: brightness(1.25); }
    100% { transform: scale(1); filter: brightness(1); }
}

#refreshDashboard.has-unread .notification-badge {
    animation: notification-badge-pulse 900ms ease-in-out infinite;
}

.icon-btn:hover {
    border-color: transparent;
    background: transparent;
}

button.icon-btn:hover:not(:disabled) {
    border-color: transparent;
    background: transparent;
    filter: none;
    box-shadow: none;
}

.icon-btn:focus-visible {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

.header-icon {
    width: 26px;
    height: 26px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.85;
    transition: opacity 140ms ease, filter 140ms ease, background-image 140ms ease;
}

.bell-icon {
    background-image: url("assets/images/dexin/bell_gray.png");
}

.gear-icon {
    background-image: url("assets/images/dexin/gear_gray.png");
}

.user-icon {
    background-image: url("assets/images/dexin/user_gray.png");
}

.icon-btn:hover .header-icon {
    opacity: 1;
    filter: brightness(1.06);
}

#refreshDashboard:hover .bell-icon,
#refreshDashboard.has-unread .bell-icon {
    background-image: url("assets/images/dexin/bell_white.png");
    opacity: 1;
    filter: brightness(1.1);
}

#openSettings:hover .gear-icon {
    background-image: url("assets/images/dexin/gear_white.png");
    opacity: 1;
    filter: brightness(1.08);
}

.account-icon-btn[data-signed-in="true"] .user-icon,
.account-icon-btn:hover .user-icon {
    background-image: url("assets/images/dexin/user_white.png");
    opacity: 1;
    filter: brightness(1.08);
}

.main-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    gap: var(--shell-gap);
}

.workspace {
    min-height: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--bg-main);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.workspace-head {
    padding: var(--workspace-head-y) var(--workspace-head-x) clamp(6px, 0.7vw, 8px);
}

h1 {
    margin: 0;
    font-size: var(--h1-size);
    font-weight: 560;
    letter-spacing: 0.01em;
}

#pageTitle.keyassignment-title-compact {
    font-size: calc(var(--h1-size) * 0.8);
}

.page-stack {
    min-height: 0;
    padding: clamp(6px, 0.8vw, 8px) clamp(10px, 1vw, 14px) clamp(10px, 1vw, 14px);
    overflow: auto;
    position: relative;
}

.page-stack::-webkit-scrollbar {
    width: 9px;
}

.page-stack::-webkit-scrollbar-thumb {
    background: #3a404a;
    border-radius: 999px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page.page-leave {
    display: block;
    animation: pageFadeSlideOut 133ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
    pointer-events: none;
}

.page.page-enter {
    animation: pageFadeSlideIn 154ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.stagger-reveal {
    animation: staggerReveal 154ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
    animation-delay: var(--stagger-delay, 0ms);
}

.page-title {
    font-size: var(--page-title-size);
    font-weight: 560;
    margin: 0 0 12px 2px;
}

.device-list-zone {
    min-height: calc(100vh - 280px);
    border: 1px solid #272c35;
    border-radius: 8px;
    background: #24272e;
    padding: 16px;
}

.device-card {
    width: var(--device-card-width);
    min-height: var(--device-card-min-h);
    border: 2px solid var(--accent-red);
    border-radius: 12px;
    background: #0b0f15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px;
    transition: box-shadow 260ms ease, transform 260ms ease;
}

.device-card:hover {
    box-shadow: 0 0 24px rgba(99, 224, 92, 0.24), 0 10px 20px rgba(0, 0, 0, 0.28);
    transform: translateY(-2px);
}

.device-card-img {
    width: var(--device-card-img);
    height: var(--device-card-img);
    object-fit: contain;
}

.device-card h3 {
    margin: 0;
    font-size: clamp(18px, 1.15vw, 20px);
    font-weight: 560;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
}

.power-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #363d49;
    background: #06090f;
    color: #f4f7fb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-align: center;
}

.power-btn-glyph {
    display: block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
    text-align: center;
    transform: translateY(-0.5px);
}

.power-btn:hover {
    border-color: var(--accent-red);
}

.device-card-status {
    font-size: 12px;
    color: var(--text-muted);
}

.card-panel {
    border: 1px solid #252a33;
    border-radius: 10px;
    background: var(--bg-card);
    padding: 14px;
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.page.active .card-panel:hover {
    border-color: #36404c;
    box-shadow: 0 0 0 1px rgba(103, 172, 255, 0.16), 0 12px 28px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

.perf-layout {
    display: grid;
    grid-template-columns: var(--perf-left-col) minmax(0, 1fr);
    gap: 14px;
    min-height: var(--perf-min-h);
}

.perf-mouse-wrap {
    border: 1px solid #262b34;
    border-radius: 10px;
    background: #0c0f14;
    display: grid;
    place-items: center;
}

.mouse-preview-host {
    position: relative;
    display: inline-grid;
    place-items: center;
    isolation: isolate;
}

.mouse-preview-host > img {
    position: relative;
    z-index: 2;
    display: block;
}

.mouse-led-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    transition: opacity 140ms ease;
}

.mouse-led-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 8.1% 9.3% at 50.3% 18.0%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 1.05)) 0%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.92)) 38%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.34)) 62%,
            rgba(var(--led-rgb), 0) 84%),
        radial-gradient(ellipse 13.4% 14.7% at 50.3% 19.5%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.54)) 0%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.24)) 58%,
            rgba(var(--led-rgb), 0) 90%),
        radial-gradient(ellipse 19.6% 21.4% at 50.3% 21.9%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.18)) 0%,
            rgba(var(--led-rgb), calc(var(--led-alpha) * 0.08)) 52%,
            rgba(var(--led-rgb), 0) 100%);
    filter: blur(0.5px);
}

body[data-led-effect="off"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 0;
    animation: none;
}

body[data-led-effect="static"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: none;
}

body[data-led-effect="blink-soft"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-blink-soft var(--led-cycle-ms) linear infinite;
}

body[data-led-effect="breath-mono"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-breathe-mono var(--led-cycle-ms) ease-in-out infinite;
}

body[data-led-effect="rgb-wave"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-rgb-wave var(--led-cycle-ms) linear infinite;
}

body[data-led-effect="reactive"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-reactive var(--led-cycle-ms) linear infinite;
}

body[data-led-effect="rainbow-smooth"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-rainbow-smooth var(--led-cycle-ms) linear infinite;
}

body[data-led-effect="pulse"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-pulse var(--led-cycle-ms) ease-in-out infinite;
}

body[data-led-effect="rgb-jump"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation: led-rgb-jump var(--led-cycle-ms) steps(1, end) infinite;
}

body[data-led-effect="rainbow-breath"] .page[data-page="lighting"].active .lighting-preview-wrap .mouse-led-overlay {
    opacity: 1;
    animation:
        led-rainbow7-jump var(--led-cycle-ms) steps(1, end) infinite,
        led-rainbow-breath-blink var(--led-breath-gap-ms) steps(1, end) infinite;
}

@keyframes led-blink-soft {
    0% { opacity: 0.1; transform: scale(0.996); }
    22% { opacity: 1; transform: scale(1); }
    50% { opacity: 1; transform: scale(1); }
    72% { opacity: 0.08; transform: scale(0.994); }
    100% { opacity: 0.08; transform: scale(0.994); }
}

@keyframes led-breathe-mono {
    0% { opacity: 0.08; transform: scale(0.994); }
    35% { opacity: 1; transform: scale(1); }
    60% { opacity: 1; transform: scale(1); }
    85% { opacity: 0.08; transform: scale(0.994); }
    100% { opacity: 0.08; transform: scale(0.994); }
}

@keyframes led-reactive {
    0% { opacity: 0.12; transform: scale(0.994); }
    6% { opacity: 1; transform: scale(1); }
    14% { opacity: 0.1; transform: scale(0.992); }
    100% { opacity: 0.1; transform: scale(0.992); }
}

@keyframes led-rgb-wave {
    0% { filter: hue-rotate(0deg) saturate(1.18) blur(0.55px); opacity: 0.96; }
    33.33% { filter: hue-rotate(120deg) saturate(1.18) blur(0.55px); opacity: 0.96; }
    66.66% { filter: hue-rotate(240deg) saturate(1.18) blur(0.55px); opacity: 0.96; }
    100% { filter: hue-rotate(360deg) saturate(1.18) blur(0.55px); opacity: 0.96; }
}

@keyframes led-rainbow-smooth {
    from { filter: hue-rotate(0deg) saturate(1.24) blur(0.55px); }
    to { filter: hue-rotate(360deg) saturate(1.24) blur(0.55px); }
}

@keyframes led-pulse {
    0%, 100% { opacity: 0.08; transform: scale(0.994); }
    50% { opacity: 1; transform: scale(1); }
}

@keyframes led-rgb-jump {
    0%, 33% { filter: hue-rotate(0deg) saturate(1.2) blur(0.55px); opacity: 0.96; }
    34%, 66% { filter: hue-rotate(120deg) saturate(1.2) blur(0.55px); opacity: 0.96; }
    67%, 100% { filter: hue-rotate(240deg) saturate(1.2) blur(0.55px); opacity: 0.96; }
}

@keyframes led-rainbow7-jump {
    0%, 14.28% { filter: hue-rotate(0deg) saturate(1.22) blur(0.55px); }
    14.29%, 28.56% { filter: hue-rotate(30deg) saturate(1.22) blur(0.55px); }
    28.57%, 42.84% { filter: hue-rotate(60deg) saturate(1.22) blur(0.55px); }
    42.85%, 57.12% { filter: hue-rotate(120deg) saturate(1.22) blur(0.55px); }
    57.13%, 71.40% { filter: hue-rotate(180deg) saturate(1.22) blur(0.55px); }
    71.41%, 85.68% { filter: hue-rotate(240deg) saturate(1.22) blur(0.55px); }
    85.69%, 100% { filter: hue-rotate(275deg) saturate(1.22) blur(0.55px); }
}

@keyframes led-rainbow-breath-blink {
    0%, 49.99% { opacity: 0.96; transform: scale(1); }
    50%, 100% { opacity: 0.08; transform: scale(0.994); }
}

.perf-mouse-img {
    width: clamp(180px, 15.8vw, 220px);
    height: auto;
    object-fit: contain;
}

.field-group {
    margin-bottom: 12px;
}

.field-group:last-child {
    margin-bottom: 0;
}

.field-group label {
    display: block;
    margin-bottom: 6px;
    color: #f2f6fd;
    font-size: var(--field-label-size);
    font-weight: 520;
}

.field-note {
    margin-top: 6px;
    color: var(--text-dim);
    font-size: 12px;
}

.row-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.value-pill {
    min-width: 52px;
    min-height: 32px;
    border: 1px solid #4f5560;
    border-radius: 6px;
    background: #11161f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f1f6ff;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-red);
}

.polling-slider-wrap {
    position: relative;
    padding: 4px 18px 0;
}

.dpi-slider-wrap {
    position: relative;
    padding: 4px 18px 0;
}

#pollingRateSlider,
#dpiSlider {
    width: 100%;
    margin: 0;
    height: 30px;
    accent-color: initial;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 3;
    display: block;
}

#pollingRateSlider::-webkit-slider-runnable-track,
#dpiSlider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    border: none;
    background: transparent;
}

#pollingRateSlider::-moz-range-track,
#dpiSlider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    border: none;
    background: transparent;
}

#pollingRateSlider::-webkit-slider-thumb,
#dpiSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -11px;
    border-radius: 50%;
    border: 5px solid var(--accent-red);
    background: #f4f8ff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.52);
}

#pollingRateSlider::-moz-range-thumb,
#dpiSlider::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 5px solid var(--accent-red);
    background: #f4f8ff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.52);
}

.polling-markers {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 15px;
    pointer-events: none;
    z-index: 2;
}

.polling-markers::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    border-radius: 999px;
    border: 1px solid #242a31;
    background: #080b10;
    transform: translateY(-50%);
    z-index: 0;
}

.dpi-markers {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 15px;
    pointer-events: none;
    z-index: 2;
}

.dpi-markers::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    border-radius: 999px;
    border: 1px solid #242a31;
    background: #080b10;
    transform: translateY(-50%);
    z-index: 0;
}

.polling-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #1f252d;
    background: #0c1015;
    box-shadow: inset 0 0 0 2px #06080b;
    z-index: 1;
}

.dpi-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #1f252d;
    background: #0c1015;
    box-shadow: inset 0 0 0 2px #06080b;
    z-index: 1;
}

.polling-labels {
    margin-top: 8px;
    position: relative;
    height: 20px;
    padding: 0 18px;
    box-sizing: border-box;
}

.dpi-labels {
    margin-top: 8px;
    position: relative;
    height: 20px;
    padding: 0 18px;
    box-sizing: border-box;
}

.polling-label {
    text-align: center;
    color: #8f97a8;
    font-size: 12px;
    font-weight: 500;
}

.dpi-label {
    text-align: center;
    color: #8f97a8;
    font-size: 12px;
    font-weight: 500;
}

.polling-label.active {
    color: #f4f8ff;
}

.dpi-label.active {
    color: #f4f8ff;
}

select,
input[type="number"],
input[type="text"],
textarea {
    width: 100%;
    min-height: 34px;
    border: 1px solid #414751;
    border-radius: 7px;
    background: var(--bg-input);
    color: #edf2fb;
    padding: 0 10px;
}

input[type="color"] {
    width: 90px;
    height: 34px;
    border: 1px solid #414751;
    border-radius: 7px;
    padding: 2px;
    background: #07090e;
}

button {
    min-height: 34px;
    border: 1px solid #3f454f;
    border-radius: 7px;
    background: linear-gradient(180deg, #171b22, #0f1319);
    color: #f4f7fd;
    padding: 0 13px;
    cursor: pointer;
    transition: border-color 130ms ease, filter 130ms ease;
}

button:hover:not(:disabled) {
    border-color: #616a79;
    filter: brightness(1.08);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.toggle-line {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.toggle-line input[type="checkbox"] {
    margin-left: 2px;
}

.toggle-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.toggle-row-group .toggle-line {
    margin-bottom: 0;
}

.field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.status-line {
    min-height: 18px;
    margin-top: 8px;
    color: var(--warn);
    font-size: 13px;
}

.key-layout {
    display: grid;
    grid-template-columns: 220px minmax(220px, 1fr) minmax(260px, 320px);
    gap: 12px;
    min-height: clamp(430px, 57vh, 520px);
}

.key-left-panel,
.key-right-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.key-button-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-button-item {
    width: 100%;
    border: 1px solid #303540;
    border-radius: 6px;
    background: #05080d;
    color: #eef2f9;
    text-align: left;
    padding: 8px 10px;
}

.key-button-item.active {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red-soft) inset;
}

.key-center-mouse {
    border: 1px solid #262a33;
    border-radius: 10px;
    background: #0c0f14;
    display: grid;
    place-items: center;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.page[data-page="keyassignment"].active .key-center-mouse::after {
    content: "";
    position: absolute;
    inset: -20% -30%;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 42%, rgba(70, 201, 255, calc(0.16 * var(--fx-strength))) 50%, transparent 58%);
    animation: keySweep 4.2s linear infinite;
    opacity: calc(0.36 * var(--fx-strength));
}

.key-center-preview {
    position: relative;
    display: inline-grid;
    place-items: center;
}

.key-center-img {
    width: auto;
    height: auto;
    max-width: 92%;
    max-height: min(62vh, 560px);
    object-fit: contain;
    display: block;
}

.key-selection-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.key-hotspot {
    position: absolute;
    width: clamp(20px, 1.8vw, 28px);
    height: clamp(20px, 1.8vw, 28px);
    border-radius: 999px;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.key-hotspot:focus-visible {
    outline: none;
}

.key-hotspot.active {
    opacity: 1;
    background: radial-gradient(circle, rgba(122, 245, 111, 0.38) 0 40%, rgba(122, 245, 111, 0.18) 50%, rgba(122, 245, 111, 0.02) 72%, rgba(122, 245, 111, 0) 100%);
    box-shadow: 0 0 24px rgba(99, 224, 92, 0.75);
    animation: keyHotspotPulse 1.45s ease-in-out infinite;
}



.key-hotspot[data-key-id="0"] {
    left: 50.5%;
    top: 19.5%;
}


.key-hotspot[data-key-id="1"] {
    left: 12.8%;
    top: 35.5%;
}

.key-hotspot[data-key-id="2"] {
    left: 12.8%;
    top: 47.5%;
}

.key-hotspot[data-key-id="7"] {
    left: 27.8%;
    top: 19.5%;
}

.key-hotspot[data-key-id="8"] {
    left: 70.5%;
    top: 19.5%;
}

.key-hotspot[data-key-id="7"],
.key-hotspot[data-key-id="8"] {
    width: clamp(34px, 3.4vw, 50px);
    height: clamp(38px, 3.8vw, 56px);
}

@keyframes keyHotspotPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 10px rgba(99, 224, 92, 0.42);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.06);
        box-shadow: 0 0 28px rgba(99, 224, 92, 0.92);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 10px rgba(99, 224, 92, 0.42);
    }
}

.binding-info-grid {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    font-size: 14px;
}

.lighting-layout {
    max-width: none;
}

.lighting-page-grid {
    display: grid;
    grid-template-columns: var(--perf-left-col) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.lighting-preview-wrap {
    border: 1px solid #262b34;
    border-radius: 10px;
    background: #0c0f14;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.page[data-page="lighting"].active .lighting-preview-wrap::after {
    content: "";
    position: absolute;
    inset: -8%;
    pointer-events: none;
    background:
        radial-gradient(30.4% 28.9% at 50.3% 20.2%, rgba(99, 224, 92, calc(0.12 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 72%),
        radial-gradient(22.8% 22.5% at 50.3% 24.8%, rgba(70, 201, 255, calc(0.08 * var(--fx-strength))) 0%, rgba(70, 201, 255, 0) 74%);
    mix-blend-mode: screen;
    opacity: 0.78;
    animation: fx-pan-slow 6s ease-in-out infinite;
}

.lighting-preview-img {
    width: clamp(180px, 15.8vw, 220px);
    height: auto;
    object-fit: contain;
}

.placeholder-panel {
    max-width: 760px;
    min-height: 180px;
    display: grid;
    align-content: start;
}

.placeholder-panel p {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
}

.sidebar-wrap {
    min-height: 0;
    border: 1px solid #1f232b;
    border-radius: 8px;
    background: linear-gradient(180deg, #0b0d12, #090b10);
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.app-version-tag {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 35;
    height: 16px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    line-height: 1;
    color: rgba(200, 208, 220, 0.9);
    letter-spacing: 0.01em;
    padding: 0;
    user-select: text;
    pointer-events: none;
}

.sidebar-panel {
    border: 1px solid #20252d;
    border-radius: 10px;
    background: #07090f;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.sidebar-title {
    font-size: var(--sidebar-title-size);
    font-weight: 620;
    letter-spacing: 0.01em;
}

.sidebar-model-title {
    font-size: clamp(16px, 1.55vw, 21px);
    line-height: 1.2;
    text-align: left;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-glyph {
    display: block;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    color: rgba(244, 247, 251, 0.56);
    transform: translateY(-1px);
    transition: color 140ms ease;
}

.device-list-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
}

.device-list-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.device-list-btn:hover .more-glyph {
    color: #f4f7fb;
}

button.device-list-btn:hover:not(:disabled) {
    border-color: transparent;
    filter: none;
}

.device-list-btn.active {
    background: linear-gradient(180deg, #7af56f, #3daf48);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.device-list-btn.active .more-glyph {
    color: rgba(31, 37, 45, 0.78);
}

.sidebar-mouse-wrap {
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: 138px;
    display: grid;
    place-items: center;
}

.sidebar-mouse-img {
    width: 115px;
    height: auto;
    object-fit: contain;
}

.sidebar-model {
    text-align: center;
    font-size: var(--sidebar-model-size);
    font-weight: 620;
    line-height: 1.2;
}

.sidebar-status-line {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 4px;
    margin-top: 2px;
}

.sidebar-status-item {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.sidebar-status-value {
    font-weight: 600;
}

.sidebar-status-conn-bt {
    color: #4ea7ff;
}

.sidebar-status-conn-usb {
    color: #63e05c;
}

.sidebar-status-conn-24g {
    color: #f1cb59;
}

.sidebar-status-battery-high {
    color: #63e05c;
}

.sidebar-status-battery-medium {
    color: #f1cb59;
}

.sidebar-status-battery-low {
    color: #ff6b6b;
}

.sidebar-status-charge-charging {
    color: #ffad42;
}

.sidebar-status-charge-full {
    color: #63e05c;
}

.sidebar-status-charge-fault {
    color: #ff6b6b;
}

.sidebar-status-left {
    text-align: left;
}

.sidebar-status-center {
    text-align: left;
}

.sidebar-status-right {
    text-align: left;
}

.sidebar-field {
    display: grid;
    gap: 6px;
}

.sidebar-field label {
    font-size: 14px;
    color: #f2f7ff;
}

.sidebar-tools-label {
    font-size: 14px;
    color: #f2f7ff;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.tool-btn {
    width: var(--tool-btn-size);
    height: var(--tool-btn-size);
    border: 0;
    border-radius: 9px;
    background: transparent;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
    outline: none;
}

.tool-btn:hover {
    border: 0;
    box-shadow: none;
}

button.tool-btn:hover:not(:disabled) {
    border-color: transparent;
    filter: none;
    box-shadow: none;
}

.tool-btn img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transform: scale(0.9);
}

.tool-btn.active {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.tool-btn.active img {
    filter: none;
}

.tool-btn:focus-visible {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.62);
    display: grid;
    place-items: center;
    padding: 16px;
}

.settings-modal.hidden {
    display: none;
}

.settings-dialog {
    width: min(1040px, 92vw);
    min-height: min(550px, 88vh);
    border: 1px solid #32363d;
    border-radius: 20px;
    background: linear-gradient(180deg, #272930, #202228);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.52);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.settings-dialog::before {
    content: "";
    position: absolute;
    inset: -30% -10%;
    pointer-events: none;
    background:
        radial-gradient(36% 34% at 24% 24%, rgba(70, 201, 255, calc(0.14 * var(--fx-strength))) 0%, rgba(70, 201, 255, 0) 72%),
        radial-gradient(38% 32% at 76% 82%, rgba(99, 224, 92, calc(0.12 * var(--fx-strength))) 0%, rgba(99, 224, 92, 0) 72%);
    animation: fx-pan-slow 10s ease-in-out infinite;
}

.settings-control-group {
    margin-top: 14px;
    width: min(280px, 100%);
}

.settings-control-group > label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #d7deea;
}

.settings-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    cursor: pointer;
}

.settings-toggle-row > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-red);
}

.settings-control-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #9da7ba;
}

.settings-dialog > * {
    position: relative;
    z-index: 1;
}

.account-dialog {
    width: min(420px, calc(100vw - 48px));
    min-height: 0;
    height: auto;
}

.account-dialog.account-dialog-collapsed {
    width: min(420px, calc(100vw - 48px));
    min-height: 0 !important;
    height: auto;
}

.account-dialog.account-dialog-expanded {
    width: min(640px, calc(100vw - 48px));
    min-height: min(550px, 88vh);
}

.notification-dialog {
    width: min(1020px, calc(100vw - 48px));
    min-height: min(640px, calc(100vh - 48px));
    max-height: min(780px, calc(100vh - 48px));
}

.fw-update-result-dialog {
    width: min(760px, calc(100vw - 48px));
    min-height: 0;
    height: auto;
}

.fw-update-confirm-dialog {
    width: min(640px, calc(100vw - 48px));
    min-height: 0;
    height: auto;
}

.fw-update-confirm-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fw-update-confirm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.fw-update-confirm-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

.fw-update-confirm-row > span {
    color: #b5bfd3;
}

.fw-update-confirm-row > strong {
    color: #f2f7ff;
    line-height: 1.45;
    word-break: break-word;
}

.fw-update-confirm-row-multiline {
    align-items: start;
}

.fw-update-confirm-row-multiline > strong {
    white-space: pre-wrap;
}

.fw-update-confirm-row-hash > strong {
    font-family: "Consolas", "Menlo", monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.fw-update-confirm-apply {
    margin-top: 2px;
}

.fw-update-confirm-actions {
    justify-content: flex-end;
}

.fw-update-confirm-skip {
    margin-right: auto;
}

#fwUpdateConfirmModal {
    z-index: 92;
    background: rgba(0, 0, 0, 0.36);
}

#fwUpdateConfirmModal .settings-dialog {
    width: min(640px, calc(100vw - 48px));
    min-height: 0;
    height: auto;
}

.fw-update-result-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fw-update-result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.fw-update-result-row {
    display: grid;
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

.fw-update-result-row > span {
    color: #b5bfd3;
}

.fw-update-result-row > strong {
    color: #f2f7ff;
    line-height: 1.45;
    word-break: break-word;
}

.fw-update-result-row-multiline {
    align-items: start;
}

.fw-update-result-row-multiline > strong {
    white-space: pre-wrap;
}

.notification-dialog .settings-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.notification-last-message {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #394050;
    border-radius: 8px;
    background: rgba(9, 11, 16, 0.72);
    font-size: 13px;
    line-height: 1.45;
    color: #d8e0ee;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 0;
    flex: 1;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 170, 185, 0.5) rgba(255, 255, 255, 0.06);
}

.notification-last-message a,
.notification-history-message a {
    color: #8fc5ff;
    text-decoration: underline;
}

.notification-last-message p,
.notification-history-message p {
    margin: 0 0 8px;
}

.notification-last-message p:last-child,
.notification-history-message p:last-child {
    margin-bottom: 0;
}

.notification-last-message h1,
.notification-last-message h2,
.notification-last-message h3,
.notification-last-message h4,
.notification-last-message h5,
.notification-last-message h6,
.notification-history-message h1,
.notification-history-message h2,
.notification-history-message h3,
.notification-history-message h4,
.notification-history-message h5,
.notification-history-message h6 {
    margin: 8px 0 6px;
    line-height: 1.35;
    color: #eff4fd;
}

.notification-last-message h1,
.notification-history-message h1 { font-size: 18px; }
.notification-last-message h2,
.notification-history-message h2 { font-size: 16px; }
.notification-last-message h3,
.notification-history-message h3 { font-size: 15px; }
.notification-last-message h4,
.notification-history-message h4,
.notification-last-message h5,
.notification-history-message h5,
.notification-last-message h6,
.notification-history-message h6 { font-size: 14px; }

.notification-last-message code,
.notification-history-message code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

.notification-last-message img,
.notification-history-message img {
    display: block;
    margin-top: 8px;
    max-width: min(360px, 100%);
    border-radius: 8px;
    border: 1px solid #394050;
}

.notification-last-message ul,
.notification-last-message ol,
.notification-history-message ul,
.notification-history-message ol {
    margin: 6px 0 8px 18px;
    padding: 0;
}

.notification-last-message li,
.notification-history-message li {
    margin: 2px 0;
}

.notification-last-message blockquote,
.notification-history-message blockquote {
    margin: 8px 0;
    padding: 6px 10px;
    border-left: 3px solid #4f6f96;
    background: rgba(20, 30, 44, 0.55);
    border-radius: 6px;
    color: #cfd9ea;
}

.notification-last-message hr,
.notification-history-message hr {
    border: 0;
    border-top: 1px solid #3b4556;
    margin: 10px 0;
}

.notification-last-message table,
.notification-history-message table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}

.notification-last-message th,
.notification-last-message td,
.notification-history-message th,
.notification-history-message td {
    border: 1px solid #3c4657;
    padding: 5px 6px;
    vertical-align: top;
}

.notification-last-message th,
.notification-history-message th {
    background: rgba(33, 46, 67, 0.75);
    color: #ecf2fc;
}

.notification-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.45fr);
    gap: 14px;
    align-items: stretch;
    min-height: 0;
    height: min(560px, calc(100vh - 260px));
    max-height: calc(100vh - 260px);
    overflow: hidden;
}

.notification-list-pane,
.notification-detail-pane {
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.notification-history-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    min-height: 0;
    flex: 1;
    overflow: auto;
    display: grid;
    gap: 8px;
    align-content: start;
    grid-auto-rows: max-content;
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 170, 185, 0.5) rgba(255, 255, 255, 0.06);
}

.notification-history-list::-webkit-scrollbar,
.notification-last-message::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.notification-history-list::-webkit-scrollbar-track,
.notification-last-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.notification-history-list::-webkit-scrollbar-thumb,
.notification-last-message::-webkit-scrollbar-thumb {
    background: rgba(160, 170, 185, 0.5);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.notification-history-list::-webkit-scrollbar-thumb:hover,
.notification-last-message::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 190, 205, 0.6);
}

.notification-history-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.notification-history-head .settings-account-title {
    margin: 0;
    margin-right: auto;
}

.notification-history-head .settings-action-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.notification-history-item {
    border: 1px solid #394050;
    border-radius: 8px;
    background: rgba(9, 11, 16, 0.72);
    padding: 9px 11px;
    overflow: hidden;
}

.notification-history-title-item {
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

.notification-history-title-item:hover {
    border-color: #4f5e78;
    background: rgba(20, 28, 39, 0.82);
}

.notification-history-title-item:focus-visible {
    outline: none;
    border-color: #6f86aa;
    box-shadow: 0 0 0 2px rgba(76, 104, 146, 0.35);
}

.notification-history-title-item.selected {
    border-color: #6f86aa;
    background: rgba(30, 42, 59, 0.86);
}

.notification-history-meta {
    font-size: 12px;
    color: #9aa8bf;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-history-title {
    font-size: 13px;
    line-height: 1.4;
    color: #e7edf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-detail-title {
    font-size: var(--settings-notify-size);
    font-weight: 620;
    line-height: 1.15;
    color: #edf3fd;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.notification-detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    font-size: 14px;
    color: #9aa8bf;
    margin-bottom: 8px;
}

.notification-detail-meta .dot {
    opacity: 0.7;
}

.notification-history-message {
    font-size: 13px;
    line-height: 1.45;
    color: #d8e0ee;
    white-space: pre-wrap;
    word-break: break-word;
}

.notification-history-empty {
    border: 1px dashed #394050;
    border-radius: 8px;
    background: rgba(9, 11, 16, 0.4);
    padding: 10px 12px;
    color: #9aa8bf;
    font-size: 13px;
}

@media (max-width: 1080px) {
    .notification-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .notification-dialog {
        width: min(760px, calc(100vw - 24px));
        min-height: min(680px, calc(100vh - 24px));
    }

    .notification-history-list {
        max-height: 220px;
        flex: 0 0 auto;
    }

    .notification-detail-title {
        -webkit-line-clamp: 3;
    }
}

.account-dialog.account-dialog-collapsed .settings-header {
    height: 74px;
    padding: 0 22px;
}

.account-dialog.account-dialog-collapsed .settings-body {
    padding: 18px 22px 22px;
}

.account-dialog.account-dialog-collapsed .settings-account-block {
    width: min(340px, 100%);
    gap: 8px;
}

.account-dialog.account-dialog-collapsed .settings-account-actions {
    margin-top: 2px;
}

.settings-header {
    height: clamp(62px, 8.2vh, 74px);
    border-bottom: 1px solid #353a43;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h2 {
    margin: 0;
    font-size: var(--settings-title-size);
    font-weight: 620;
}

.modal-close {
    border: 0;
    background: transparent;
}

.modal-close img {
    display: block;
}

.modal-close:hover img,
.modal-close:focus-visible img {
    content: url("assets/images/dexin/Closebtn_hovr.png");
}

.settings-tabs {
    display: flex;
    gap: 18px;
    padding: 14px 24px 0;
    border-bottom: 1px solid #3a4049;
}

.settings-tab {
    min-height: 34px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #8f97a8;
    padding: 0 6px;
}

.settings-tab.active {
    color: #ffffff;
    border-bottom-color: var(--accent-red);
}

.settings-account-block {
    width: min(420px, 100%);
    display: grid;
    gap: 10px;
}

.settings-account-title {
    font-size: 18px;
    font-weight: 620;
    color: #ffffff;
}

.settings-account-status {
    font-size: 14px;
    font-weight: 600;
    color: #d7deea;
}

.settings-account-user {
    font-size: 14px;
    color: #9da7ba;
    word-break: break-word;
}

.settings-account-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.settings-account-backup {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #3a4049;
    display: grid;
    gap: 10px;
}

.settings-account-subtitle {
    font-size: 15px;
    font-weight: 620;
    color: #ffffff;
}

.settings-account-select-label {
    font-size: 13px;
    color: #d7deea;
}

.settings-account-radio-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.settings-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #d7deea;
    user-select: none;
}

.settings-radio-option input[type="radio"] {
    margin: 0;
    accent-color: #69e45d;
}

.settings-account-name-group {
    margin-top: 0;
    width: min(360px, 100%);
}

.settings-text-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #414856;
    border-radius: 10px;
    background: #0c0e14;
    color: #f4f7fb;
    font-size: 14px;
    padding: 0 14px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.settings-text-input::placeholder {
    color: #636b7d;
}

.settings-text-input:focus {
    border-color: #69e45d;
    box-shadow: 0 0 0 3px rgba(105, 228, 93, 0.14);
}

.settings-text-input.is-default-value {
    color: #636b7d;
}

.settings-action-btn {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #4c535f;
    border-radius: 8px;
    background: #0c0e14;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.settings-action-btn.secondary {
    background: transparent;
    color: #c8d0de;
}

.settings-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.settings-body {
    padding: 22px 24px;
    min-height: 0;
}

.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.version-lines {
    display: grid;
    gap: 10px;
    font-size: 16px;
}

.settings-version-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.language-switcher {
    width: min(280px, 100%);
}

.lang-dropdown {
    width: 100%;
    min-height: 38px;
    border: 1px solid #4b515b;
    border-radius: 6px;
    background: #020307;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

@keyframes keySweep {
    0% { transform: translateX(-45%) translateY(-8%) rotate(0.5deg); opacity: 0; }
    20% { opacity: 0.36; }
    50% { opacity: 0.42; }
    80% { opacity: 0.2; }
    100% { transform: translateX(42%) translateY(8%) rotate(0.5deg); opacity: 0; }
}

@keyframes pageFadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(3px);
    }
}

@keyframes pageFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes staggerReveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body[data-page-transition="off"] .page.page-leave,
body[data-page-transition="off"] .page.page-enter,
body[data-page-transition="off"] .stagger-reveal {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .app-shell::before,
    .app-shell::after,
    .page[data-page="keyassignment"].active .key-center-mouse::after,
    .page[data-page="lighting"].active .lighting-preview-wrap::after,
    .settings-dialog::before {
        animation: none !important;
    }

    .page.page-leave,
    .page.page-enter,
    .stagger-reveal {
        animation: none !important;
    }

    .page.active .card-panel:hover,
    .device-card:hover {
        transform: none;
    }
}

@media (max-width: 1400px) {
    .main-grid {
        grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    }

    .sidebar-title {
        font-size: 30px;
    }

    .key-layout {
        grid-template-columns: 200px minmax(200px, 1fr) 280px;
    }
}

@media (max-width: 1366px), (max-height: 840px) {
    :root {
        --sidebar-width: clamp(286px, 25vw, 332px);
        --h1-size: clamp(30px, 2.45vw, 44px);
        --page-title-size: clamp(22px, 1.72vw, 26px);
        --device-card-width: clamp(206px, 19vw, 248px);
        --device-card-min-h: clamp(220px, 25vh, 258px);
        --device-card-img: clamp(106px, 9.8vw, 126px);
        --perf-left-col: clamp(190px, 18.5vw, 244px);
        --perf-min-h: clamp(390px, 50vh, 450px);
        --sidebar-title-size: clamp(24px, 1.85vw, 30px);
        --sidebar-model-size: clamp(16px, 1.2vw, 19px);
        --tool-btn-size: clamp(52px, 4vw, 58px);
        --settings-title-size: clamp(24px, 1.9vw, 30px);
        --settings-notify-size: clamp(18px, 1.9vw, 26px);
    }

    .workspace-head {
        padding: 10px 16px 6px;
    }

    .page-stack {
        padding: 6px 10px 10px;
    }

    .device-list-zone {
        min-height: calc(100vh - 240px);
        padding: 12px;
    }

    .card-panel {
        padding: 12px;
    }

    .key-layout {
        grid-template-columns: 180px minmax(180px, 1fr) minmax(220px, 280px);
        min-height: clamp(390px, 52vh, 460px);
    }

    .sidebar-wrap,
    .sidebar-panel {
        padding: 10px;
    }

    .sidebar-mouse-wrap {
        min-height: 122px;
    }

    .sidebar-mouse-img {
        width: clamp(92px, 8.4vw, 108px);
    }

    .settings-dialog {
        width: min(960px, 94vw);
        min-height: min(520px, 90vh);
    }
}

@media (max-width: 1120px) {
    body {
        overflow: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100vh;
        grid-template-rows: var(--header-height) auto;
    }

    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-wrap {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    h1 {
        font-size: 32px;
    }

    .perf-layout {
        grid-template-columns: 1fr;
    }

    .lighting-page-grid {
        grid-template-columns: 1fr;
    }

    .key-layout {
        grid-template-columns: 1fr;
    }

    .key-center-img {
        max-height: 46vh;
    }

    .tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-dialog {
        width: 96vw;
        min-height: 72vh;
    }
}
