@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Josefin+Sans:wght@400;500;600;700&family=Marcellus&family=Outfit:wght@400;500;700;900&display=swap');

:root {
    --bg: #0a0a0a;
    --fg: #33ff00;
    --secondary: #ffb000;
    --muted: #1f521f;
    --border: #1f521f;
    --danger: #ff3333;
    --surface: #0f120f;
    --surface-alt: #121812;
    --text-dim: #79bf73;
    --text-shadow: 0 0 5px rgba(51, 255, 0, 0.5);
    --accent-rgb: 51, 255, 0;
    --font-body: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --font-display: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --focus-shadow: 0 0 0 1px rgba(51, 255, 0, 0.4);
    --button-text-on-accent: #000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    position: relative;
    background: radial-gradient(circle at top, #101810 0%, var(--bg) 45%);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 1.02rem;
    text-shadow: var(--text-shadow);
    line-height: 1.55;
    letter-spacing: 0.02em;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0.02) 1px,
        rgba(0, 0, 0, 0) 3px,
        rgba(0, 0, 0, 0) 5px
    );
    opacity: 0.2;
    z-index: 1000;
}

a {
    color: var(--secondary);
    text-decoration: none;
}

a:hover {
    color: var(--fg);
}

.hidden {
    display: none !important;
}

.app-shell {
    width: min(1200px, 100% - 2rem);
    margin: 1.25rem auto;
}

.app-shell.auth-shell {
    width: min(560px, 100% - 1.5rem);
    margin-top: 8vh;
}

.terminal-header {
    border: 1px solid var(--border);
    background: rgba(10, 10, 10, 0.9);
    padding: 1rem;
    margin-bottom: 1rem;
}

.brand-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.brand-title {
    font-size: clamp(1rem, 2.6vw, 1.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font-display);
}

.typing-demo {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    border-right: 0.5ch solid var(--fg);
    animation: typing 2.2s steps(28, end) 1, blink-caret 1s steps(1, end) infinite;
}

.typing-demo.slow {
    animation-duration: 3s, 1s;
}

.brand-subtitle {
    color: var(--text-dim);
    font-size: 1.02rem;
    line-height: 1.5;
}

.prompt {
    color: var(--secondary);
    font-weight: 700;
}

.cursor {
    display: inline-block;
    animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
    0%,
    49% {
        opacity: 1;
    }
    50%,
    100% {
        opacity: 0;
    }
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.window {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(18, 24, 18, 0.95), rgba(10, 10, 10, 0.92));
}

.window-header {
    border-bottom: 1px dashed var(--border);
    padding: 0.9rem 1.2rem;
    font-size: 1.12rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary);
    font-weight: 700;
}

.window-header:hover,
.brand-title:hover {
    animation: glitch-shake 220ms steps(2, end) 2;
    text-shadow:
        -1px 0 rgba(255, 51, 51, 0.7),
        1px 0 rgba(var(--accent-rgb), 0.7),
        0 0 5px rgba(var(--accent-rgb), 0.4);
}

.window-body {
    padding: 0.9rem;
}

.window + .window {
    margin-top: 1rem;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border: 1px solid var(--fg);
    background: var(--muted);
    display: inline-block;
}

.status-dot.connected,
.status-dot.status-online,
.status-dot.online {
    background: var(--fg);
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
}

.status-dot.disconnected,
.status-dot.status-offline,
.status-dot.offline {
    background: var(--danger);
    border-color: var(--danger);
}

.status-badge {
    border: 1px solid var(--border);
    padding: 0.35rem 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 600;
}

.status-running {
    color: var(--fg);
    border-color: var(--fg);
}

.status-stopped,
.status-offline {
    color: var(--danger);
    border-color: var(--danger);
}

.stat-line {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    border-bottom: 1px dashed var(--border);
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.stat-line:last-child {
    border-bottom: 0;
}

.form-grid {
    display: grid;
    gap: 0.75rem;
}

.form-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 放大表单内复选框，便于点击与识别 */
.field input[type="checkbox"],
.form-grid input[type="checkbox"],
label input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    accent-color: var(--fg);
    cursor: pointer;
}

.inline-list input[type="checkbox"] {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.field-label {
    color: var(--text-dim);
    font-size: 1.02rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.field-help {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
}

.warning-block {
    border: 1px dashed rgba(255, 51, 51, 0.65);
    background: rgba(255, 51, 51, 0.08);
    padding: 0.85rem 1rem;
}

.warning-text {
    color: var(--danger);
    font-size: 1rem;
    line-height: 1.55;
}

.terminal-input,
.terminal-select,
.terminal-textarea,
input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #0a0a0a;
    color: var(--fg);
    padding: 0.85rem 1rem;
    font-size: 1.08rem;
    line-height: 1.5;
    min-height: 48px;
    font-family: inherit;
}

.terminal-input::placeholder,
input::placeholder,
textarea::placeholder {
    font-size: 1rem;
    color: var(--text-dim);
}

input[type="number"],
input[type="text"],
input[type="password"],
input[type="datetime-local"],
.terminal-input {
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus,
.terminal-input:focus,
.terminal-select:focus,
.terminal-textarea:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: var(--focus-shadow);
}

select,
.terminal-select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2333ff00' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1rem;
    padding-right: 2.5rem;
}

select option,
.terminal-select option {
    padding: 0.6rem 0.8rem;
    font-size: 1.05rem;
    min-height: 40px;
    background: #0a0a0a;
    color: var(--fg);
}

textarea,
.terminal-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.btn {
    border: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.35rem;
    cursor: pointer;
    min-height: 50px;
    line-height: 1.4;
}

.btn::before {
    content: '[';
    color: var(--secondary);
    margin-right: 0.18rem;
}

.btn::after {
    content: ']';
    color: var(--secondary);
    margin-left: 0.18rem;
}

.btn:hover:not(:disabled),
.btn.active {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--fg);
    animation: glitch-shake 220ms steps(2, end) 2;
}

.glitch-hover {
    position: relative;
}

.glitch-hover:hover {
    animation: glitch-shake 220ms steps(2, end) 2;
    text-shadow:
        -1px 0 rgba(255, 51, 51, 0.7),
        1px 0 rgba(var(--accent-rgb), 0.7),
        0 0 5px rgba(var(--accent-rgb), 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    color: var(--secondary);
    border-color: rgba(255, 176, 0, 0.5);
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(255, 51, 51, 0.7);
}

.btn-inline {
    padding: 0.5rem 0.9rem;
    min-height: 42px;
    font-size: 0.98rem;
}

.btn-block {
    width: 100%;
}

.tab-bar {
    display: inline-flex;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab-btn {
    border: 0;
    border-right: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    padding: 0.75rem 1.4rem;
    font-size: 1.08rem;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    min-height: 48px;
    line-height: 1.4;
}

.tab-btn:last-child {
    border-right: 0;
}

.tab-btn.active {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
}

.qzone-grid,
.records-grid,
.bot-grid {
    display: grid;
    gap: 1rem;
}

.bot-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.bot-card,
.record-card,
.stat-card {
    border: 1px solid var(--border);
    background: rgba(8, 10, 8, 0.9);
    padding: 1.1rem;
}

.bot-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.bot-meta {
    color: var(--text-dim);
    font-size: 1rem;
}

.kv-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    border-bottom: 1px dotted var(--border);
    padding: 0.3rem 0;
}

.kv-line:last-child {
    border-bottom: 0;
}

.status-text {
    font-size: 0.84rem;
}

.status-text.status-error {
    color: var(--danger);
}

.status-text.status-warning {
    color: var(--secondary);
}

.status-text.status-info {
    color: var(--text-dim);
}

.log-output {
    border: 1px solid var(--border);
    background: #060806;
    min-height: 220px;
    max-height: 320px;
    overflow: auto;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

.log-entry {
    border-bottom: 1px dotted rgba(31, 82, 31, 0.6);
    padding: 0.35rem 0;
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-entry.success {
    color: var(--fg);
}

.log-entry.error {
    color: var(--danger);
}

.log-entry.info {
    color: var(--secondary);
}

.timestamp {
    color: var(--text-dim);
    margin-right: 0.4rem;
}

.query-result,
.result-panel {
    border: 1px dashed var(--border);
    padding: 0.7rem;
    margin-top: 0.8rem;
    background: rgba(10, 12, 10, 0.7);
}

.result-item {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.35rem 0;
    border-bottom: 1px dotted var(--border);
}

.result-item:last-child {
    border-bottom: 0;
}

.value {
    color: var(--secondary);
    font-weight: 700;
}

.ascii-separator {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin: 0.6rem 0;
    letter-spacing: 0.12em;
}

.ascii-logo {
    border: 1px dashed var(--border);
    background: rgba(10, 14, 10, 0.75);
    color: var(--secondary);
    padding: 0.6rem 0.7rem;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: pre;
    overflow-x: auto;
    max-width: 100%;
    text-shadow: none;
    animation: crt-flicker 3.5s infinite steps(2, end);
}

.footer {
    margin: 1.2rem 0 0.8rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal {
    width: min(760px, 100%);
    border: 1px solid var(--border);
    background: var(--bg);
}

.modal .window-body {
    max-height: min(70vh, 720px);
    overflow: auto;
    padding: 1.35rem;
}

.modal .form-grid {
    gap: 1.1rem;
}

.modal-sm {
    width: min(560px, 100%);
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    display: grid;
    gap: 0.5rem;
}

.toast {
    min-width: 300px;
    max-width: 480px;
    border: 1px solid var(--border);
    background: #091009;
    color: var(--fg);
    padding: 0.85rem 1rem;
    font-size: 1.02rem;
    animation: toast-in 0.2s ease-out;
}

.toast.success {
    border-color: var(--fg);
}

.toast.error {
    color: var(--danger);
    border-color: var(--danger);
}

.toast.warning {
    color: var(--secondary);
    border-color: var(--secondary);
}

.toast.hiding {
    animation: toast-out 0.2s ease-in forwards;
}

.progress-track {
    margin-top: 0.35rem;
    border: 1px solid var(--border);
    height: 10px;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--fg);
}

.pager {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pager-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    padding: 0.45rem 0.7rem;
    font-size: 1rem;
    cursor: pointer;
    min-width: 2.5rem;
    min-height: 40px;
}

.pager-btn.active,
.pager-btn:hover {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
}

.record-list,
.friend-grid {
    display: grid;
    gap: 0.7rem;
}

.friend-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.friend-chip {
    border: 1px solid var(--border);
    background: rgba(10, 12, 10, 0.9);
    color: var(--fg);
    text-align: left;
    padding: 0.45rem;
    cursor: pointer;
    font: inherit;
}

.friend-chip:hover {
    border-color: var(--fg);
}

.avatar {
    width: 2.4rem;
    height: 2.4rem;
    object-fit: cover;
    border: 1px solid var(--border);
}

.avatar-lg {
    width: 2.8rem;
    height: 2.8rem;
}

.kbd-link {
    font-size: 0.78rem;
    padding: 0.1rem 0.28rem;
    border: 1px dashed var(--secondary);
    color: var(--secondary);
    text-transform: uppercase;
}

.image-grid {
    display: grid;
    gap: 0.4rem;
}

.record-image {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--border);
}

.terminal-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-size: 1rem;
}

.terminal-table th,
.terminal-table td {
    border: 1px dashed var(--border);
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    line-height: 1.5;
}

.terminal-table th {
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(10, 14, 10, 0.9);
}

.auth-title {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
}

.error-box {
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.75rem 1rem;
    margin-bottom: 0.7rem;
    font-size: 1rem;
    line-height: 1.5;
}

.top-nav {
    border: 1px solid var(--border);
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.9rem;
}

.top-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.inline-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.gm-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    cursor: pointer;
    color: var(--fg);
}

.gm-toggle input[type="checkbox"] {
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    accent-color: var(--fg);
    cursor: pointer;
    flex: 0 0 26px;
}

.gm-toggle-text {
    font-size: 1.08rem;
}

.gm-toggle-state {
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.1rem 0.45rem;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

.gm-toggle-state.is-on {
    border-color: var(--fg);
    color: var(--fg);
}

.badge {
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    font-size: 0.95rem;
    color: var(--text-dim);
}

.landing-lead {
    color: var(--fg);
    max-width: 80ch;
}

.landing-tags {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.landing-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
    border: 1px solid var(--border);
    background: rgba(8, 12, 8, 0.9);
    padding: 0.7rem;
}

.feature-card h3 {
    color: var(--secondary);
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 0.84rem;
}

.feature-card:hover {
    border-color: var(--fg);
    animation: glitch-shake 220ms steps(2, end) 2;
}

.landing-steps {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.landing-steps li {
    border-bottom: 1px dotted var(--border);
    padding-bottom: 0.3rem;
}

.landing-quick-access {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1200;
    display: flex;
    gap: 0.45rem;
}

.landing-quick-btn {
    min-height: 40px;
    font-size: 0.9rem;
    border-width: 2px;
}

.landing-quick-btn::before,
.landing-quick-btn::after {
    content: '';
    margin: 0;
}

.landing-quick-btn-primary {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--fg);
    animation: cta-pulse 1.4s infinite;
}

.landing-quick-btn-secondary {
    background: var(--secondary);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--secondary);
}

.landing-hero-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.landing-cta-btn {
    min-height: 48px;
    font-size: 1rem;
    border-width: 2px;
    padding: 0.65rem 1.2rem;
}

.landing-cta-btn::before,
.landing-cta-btn::after {
    content: '';
    margin: 0;
}

.landing-cta-primary {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--fg);
    animation: cta-pulse 1.4s infinite;
}

.landing-cta-secondary {
    background: var(--secondary);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--secondary);
}

@keyframes cta-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
    }
    60% {
        box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    0%,
    49% {
        border-color: var(--fg);
    }
    50%,
    100% {
        border-color: transparent;
    }
}

@keyframes glitch-shake {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-1px, 1px);
    }
    40% {
        transform: translate(1px, -1px);
    }
    60% {
        transform: translate(-1px, 0);
    }
    80% {
        transform: translate(1px, 1px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes crt-flicker {
    0%,
    94%,
    100% {
        opacity: 1;
    }
    95% {
        opacity: 0.86;
    }
    97% {
        opacity: 0.92;
    }
}

@media (max-width: 900px) {
    .form-grid.cols-2 {
        grid-template-columns: 1fr;
    }

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

    .app-shell {
        width: min(100% - 1rem, 980px);
    }

    .landing-quick-access {
        right: 0.6rem;
        left: 0.6rem;
        top: auto;
        bottom: 0.6rem;
        justify-content: center;
    }

    .landing-quick-btn {
        flex: 1;
        justify-content: center;
    }
}

.floating-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1300;
    display: grid;
    gap: 0.55rem;
    width: fit-content;
    max-width: calc(100vw - 1.2rem);
}

.theme-switcher {
    border: 1px solid var(--border);
    background: rgba(10, 12, 10, 0.92);
    padding: 0.55rem;
    backdrop-filter: blur(4px);
}

.floating-panel {
    width: fit-content;
    max-width: calc(100vw - 1.2rem);
}

.floating-panel-header {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: fit-content;
}

.floating-panel-trigger {
    border: 1px solid var(--border);
    background: rgba(10, 12, 10, 0.9);
    color: var(--text-dim);
    padding: 0.3rem 0.5rem;
    font: inherit;
    line-height: 1.1;
    cursor: pointer;
}

.floating-panel-trigger:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.floating-panel-content {
    margin-top: 0.45rem;
    width: min(300px, calc(100vw - 2rem));
}

.floating-panel.is-collapsed .floating-panel-content {
    display: none;
}

.theme-switcher-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.theme-switcher-actions {
    display: grid;
    gap: 0.35rem;
}

.theme-switcher-btn {
    width: 100%;
    min-height: 32px;
}

.theme-switcher-btn[aria-pressed='true'] {
    background: var(--fg);
    color: var(--button-text-on-accent);
    text-shadow: none;
    border-color: var(--fg);
}

.operation-guide {
    border: 1px solid var(--border);
    background: rgba(10, 12, 10, 0.94);
    padding: 0.55rem 0.65rem 0.6rem;
    backdrop-filter: blur(4px);
}

.operation-guide-title {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary);
}

.operation-guide-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.28rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.operation-guide-list li {
    word-break: break-word;
}

html[data-theme='minimal'] {
    --bg: #0a0a0a;
    --fg: #f2f0e4;
    --secondary: #d4af37;
    --muted: #1e3d59;
    --border: rgba(212, 175, 55, 0.45);
    --danger: #ea6b6b;
    --surface: #141414;
    --surface-alt: #101010;
    --text-dim: #a89f83;
    --text-shadow: none;
    --accent-rgb: 212, 175, 55;
    --font-body: 'Josefin Sans', 'Segoe UI', sans-serif;
    --font-display: 'Marcellus', serif;
    --focus-shadow: 0 4px 10px rgba(212, 175, 55, 0.22);
    --button-text-on-accent: #0a0a0a;
}

html[data-theme='minimal'] body {
    background:
        radial-gradient(circle at 50% -5%, rgba(212, 175, 55, 0.2), rgba(0, 0, 0, 0) 42%),
        repeating-linear-gradient(
            45deg,
            rgba(212, 175, 55, 0.05) 0,
            rgba(212, 175, 55, 0.05) 1px,
            transparent 1px,
            transparent 16px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(212, 175, 55, 0.03) 0,
            rgba(212, 175, 55, 0.03) 1px,
            transparent 1px,
            transparent 18px
        ),
        var(--bg);
    color: var(--fg);
    letter-spacing: 0.01em;
}

html[data-theme='minimal'] body::before {
    opacity: 0.12;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.07), transparent 45%),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.04), transparent 42%);
}

html[data-theme='minimal'] .terminal-header,
html[data-theme='minimal'] .window,
html[data-theme='minimal'] .top-nav,
html[data-theme='minimal'] .modal,
html[data-theme='minimal'] .theme-switcher,
html[data-theme='minimal'] .operation-guide {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(10, 10, 10, 0.94));
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.18);
}

html[data-theme='minimal'] .window {
    position: relative;
}

html[data-theme='minimal'] .window::before,
html[data-theme='minimal'] .window::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    opacity: 0.85;
}

html[data-theme='minimal'] .window::before {
    top: 6px;
    left: 6px;
    border-top: 2px solid var(--secondary);
    border-left: 2px solid var(--secondary);
}

html[data-theme='minimal'] .window::after {
    right: 6px;
    bottom: 6px;
    border-right: 2px solid var(--secondary);
    border-bottom: 2px solid var(--secondary);
}

html[data-theme='minimal'] .brand-title,
html[data-theme='minimal'] .window-header,
html[data-theme='minimal'] .auth-title {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

html[data-theme='minimal'] .window-header {
    color: var(--secondary);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    text-align: center;
}

html[data-theme='minimal'] .window-header::before,
html[data-theme='minimal'] .window-header::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 46px;
    height: 1px;
    background: rgba(212, 175, 55, 0.45);
}

html[data-theme='minimal'] .window-header::before {
    left: 0.8rem;
}

html[data-theme='minimal'] .window-header::after {
    right: 0.8rem;
}

html[data-theme='minimal'] .status-dot {
    transform: rotate(45deg);
    border-radius: 0;
    border-width: 1px;
}

html[data-theme='minimal'] .ascii-logo {
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #d8c071;
    background: rgba(20, 20, 20, 0.9);
    text-shadow: none;
}

html[data-theme='minimal'] .btn {
    border: 2px solid rgba(212, 175, 55, 0.72);
    background: transparent;
    color: var(--secondary);
    letter-spacing: 0.2em;
    min-height: 44px;
    padding: 0.58rem 1rem;
    transition: all 0.35s ease;
}

html[data-theme='minimal'] .btn::before,
html[data-theme='minimal'] .btn::after {
    display: none;
}

html[data-theme='minimal'] .btn:hover:not(:disabled),
html[data-theme='minimal'] .btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #f2e8c4 100%);
    border-color: #f2e8c4;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    text-shadow: none;
    animation: none;
    transform: translateY(-2px);
}

html[data-theme='minimal'] .btn-secondary {
    border-color: rgba(212, 175, 55, 0.45);
    color: #d7b860;
}

html[data-theme='minimal'] .btn-danger {
    border-color: rgba(234, 107, 107, 0.75);
    color: #ea8f8f;
}

html[data-theme='minimal'] .tab-bar {
    border-color: rgba(212, 175, 55, 0.35);
}

html[data-theme='minimal'] .tab-btn {
    color: #aea17b;
}

html[data-theme='minimal'] .tab-btn.active {
    background: #d4af37;
    color: #0a0a0a;
}

html[data-theme='minimal'] .field-label {
    color: var(--secondary);
    letter-spacing: 0.16em;
}

html[data-theme='minimal'] .field-help,
html[data-theme='minimal'] .brand-subtitle,
html[data-theme='minimal'] .badge {
    color: var(--text-dim);
}

html[data-theme='minimal'] input,
html[data-theme='minimal'] select,
html[data-theme='minimal'] textarea,
html[data-theme='minimal'] .terminal-input,
html[data-theme='minimal'] .terminal-select,
html[data-theme='minimal'] .terminal-textarea {
    border: 0;
    border-bottom: 2px solid rgba(212, 175, 55, 0.7);
    background: transparent;
    color: var(--fg);
    padding: 0.85rem 0.5rem;
    min-height: 48px;
    font-size: 1.08rem;
}

html[data-theme='minimal'] input:focus,
html[data-theme='minimal'] select:focus,
html[data-theme='minimal'] textarea:focus,
html[data-theme='minimal'] .terminal-input:focus,
html[data-theme='minimal'] .terminal-select:focus,
html[data-theme='minimal'] .terminal-textarea:focus {
    border-bottom-color: #f2e8c4;
    box-shadow: var(--focus-shadow);
}

html[data-theme='minimal'] .terminal-select option {
    background: #111;
    color: #f2f0e4;
}

html[data-theme='minimal'] .feature-card,
html[data-theme='minimal'] .bot-card,
html[data-theme='minimal'] .record-card,
html[data-theme='minimal'] .stat-card,
html[data-theme='minimal'] .query-result,
html[data-theme='minimal'] .result-panel {
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(20, 20, 20, 0.88);
    transition: all 0.45s ease;
}

html[data-theme='minimal'] .feature-card:hover,
html[data-theme='minimal'] .bot-card:hover,
html[data-theme='minimal'] .record-card:hover,
html[data-theme='minimal'] .stat-card:hover {
    border-color: rgba(212, 175, 55, 0.95);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.2);
    transform: translateY(-4px);
    animation: none;
}

html[data-theme='minimal'] .feature-card h3 {
    font-family: var(--font-display);
    color: var(--secondary);
    letter-spacing: 0.14em;
}

html[data-theme='minimal'] .landing-steps {
    counter-reset: artdeco-step;
}

html[data-theme='minimal'] .landing-steps li {
    list-style: none;
    position: relative;
    padding-left: 2.7rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.24);
}

html[data-theme='minimal'] .landing-steps li::before {
    counter-increment: artdeco-step;
    content: counter(artdeco-step, upper-roman);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--secondary);
    font-family: var(--font-display);
    letter-spacing: 0.08em;
}

html[data-theme='minimal'] .avatar {
    border: 1px solid rgba(212, 175, 55, 0.6);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    object-position: center;
}

html[data-theme='minimal'] .log-output,
html[data-theme='minimal'] .table-wrap {
    border-color: rgba(212, 175, 55, 0.35);
    background: #090909;
}

html[data-theme='minimal'] .terminal-table th,
html[data-theme='minimal'] .terminal-table td {
    border-color: rgba(212, 175, 55, 0.25);
}

html[data-theme='minimal'] .terminal-table th {
    color: var(--secondary);
    background: rgba(22, 22, 22, 0.95);
}

html[data-theme='minimal'] .theme-switcher-title {
    color: var(--secondary);
}

html[data-theme='minimal'] .theme-switcher-btn {
    min-height: 38px;
}

html[data-theme='minimal'] .floating-panel-trigger {
    min-height: 34px;
}

html[data-theme='minimal'] .operation-guide-title {
    color: var(--secondary);
}

html[data-theme='minimal'] .operation-guide-list {
    color: var(--text-dim);
}

html[data-theme='bauhaus'] {
    --bg: #f0f0f0;
    --fg: #121212;
    --secondary: #1040c0;
    --muted: #e0e0e0;
    --border: #121212;
    --danger: #d02020;
    --surface: #ffffff;
    --surface-alt: #f6f6f6;
    --text-dim: #2b2b2b;
    --text-shadow: none;
    --accent-rgb: 240, 192, 32;
    --font-body: 'Outfit', 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Segoe UI', sans-serif;
    --focus-shadow: 4px 4px 0 0 #121212;
    --button-text-on-accent: #121212;
}

html[data-theme='bauhaus'] body {
    background:
        radial-gradient(#121212 1px, transparent 1px) 0 0 / 20px 20px,
        var(--bg);
    color: var(--fg);
    letter-spacing: 0.01em;
}

html[data-theme='bauhaus'] body::before {
    opacity: 1;
    z-index: 0;
    background:
        linear-gradient(0deg, transparent 0, transparent 100%),
        linear-gradient(90deg, rgba(208, 32, 32, 0.14) 0 18%, transparent 18% 100%);
}

html[data-theme='bauhaus'] .terminal-header,
html[data-theme='bauhaus'] .window,
html[data-theme='bauhaus'] .top-nav,
html[data-theme='bauhaus'] .modal,
html[data-theme='bauhaus'] .theme-switcher,
html[data-theme='bauhaus'] .operation-guide,
html[data-theme='bauhaus'] .feature-card,
html[data-theme='bauhaus'] .bot-card,
html[data-theme='bauhaus'] .record-card,
html[data-theme='bauhaus'] .stat-card,
html[data-theme='bauhaus'] .query-result,
html[data-theme='bauhaus'] .result-panel {
    border: 4px solid #121212;
    background: #fff;
    box-shadow: 8px 8px 0 0 #121212;
}

html[data-theme='bauhaus'] .window-header,
html[data-theme='bauhaus'] .brand-title,
html[data-theme='bauhaus'] .auth-title {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 900;
    color: #121212;
}

html[data-theme='bauhaus'] .window-header {
    border-bottom: 4px solid #121212;
    background: #f0c020;
}

html[data-theme='bauhaus'] .ascii-logo {
    border: 3px solid #121212;
    background: #ffffff;
    color: #121212;
    text-shadow: none;
    box-shadow: 4px 4px 0 0 #121212;
    animation: none;
}

html[data-theme='bauhaus'] .btn {
    border: 3px solid #121212;
    background: #ffffff;
    color: #121212;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-shadow: none;
    box-shadow: 4px 4px 0 0 #121212;
    transition: transform 0.2s ease-out;
}

html[data-theme='bauhaus'] .btn::before,
html[data-theme='bauhaus'] .btn::after {
    display: none;
}

html[data-theme='bauhaus'] .btn:hover:not(:disabled),
html[data-theme='bauhaus'] .btn.active {
    background: #ffffff;
    color: #121212;
    border-color: #121212;
    transform: translate(-1px, -1px);
    animation: none;
}

html[data-theme='bauhaus'] .btn:active {
    background: #f0c020;
    color: #121212;
    border-color: #121212;
    transform: translate(2px, 2px);
    box-shadow: none;
}

html[data-theme='bauhaus'] .btn-secondary {
    background: #1040c0;
    color: #fff;
    border-color: #121212;
}

html[data-theme='bauhaus'] .btn-danger {
    background: #d02020;
    color: #fff;
    border-color: #121212;
}

html[data-theme='bauhaus'] .theme-switcher-btn[aria-pressed='true'] {
    background: #f0c020;
    color: #121212;
    border-color: #121212;
}

html[data-theme='bauhaus'] .toast {
    border: 3px solid #121212;
    background: #ffffff;
    color: #121212;
    text-shadow: none;
    box-shadow: 4px 4px 0 0 #121212;
}

html[data-theme='bauhaus'] .toast.success {
    background: #eef7ee;
    border-color: #121212;
    color: #121212;
}

html[data-theme='bauhaus'] .toast.info {
    background: #edf3ff;
    border-color: #121212;
    color: #121212;
}

html[data-theme='bauhaus'] .toast.warning {
    background: #fff7df;
    border-color: #121212;
    color: #7a4a00;
}

html[data-theme='bauhaus'] .toast.error {
    background: #ffecec;
    border-color: #121212;
    color: #8f1010;
}

html[data-theme='bauhaus'] .floating-panel-trigger {
    border: 3px solid #121212;
    background: #ffffff;
    color: #121212;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    box-shadow: 4px 4px 0 0 #121212;
}

html[data-theme='bauhaus'] .floating-panel-trigger:hover {
    background: #f0c020;
    color: #121212;
    border-color: #121212;
}

html[data-theme='bauhaus'] .tab-bar {
    border: 4px solid #121212;
}

html[data-theme='bauhaus'] .tab-btn {
    border-right: 3px solid #121212;
    color: #121212;
    font-weight: 700;
}

html[data-theme='bauhaus'] .tab-btn.active {
    background: #1040c0;
    color: #fff;
}

html[data-theme='bauhaus'] input,
html[data-theme='bauhaus'] select,
html[data-theme='bauhaus'] textarea,
html[data-theme='bauhaus'] .terminal-input,
html[data-theme='bauhaus'] .terminal-select,
html[data-theme='bauhaus'] .terminal-textarea {
    border: 3px solid #121212;
    background: #fff;
    color: #121212;
    border-radius: 0;
    min-height: 48px;
    padding: 0.85rem 1rem;
    font-size: 1.08rem;
}

html[data-theme='bauhaus'] input:focus,
html[data-theme='bauhaus'] select:focus,
html[data-theme='bauhaus'] textarea:focus,
html[data-theme='bauhaus'] .terminal-input:focus,
html[data-theme='bauhaus'] .terminal-select:focus,
html[data-theme='bauhaus'] .terminal-textarea:focus {
    box-shadow: var(--focus-shadow);
}

html[data-theme='bauhaus'] .feature-card,
html[data-theme='bauhaus'] .bot-card,
html[data-theme='bauhaus'] .record-card,
html[data-theme='bauhaus'] .stat-card {
    position: relative;
    transition: transform 0.2s ease-out;
}

html[data-theme='bauhaus'] .feature-card:hover,
html[data-theme='bauhaus'] .bot-card:hover,
html[data-theme='bauhaus'] .record-card:hover,
html[data-theme='bauhaus'] .stat-card:hover {
    transform: translateY(-4px);
    animation: none;
}

html[data-theme='bauhaus'] .feature-card::after,
html[data-theme='bauhaus'] .bot-card::after,
html[data-theme='bauhaus'] .record-card::after,
html[data-theme='bauhaus'] .stat-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: #d02020;
    border: 2px solid #121212;
}

html[data-theme='bauhaus'] .feature-card:nth-child(3n)::after,
html[data-theme='bauhaus'] .bot-card:nth-child(3n)::after,
html[data-theme='bauhaus'] .record-card:nth-child(3n)::after,
html[data-theme='bauhaus'] .stat-card:nth-child(3n)::after {
    background: #1040c0;
    transform: rotate(45deg);
}

html[data-theme='bauhaus'] .feature-card:nth-child(3n + 2)::after,
html[data-theme='bauhaus'] .bot-card:nth-child(3n + 2)::after,
html[data-theme='bauhaus'] .record-card:nth-child(3n + 2)::after,
html[data-theme='bauhaus'] .stat-card:nth-child(3n + 2)::after {
    background: #f0c020;
    border-radius: 999px;
}

html[data-theme='bauhaus'] .theme-switcher-title,
html[data-theme='bauhaus'] .operation-guide-title {
    color: #121212;
    font-weight: 900;
}

html[data-theme='bauhaus'] .operation-guide-list,
html[data-theme='bauhaus'] .brand-subtitle,
html[data-theme='bauhaus'] .field-help,
html[data-theme='bauhaus'] .badge {
    color: #232323;
}

@media (max-width: 900px) {
    .floating-stack {
        right: 0.6rem;
        bottom: 0.6rem;
        left: auto;
        width: fit-content;
        max-width: calc(100vw - 1.2rem);
    }

    .theme-switcher {
        min-width: 0;
    }

    .theme-switcher-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operation-guide {
        max-height: min(46vh, 360px);
        overflow: auto;
    }

    .floating-panel-content {
        max-height: min(46vh, 360px);
        overflow: auto;
    }

    html[data-theme='bauhaus'] .terminal-header,
    html[data-theme='bauhaus'] .window,
    html[data-theme='bauhaus'] .top-nav,
    html[data-theme='bauhaus'] .modal,
    html[data-theme='bauhaus'] .theme-switcher,
    html[data-theme='bauhaus'] .operation-guide,
    html[data-theme='bauhaus'] .feature-card,
    html[data-theme='bauhaus'] .bot-card,
    html[data-theme='bauhaus'] .record-card,
    html[data-theme='bauhaus'] .stat-card,
    html[data-theme='bauhaus'] .query-result,
    html[data-theme='bauhaus'] .result-panel {
        border-width: 2px;
        box-shadow: 4px 4px 0 0 #121212;
    }
}

