:root {
    --bg-base: #0a0a0d;
    --bg-elevated: #14141a;
    --bg-overlay: rgba(20, 20, 26, 0.72);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-strong: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.66);
    --text-tertiary: rgba(255, 255, 255, 0.42);

    --accent: #ff2d55;
    --accent-hover: #ff4775;
    --accent-soft: rgba(255, 45, 85, 0.18);
    --accent-glow: rgba(255, 45, 85, 0.35);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px var(--accent-glow);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 160ms;
    --duration-base: 240ms;
    --duration-slow: 380ms;

    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

html {
    background: #000;
}

body {
    background: #000;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    user-select: none;
    letter-spacing: 0.01em;
}

.sidebar,
.sidebar * {
    -webkit-user-select: auto;
    user-select: auto;
}

.app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: calc(14px + var(--safe-area-top)) 20px 14px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.top-bar button {
    pointer-events: auto;
}

.icon-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.icon-btn:hover {
    opacity: 1;
    background: var(--bg-glass-strong);
    border-color: var(--border-default);
}

.icon-btn:active {
    transform: scale(0.92);
}

::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}
