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

:root {
    --bg: #0e0c0b;
    --bg-secondary: #161412;
    --bg-input: #1c1917;
    --border: #2a2520;
    --text-primary: #e8e0d8;
    --text-muted: #5a524a;
    --text-dim: #3a322a;
    --accent: #c8a882;
    --accent-dim: #6a5a48;
    --user-bubble: #1e3a5f;
    --user-text: #a8c8f0;
    --ai-bubble: #161412;
    --ai-border: #2a2520;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text-primary);
    font-family: Georgia, 'Times New Roman', serif;
    overflow: hidden;
}

.container {
    height: 100vh;
    position: relative;
}


.landing {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1.2s ease forwards;
    z-index: 10;
    background: var(--bg);
}

.landing-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    padding: 0 24px;
}

.heim-title {
    font-size: 64px;
    font-weight: 400;
    letter-spacing: 12px;
    color: var(--text-primary);
    animation: fadeUp 1s ease 0.2s both;
}

.heim-sub {
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 32px;
    animation: fadeUp 1s ease 0.4s both;
}

.landing-input-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 12px 12px 12px 24px;
    animation: fadeUp 1s ease 0.6s both;
    transition: border-color 0.3s ease;
}

.landing-input-wrap:focus-within {
    border-color: var(--accent-dim);
}

.landing-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: Georgia, serif;
    font-size: 15px;
}

.landing-input-wrap input::placeholder {
    color: var(--text-dim);
}

.landing-input-wrap button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.landing-input-wrap button:hover {
    opacity: 0.85;
}


.chat-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.chat-view.active {
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-name {
    font-size: 15px;
    letter-spacing: 3px;
    color: var(--text-muted);
}

.header-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3a6a3a;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-area::-webkit-scrollbar {
    width: 4px;
}

.chat-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}


.bubble {
    max-width: 65%;
    padding: 10px 16px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}

.bubble.user {
    background: var(--user-bubble);
    color: var(--user-text);
    align-self: flex-end;
    border-radius: 18px 18px 4px 18px;
}

.bubble.ai {
    background: var(--ai-bubble);
    color: var(--text-primary);
    align-self: flex-start;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--ai-border);
}


.indicator-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
}

.book-stage {
    width: 52px;
    height: 52px;
    position: relative;
}

.book-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 14px;
    background: #5a3e28;
    border-radius: 2px 2px 3px 3px;
    z-index: 3;
}

.book-base::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: #7a5a3a;
    border-radius: 1px;
}

.book-base::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: #4a2e1a;
    border-radius: 0 0 3px 3px;
}

.ind-page {
    position: absolute;
    width: 16px;
    height: 20px;
    border-radius: 1px 2px 1px 1px;
    z-index: 2;
}

.ind-page::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: rgba(0,0,0,0.12);
    box-shadow: 0 3px 0 rgba(0,0,0,0.1), 0 6px 0 rgba(0,0,0,0.08);
}

.ip1 {
    bottom: 10px;
    left: 4px;
    background: #f0e8d8;
    box-shadow: 0 0 8px rgba(220,190,100,0.7);
    animation: flyPage1 2s ease-in-out infinite;
}

.ip2 {
    bottom: 10px;
    left: 18px;
    background: #ede5d5;
    box-shadow: 0 0 8px rgba(200,170,90,0.65);
    animation: flyPage2 2s ease-in-out infinite 0.5s;
}

.ip3 {
    bottom: 10px;
    left: 30px;
    background: #f2eadc;
    box-shadow: 0 0 8px rgba(210,185,100,0.6);
    animation: flyPage3 2s ease-in-out infinite 1s;
}

@keyframes flyPage1 {
    0% { transform: rotate(-5deg) translateY(0px); opacity: 1; }
    40% { transform: rotate(-18deg) translateY(-28px) translateX(-4px); opacity: 0.9; box-shadow: 0 0 16px rgba(220,190,100,1); }
    70% { transform: rotate(-22deg) translateY(-38px) translateX(-6px); opacity: 0.4; }
    100% { transform: rotate(-5deg) translateY(0px); opacity: 1; }
}

@keyframes flyPage2 {
    0% { transform: rotate(3deg) translateY(0px); opacity: 1; }
    40% { transform: rotate(10deg) translateY(-32px) translateX(2px); opacity: 0.9; box-shadow: 0 0 16px rgba(200,170,90,1); }
    70% { transform: rotate(14deg) translateY(-44px) translateX(4px); opacity: 0.4; }
    100% { transform: rotate(3deg) translateY(0px); opacity: 1; }
}

@keyframes flyPage3 {
    0% { transform: rotate(8deg) translateY(0px); opacity: 1; }
    40% { transform: rotate(20deg) translateY(-26px) translateX(5px); opacity: 0.9; box-shadow: 0 0 16px rgba(210,185,100,1); }
    70% { transform: rotate(24deg) translateY(-36px) translateX(8px); opacity: 0.4; }
    100% { transform: rotate(8deg) translateY(0px); opacity: 1; }
}

.label-thinking {
    color: var(--text-muted);
    font-size: 13px;
    animation: textpulse 2s ease-in-out infinite;
}

@keyframes textpulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


.chat-input-wrap {
    padding: 16px 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.aurora-line {
    position: absolute;
    top: -2px;
    left: 5%;
    right: 5%;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, #3a3060, transparent);
    animation: aurora-pulse 3s ease-in-out infinite;
    transition: background 1s ease;
    box-shadow: 0 0 12px rgba(58, 48, 96, 0.6);
}

@keyframes aurora-pulse {
    0%, 100% { opacity: 0.4; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}

.chat-input-wrap input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 11px 18px;
    color: var(--text-primary);
    font-family: Georgia, serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input-wrap input:focus {
    border-color: var(--accent-dim);
}

.chat-input-wrap input::placeholder {
    color: var(--text-dim);
}

.chat-input-wrap button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.chat-input-wrap button:hover {
    opacity: 0.85;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: #0a0908;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.sidebar-header span {
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--text-muted);
}

.sidebar-header button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-header button:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item:hover {
    background: #161412;
    color: var(--text-primary);
}

.sidebar-item.active {
    background: #1e1a17;
    color: var(--text-primary);
}

.container {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.chat-input-wrap textarea,
.landing-input-wrap textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: Georgia, serif;
    font-size: 15px;
    resize: none;
    overflow: hidden;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}