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

:root {
    --bg: #09090b;
    --line: rgba(255, 255, 255, 0.07);
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --text-dim: #52525b;
    --accent: #ffffff;
    --accent-text: #09090b;
    --hover: rgba(255, 255, 255, 0.04);
    --danger: #ef4444;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(255, 255, 255, 0.15);
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
}

body.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.login-wrap {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 140px;
    padding: 13px 22px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    background: #1e1e1e;
    color: #9a9a9a;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.login-btn:hover {
    background: #262626;
    color: #b2b2b2;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
}

.corner-logo {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.85;
    pointer-events: none;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-logo {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.top-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.top-username {
    font-size: 11px;
    color: var(--text);
}

.btn-logout {
    background: transparent;
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.btn-logout:hover {
    color: var(--text);
}

.content {
    display: flex;
    flex: 1;
    min-height: 0;
}

.tree-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 20px 28px 16px;
    overflow-y: auto;
}

.tree-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.tree-container {
    flex: 1;
    min-height: 0;
}

.tree-container ul {
    list-style: none;
    padding-left: 18px;
}

.tree-container > ul {
    padding-left: 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    user-select: none;
    gap: 6px;
    transition: background 0.1s;
}

.tree-item:hover {
    background: var(--hover);
}

.tree-item.selected {
    background: var(--accent);
    color: var(--accent-text);
}

.tree-item.selected:hover {
    background: rgba(255, 255, 255, 0.9);
}

.tree-item .toggle {
    width: 0;
    height: 0;
    flex-shrink: 0;
    margin-right: 1px;
    border-style: solid;
    transition: transform 0.15s;
}

.tree-item .toggle.has-children {
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent var(--text);
}

.tree-item .toggle.open {
    transform: rotate(90deg);
}

.tree-item.selected .toggle.has-children {
    border-left-color: var(--accent-text);
}

.tree-item .toggle.no-children {
    width: 6px;
    border: none;
}

.tree-item .folder-icon {
    font-size: 13px;
    flex-shrink: 0;
}

.tree-item .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-children {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease-out;
}

.tree-children.open {
    max-height: 2000px;
    transition: max-height 0.35s ease-in;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    width: 180px;
    flex-shrink: 0;
}

.btn-transfer {
    width: 100%;
    padding: 10px 0;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-transfer:hover {
    opacity: 0.85;
}

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

.security-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.15s;
}

.security-toggle:hover {
    color: var(--text);
}

.security-toggle input[type="checkbox"] {
    display: none;
}

.check-box {
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--text-dim);
    border-radius: 2px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}

.security-toggle input:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.security-toggle input:checked + .check-box::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 3px;
    width: 3px;
    height: 6px;
    border: solid var(--accent-text);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.btn-refresh {
    width: 100%;
    padding: 9px 0;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: color 0.15s;
}

.btn-refresh:hover {
    color: var(--text-muted);
}

.console-area {
    border-top: 1px solid var(--line);
    padding: 14px 28px;
    flex-shrink: 0;
}

.console-output {
    height: 140px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-dim);
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
