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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: #FFFFFF;
    color: #1A1A1A;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    flex-shrink: 0;
}

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

.model-label {
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: 0.3px;
}

.model-name {
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
    margin-left: 6px;
    letter-spacing: 0.3px;
}

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

.btn-voice {
    background: none;
    border: none;
    font-size: 14px;
    color: #262626;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: -1px;
    padding: 4px;
}

.voice-icon sup {
    font-size: 8px;
    vertical-align: super;
}

.voice-icon sub {
    font-size: 8px;
    vertical-align: sub;
}

.btn-new {
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 300;
    color: #262626;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.divider {
    height: 1px;
    background: #E5E5E5;
    flex-shrink: 0;
}

.idle-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.idle-spacer {
    flex: 1;
}

.star-icon {
    font-size: 56px;
    color: #1A1A1A;
    margin-bottom: 24px;
    line-height: 1;
}

.greeting-cn {
    font-size: 16px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.greeting-en {
    font-size: 12px;
    color: #8E8E93;
    letter-spacing: 0.2px;
}

.chat-screen {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    scroll-behavior: smooth;
}

.hidden {
    display: none !important;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.msg-user {
    align-self: flex-end;
    background: #F0F0F2;
    color: #1A1A1A;
    padding: 10px 16px;
    border-radius: 20px;
    max-width: 80%;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
}

.msg-bot-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.msg-bot-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.msg-bot-name {
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
}

.msg-bot-time {
    font-size: 11px;
    color: #AEAEB2;
    letter-spacing: 0.5px;
}

.msg-bot-text {
    font-size: 15px;
    color: #262626;
    line-height: 1.75;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-bot-text p {
    margin-bottom: 12px;
}

.msg-bot-text p:last-child {
    margin-bottom: 0;
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #AEAEB2;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.bottom-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    flex-shrink: 0;
}

.btn-attach {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: #1A1A1A;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.attach-icon sup {
    font-size: 10px;
    vertical-align: super;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 11px 18px;
    font-size: 15px;
    color: #1A1A1A;
    background: #F0F0F2;
    border: none;
    border-radius: 24px;
    outline: none;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: #8E8E93;
    font-size: 14px;
}

.input-wrapper input:focus {
    background: #EAEAEC;
}

.btn-send {
    background: #262626;
    color: #FFFFFF;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 24px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.15s ease;
}

.btn-send:active {
    background: #404040;
}

.btn-send:disabled {
    background: #C7C7CC;
    cursor: not-allowed;
}

.disclaimer {
    text-align: center;
    font-size: 11px;
    color: #C7C7CC;
    padding: 8px 18px 6px;
    flex-shrink: 0;
}

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

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

.chat-screen::-webkit-scrollbar-thumb {
    background: #D1D1D6;
    border-radius: 4px;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-bar {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    .disclaimer {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}
