/* ==================== 全局样式重置 ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==================== Watch UI override ==================== */
html,
body {
    background: #000;
}

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: #fff;
}

.background-container {
    background-image: none !important;
    background: radial-gradient(circle at 50% 35%, rgba(45, 45, 48, 0.45), rgba(0, 0, 0, 0.96) 46%, #000 100%);
}

.background-overlay {
    background: transparent;
}

.watch-shell {
    position: relative;
    width: min(88vw, 420px);
    aspect-ratio: 1 / 1.08;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 28px 45px rgba(0, 0, 0, 0.75));
}

.watch-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 26%;
    background:
        radial-gradient(circle at 50% 43%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 23%, transparent 44%),
        linear-gradient(145deg, #060606, #000 70%);
    border: 8px solid #3e3f43;
    box-shadow:
        inset 0 0 0 3px #18191b,
        inset 0 0 30px rgba(255, 255, 255, 0.04),
        0 0 0 2px #101113;
}

.watch-screen::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 24%;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.watch-crown {
    position: absolute;
    right: -22px;
    top: 21%;
    width: 28px;
    height: 82px;
    border-radius: 16px;
    background:
        repeating-linear-gradient(0deg, #26272a 0 4px, #55575d 4px 7px),
        linear-gradient(90deg, #121316, #5a5b60, #202126);
    border: 2px solid #25262a;
    box-shadow: inset 8px 0 10px rgba(0, 0, 0, 0.45), 0 0 12px rgba(255, 255, 255, 0.08);
}

.watch-side-button {
    position: absolute;
    right: -10px;
    top: 57%;
    width: 8px;
    height: 92px;
    border-radius: 8px;
    background: linear-gradient(180deg, #191a1d, #5a5b60 45%, #111214);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}

.watch-topbar {
    position: absolute;
    top: 38px;
    left: 54px;
    right: 54px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.watch-topbar h1,
.watch-topbar time {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 6.2vw, 34px);
    line-height: 1;
    font-weight: 760;
    letter-spacing: 0;
}

.status-indicator {
    top: 86px;
    left: 50%;
    z-index: 4;
    padding: 0;
    gap: 6px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    backdrop-filter: none;
}

.status-dot {
    width: 6px;
    height: 6px;
}

.assistant-orb {
    position: absolute;
    top: 27%;
    left: 50%;
    width: 52%;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 36% 30%, #fff, #f8f8f8 58%, #e9e9e9 100%);
    box-shadow:
        0 0 26px rgba(255, 255, 255, 0.72),
        0 0 58px rgba(255, 255, 255, 0.28);
    transition: width 0.28s ease, top 0.28s ease, box-shadow 0.28s ease;
}

.watch-screen:has(.dial-btn.dial-active) .assistant-orb {
    top: 31%;
    width: 24%;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.82),
        0 0 48px rgba(255, 255, 255, 0.36);
}

.start-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: 73%;
    z-index: 4;
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: clamp(17px, 4.5vw, 25px);
    font-weight: 520;
    pointer-events: none;
    letter-spacing: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.watch-screen:has(.dial-btn.dial-active) .start-hint {
    opacity: 0;
    transform: translateY(10px);
}

.control-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 52px;
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(72px, 18vw, 110px);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
}

.control-btn {
    width: 84px;
    height: 108px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.control-btn::before {
    content: "";
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    position: absolute;
    top: 0;
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.06);
}

.control-btn:hover {
    background: transparent;
    transform: translateY(-2px);
}

.control-btn:disabled {
    background: transparent;
    opacity: 0.45;
    cursor: default;
}

.control-btn .btn-icon {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    margin: 17px 0 0;
}

.control-btn .btn-text {
    position: relative;
    z-index: 1;
    width: 130px;
    color: rgba(255, 255, 255, 0.66);
    font-size: clamp(15px, 3.8vw, 20px);
    line-height: 1.15;
    font-weight: 520;
    text-align: center;
}

.dial-btn:not(.dial-active) {
    position: absolute;
    left: 50%;
    top: -255%;
    width: 52%;
    height: auto;
    aspect-ratio: 1;
    transform: translateX(-50%);
    border-radius: 50%;
    color: transparent;
}

.dial-btn:not(.dial-active)::before {
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    box-shadow: none;
}

.dial-btn:not(.dial-active) .btn-icon,
.dial-btn:not(.dial-active) .btn-text {
    display: none;
}

.dial-btn.dial-active {
    position: relative;
    width: 84px;
    height: 108px;
    background: transparent;
    color: #fff;
}

.dial-btn.dial-active::before {
    background: #ff3034;
    box-shadow: 0 0 22px rgba(255, 48, 52, 0.28);
}

.dial-btn.dial-active:hover {
    background: transparent;
}

.record-btn {
    display: none;
}

.watch-screen:has(.dial-btn.dial-active) .record-btn {
    display: flex;
}

.record-btn::before {
    background: rgba(45, 45, 45, 0.88);
}

.record-btn.recording::before {
    background: rgba(45, 45, 45, 0.88);
    animation: micPulse 1.6s ease-in-out infinite;
}

.record-btn.recording {
    background: transparent;
    animation: none;
}

@keyframes micPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.16), inset 0 0 18px rgba(255, 255, 255, 0.08);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(255, 255, 255, 0), inset 0 0 24px rgba(255, 255, 255, 0.16);
    }
}

.chat-container {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 174px;
    z-index: 5;
    width: auto;
}

.chat-stream {
    width: 100%;
    max-height: 72px;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.message-bubble {
    max-width: 100%;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
}

.chat-message.user .message-bubble,
.chat-message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.08);
}

.chat-ipt {
    display: none !important;
}

#live2d-stage {
    display: none;
}

@media (max-width: 520px) {
    .watch-shell {
        width: min(92vw, 390px);
    }

    .watch-screen {
        border-width: 6px;
    }

    .watch-topbar {
        top: 32px;
        left: 44px;
        right: 44px;
    }

    .watch-crown {
        right: -18px;
        width: 24px;
        height: 72px;
    }

    .watch-side-button {
        right: -8px;
        height: 78px;
    }

    .control-bar {
        bottom: 40px;
        gap: 64px;
    }

    .control-btn {
        width: 72px;
        height: 96px;
    }

    .control-btn::before {
        width: 64px;
        height: 64px;
    }

    .control-btn .btn-icon {
        width: 34px;
        height: 34px;
        margin-top: 15px;
    }
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ==================== 背景容器 ==================== */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../images/1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
    z-index: -2;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* ==================== 主容器 ==================== */
.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    /* 从底部开始排列 */
    padding: 20px;
    padding-bottom: 0;
    /* 移除底部padding，让模型可以延伸到页面底部 */
}

/* ==================== 模型加载区 ==================== */
.model-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 200px;
    transform: translate(-50%, -50%);
    user-select: none;
}

.model-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    background-image: linear-gradient(transparent 50%, rgba(88, 101, 242, 0.05) 50%);
    background-size: 100% 4px;
    animation: scan 1.26s linear infinite;
}

.loading-char-float {
    font-size: 22px;
    letter-spacing: 3px;
    position: relative;
}

.loading-char-float .main-char {
    color: #f0f8ff;
    text-shadow: 0 0 5px #5865f2, 0 0 10px rgba(88, 101, 242, 0.8);
    display: inline-block;
}

.loading-char-float .main-char span {
    animation: char-float 1.26s ease-in-out infinite;
    display: inline-block;
}

.loading-char-float .shadow-char {
    position: absolute;
    top: 3px;
    left: 0;
    color: rgba(88, 101, 242, 0.3);
    pointer-events: none;
    animation: shadow-float 1.26s ease-in-out infinite;
}

.loading-char-float .main-char span:nth-child(1) {
    animation-delay: 0s;
}

.loading-char-float .main-char span:nth-child(2) {
    animation-delay: 0.11s;
}

.loading-char-float .main-char span:nth-child(3) {
    animation-delay: 0.22s;
}

.loading-char-float .main-char span:nth-child(4) {
    animation-delay: 0.33s;
}

.loading-char-float .main-char span:nth-child(5) {
    animation-delay: 0.44s;
}

.loading-char-float .main-char span:nth-child(6) {
    animation-delay: 0.55s;
}

@keyframes scan {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

@keyframes char-float {

    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
        text-shadow: 0 0 5px #5865f2, 0 0 10px rgba(88, 101, 242, 0.8);
    }

    50% {
        transform: translateY(-5px);
        opacity: 0.9;
        text-shadow: 0 0 10px #5865f2, 0 0 20px rgba(88, 101, 242, 0.8);
    }
}

@keyframes shadow-float {

    0%,
    100% {
        transform: translateY(3px);
        opacity: 0.3;
    }

    50% {
        transform: translateY(8px);
        opacity: 0.15;
    }
}

/* ==================== Live2D显示区域 ==================== */
#live2d-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 100;
    pointer-events: auto;
}

.status-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-disconnected {
    background-color: #f44336;
}

.status-connecting {
    background-color: #ff9800;
}

.status-connected {
    background-color: #4caf50;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== 聊天消息流（弹幕样式） ==================== */
.chat-container {
    position: absolute;
    bottom: 150px;
    right: 20px;
    z-index: 100;
}

.chat-stream {
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    margin-bottom: 10px;
}

.chat-ipt {
    width: 100%;
    display: none;
    justify-content: center;
    margin-top: 10px;
}

.chat-ipt input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 24px;
    background: rgba(35, 39, 42, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chat-ipt input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-ipt input:focus {
    outline: none;
    border-color: rgba(88, 101, 242, 0.6);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
    background: rgba(45, 49, 52, 0.9);
}

.chat-message {
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
}

.chat-message.ai .message-bubble {
    background: transparent;
    color: white;
    align-self: flex-end;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.chat-message.user .message-bubble {
    background: rgba(88, 101, 242, 0.7);
    color: white;
    align-self: flex-start;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-message.system .message-bubble {
    background: transparent;
    color: #b9bbbe;
    align-self: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    max-width: 250px;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ==================== 底部控制栏 ==================== */
.control-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    background: rgba(35, 39, 42, 0.9);
    backdrop-filter: blur(20px);
    padding: 12px 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    /* 确保控制栏在最上层 */
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(79, 84, 92, 0.8);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.control-btn:hover {
    background: rgba(114, 137, 218, 0.8);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    background: rgba(79, 84, 92, 0.4);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
}

.control-btn:disabled:hover {
    background: rgba(79, 84, 92, 0.4);
    transform: none;
}

.btn-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.btn-text {
    font-size: 12px;
    font-weight: 500;
}

/* 拨号按钮特殊样式 */
.dial-btn.dial-active {
    background: rgba(237, 66, 69, 0.9);
}

.dial-btn.dial-active:hover {
    background: rgba(237, 66, 69, 1);
}

/* 录音按钮特殊样式 */
.control-btn.recording {
    background: rgba(237, 66, 69, 0.9);
    animation: pulse 1.5s infinite;
}

.control-btn.recording:hover {
    background: rgba(237, 66, 69, 1);
}

/* 摄像头按钮特殊样式 */
#cameraBtn.camera-active {
    background: rgba(237, 66, 69, 0.9);
}

#cameraBtn.camera-active:hover {
    background: rgba(237, 66, 69, 1);
}

/* 录音按钮脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(237, 66, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(237, 66, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(237, 66, 69, 0);
    }
}

/* ==================== 弹窗样式 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #36393f;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

.settings-modal {
    max-width: 700px;
    max-height: 85vh;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #40444b;
    background: #2f3136;
}

.modal-header h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #b9bbbe;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background: #40444b;
    color: white;
}

.modal-body {
    padding: 24px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* ==================== 输入组样式 ==================== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #b9bbbe;
    font-size: 14px;
    font-weight: 500;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #40444b;
    border-radius: 6px;
    background: #40444b;
    color: white;
    font-size: 14px;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #5865f2;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* ==================== 按钮样式 ==================== */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ==================== 文件协议警告样式 ==================== */
#fileProtocolWarning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 800px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
    border: 3px solid #4caf50;
    border-radius: 16px;
    padding: 32px;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    color: white;
    font-family: inherit;
    animation: fadeInUp 0.5s ease-out;
}

#fileProtocolWarning h2 {
    color: #e8f5e8;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#fileProtocolWarning p {
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 16px;
    color: #e8f5e8;
}

#fileProtocolWarning ol {
    margin: 16px 0;
    padding-left: 24px;
    font-size: 16px;
}

#fileProtocolWarning pre {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#fileProtocolWarning strong {
    color: #c8e6c9;
    font-weight: 600;
}

/* 背景模糊遮罩 */
.file-protocol-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ==================== 连接信息样式 ==================== */
.connection-info {
    margin-top: 20px;
    padding: 16px;
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 8px;
    text-align: center;
}

.connection-info p {
    color: #b9bbbe;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.btn-primary {
    background: #5865f2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #4752c4;
}

.btn-secondary {
    background: #4f545c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #5d6269;
}

/* ==================== 设置标签页样式 ==================== */
.settings-tabs {
    display: flex;
    border-bottom: 1px solid #40444b;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: #b9bbbe;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: white;
    border-bottom-color: #5865f2;
}

.tab-btn:hover:not(.active) {
    color: white;
    background: #40444b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== 配置面板样式 ==================== */
.config-panel {
    background: #2f3136;
    border-radius: 8px;
    padding: 20px;
}

.config-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.config-item {
    flex: 1;
}

.config-item label {
    display: block;
    margin-bottom: 6px;
    color: #b9bbbe;
    font-size: 12px;
    font-weight: 500;
}

.config-item input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #40444b;
    border-radius: 4px;
    background: #40444b;
    color: white;
    font-size: 14px;
}

.config-item textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #40444b;
    border-radius: 6px;
    background: #40444b;
    color: white;
    min-height: 100px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
}

.model-select {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid #40444b;
    border-radius: 8px;
    background: #40444b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

.model-select:hover {
    border-color: #5865f2;
}

.model-select:focus {
    outline: none;
    border-color: #5865f2;
}

.model-select option {
    background: #2f3136;
    color: #ffffff;
    padding: 12px;
    font-size: 14px;
}

.background-btn {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #40444b;
    border-radius: 8px;
    background: #40444b;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.background-btn:hover {
    background: #4f545c;
}

.background-btn:active {
    background: #40444b;
}

.background-btn .btn-icon {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

/* ==================== MCP工具样式 ==================== */
.mcp-tools-container {
    background: #2f3136;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.mcp-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #36393f;
    border-bottom: 1px solid #40444b;
}

.mcp-tools-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.mcp-tools-panel {
    padding: 20px;
}

.mcp-tools-list {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

/* MCP工具卡片样式 */
.mcp-tool-card {
    background: #36393f;
    border: 1px solid #40444b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.mcp-tool-card:hover {
    background: #40444b;
}

.mcp-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mcp-tool-name {
    font-weight: 600;
    color: white;
    font-size: 14px;
}

.mcp-tool-actions {
    display: flex;
    gap: 8px;
}

.mcp-edit-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    background-color: #2196f3;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.mcp-edit-btn:hover {
    background-color: #1976d2;
}

.mcp-delete-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    background-color: #f44336;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.mcp-delete-btn:hover {
    background-color: #d32f2f;
}

.mcp-tool-description {
    color: #b9bbbe;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.mcp-tool-info {
    background: #2f3136;
    border-radius: 4px;
    padding: 8px;
}

.mcp-tool-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.mcp-tool-info-label {
    color: #b9bbbe;
    font-size: 12px;
}

.mcp-tool-info-value {
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.mcp-actions {
    text-align: center;
}

.properties-container {
    background: #2f3136;
    border: 1px solid #40444b;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.properties-container #addMcpPropertyBtn {
    display: block;
    margin: 0 auto;
}

.properties-container #addMcpPropertyBtn:hover {
    background: #4752c4;
}

.mcp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #b9bbbe;
    font-size: 13px;
    cursor: pointer;
    justify-content: flex-start;
}

.mcp-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.mcp-property-name {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.mcp-property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mcp-properties-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 60px;
    padding: 8px;
}

.input-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.input-group-header label {
    margin-bottom: 0;
}

.input-group-header .properties-btn-primary {
    margin: 0;
}

.mcp-empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    width: 100%;
    display: none;
}

.properties-btn-primary {
    background: #2196f3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: block;
    margin: 0 auto;
}

.properties-btn-primary:hover {
    background: #2196f3;
}

.mcp-property-card {
    background: #36393f;
    border: 1px solid #40444b;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mcp-property-card:hover {
    background: #40444b;
    border-color: #5865f2;
}

.mcp-property-card:active {
    transform: none;
}

.mcp-property-row-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.mcp-property-label {
    color: #b9bbbe;
    font-size: 13px;
    width: 60px;
    flex-shrink: 0;
    text-align: left;
}

.mcp-property-value {
    color: white;
    font-size: 13px;
    flex: 1;
    word-break: break-all;
}

.mcp-property-required-badge {
    color: #f44336;
    font-size: 12px;
}

.mcp-property-row-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #40444b;
}

.mcp-property-delete-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background-color 0.2s;
}

.mcp-property-delete-btn:hover {
    background: #d32f2f;
}

.mcp-property-card-optional {
    background: #4f545c;
    color: #b9bbbe;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.property-modal {
    max-width: 450px;
}

/* ==================== 音频可视化器样式 ==================== */
.audio-visualizer {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 200px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
}

/* 滚动条样式 */
.chat-stream::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.mcp-tools-list::-webkit-scrollbar {
    width: 6px;
}

.chat-stream::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.mcp-tools-list::-webkit-scrollbar-track {
    background: #2f3136;
    border-radius: 3px;
}

.chat-stream::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.mcp-tools-list::-webkit-scrollbar-thumb {
    background: #40444b;
    border-radius: 3px;
}

.chat-stream::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.mcp-tools-list::-webkit-scrollbar-thumb:hover {
    background: #4f545c;
}

/* ==================== 摄像头显示区域样式 ==================== */
.camera-container {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 180px;
    height: 240px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: move;
}

.camera-container.active {
    display: block;
}

.camera-container.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(88, 101, 242, 0.5);
}

@keyframes flipWithPosition {
    0% {
        transform: var(--original-transform) rotateY(0deg);
    }

    100% {
        transform: var(--original-transform) rotateY(180deg);
    }
}


.camera-container.flip {
    animation: flipWithPosition 0.5s ease-in-out 1 forwards;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a1a;
    pointer-events: none;
    transform: scaleX(-1);
}

.camera-switch-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.camera-switch-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.camera-switch {
    display: none;
    height: 20px;
    color: #fff;
}

.camera-switch .btn-icon {
    margin-bottom: 0;
}

.camera-switch.active {
    display: block;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .live2d-section {
        height: 60vh;
        margin-bottom: 10px;
    }

    .live2d-canvas {
        max-width: 300px;
        max-height: 450px;
    }

    .control-bar {
        bottom: 10px;
        padding: 8px 16px;
        gap: 12px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .btn-icon {
        width: 20px;
        height: 20px;
    }

    .btn-text {
        font-size: 10px;
    }

    .chat-container {
        width: 230px;
        right: 10px;
        bottom: 105px;
    }

    .message-bubble {
        max-width: 200px;
        font-size: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .config-row {
        flex-direction: column;
        gap: 12px;
    }

    .audio-visualizer {
        width: 150px;
        height: 50px;
        left: 10px;
        bottom: 80px;
    }

    .chat-ipt input {
        font-size: 12px;
    }

    .camera-container {
        width: 130px;
        height: 180px;
    }

    .status-indicator {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .live2d-section {
        height: 50vh;
    }

    .live2d-canvas {
        max-width: 250px;
        max-height: 350px;
    }

    .control-bar {
        gap: 8px;
        padding: 6px 12px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
    }

    .btn-text {
        display: none;
    }

    .chat-stream {
        width: 200px;
        max-height: 150px;
    }

    .audio-visualizer {
        width: 120px;
        height: 40px;
        left: 5px;
        bottom: 70px;
    }
}

/* 竖屏优化 */
@media (max-height: 700px) {
    .live2d-section {
        height: 55vh;
    }

    .live2d-canvas {
        max-height: 400px;
    }

    .chat-stream {
        bottom: 70px;
        max-height: 150px;
    }

    .audio-visualizer {
        bottom: 70px;
    }
}

/* 横屏优化 */
@media (min-width: 1024px) and (min-height: 600px) {
    .live2d-section {
        height: 75vh;
    }

    .live2d-canvas {
        max-width: 500px;
        max-height: 650px;
    }

    .chat-stream {
        width: 350px;
        max-height: 250px;
    }

    .audio-visualizer {
        width: 250px;
        height: 80px;
    }
}

/* ==================== Production watch-screen UI ==================== */
html,
body {
    width: 100%;
    height: 100%;
    background: #000 !important;
}

body {
    min-height: 100vh;
    overflow: hidden;
    display: block;
    color: #fff;
}

.background-container {
    background-image: none !important;
    background: #000 !important;
}

.background-overlay,
.watch-crown,
.watch-side-button {
    display: none !important;
}

.watch-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    aspect-ratio: auto !important;
    display: block !important;
    filter: none !important;
}

.watch-screen {
    position: relative !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    box-shadow: none !important;
}

.watch-screen::before {
    display: none !important;
}

.watch-topbar {
    position: absolute !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 26px !important;
    right: 26px !important;
    z-index: 20 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    pointer-events: none !important;
}

.watch-topbar h1,
.watch-topbar time {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(26px, 9vw, 38px) !important;
    line-height: 1 !important;
    font-weight: 760 !important;
    letter-spacing: 0 !important;
}

.connection-status-top {
    display: none !important;
}

.assistant-orb {
    position: absolute !important;
    top: 28% !important;
    left: 50% !important;
    width: min(52vw, 210px) !important;
    height: auto !important;
    aspect-ratio: 1 !important;
    padding: 0 !important;
    transform: translateX(-50%) !important;
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    background: radial-gradient(circle at 36% 30%, #fff, #fafafa 58%, #ededed 100%) !important;
    box-shadow:
        0 0 24px rgba(255, 255, 255, 0.74),
        0 0 62px rgba(255, 255, 255, 0.24) !important;
    transition: top 0.24s ease, width 0.24s ease, opacity 0.2s ease !important;
}

.watch-screen:has(.dial-btn.dial-active) .assistant-orb {
    top: 32% !important;
    width: min(22vw, 96px) !important;
    cursor: default !important;
}

.start-hint {
    position: absolute !important;
    top: 72% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10 !important;
    display: block !important;
    text-align: center !important;
    color: rgba(255, 255, 255, 0.62) !important;
    font-size: clamp(20px, 6.2vw, 28px) !important;
    line-height: 1.15 !important;
    font-weight: 520 !important;
    letter-spacing: 0 !important;
    pointer-events: none !important;
}

.watch-screen:has(.dial-btn.dial-active) .start-hint {
    opacity: 0 !important;
}

.control-bar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    z-index: 30 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-end !important;
    gap: clamp(58px, 18vw, 96px) !important;
    padding: 0 !important;
    transform: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.control-btn {
    position: relative !important;
    width: 88px !important;
    height: 112px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.92) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
}

.control-btn::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    width: 72px !important;
    height: 72px !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: rgba(45, 45, 45, 0.94) !important;
}

.control-btn .btn-icon {
    position: relative !important;
    z-index: 2 !important;
    width: 38px !important;
    height: 38px !important;
    margin: 17px 0 0 !important;
}

.control-btn .btn-text {
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    width: 130px !important;
    color: rgba(255, 255, 255, 0.66) !important;
    font-size: clamp(15px, 4.6vw, 21px) !important;
    line-height: 1.08 !important;
    font-weight: 520 !important;
    text-align: center !important;
    white-space: normal !important;
}

.dial-btn.dial-active .btn-text,
.record-btn .btn-text {
    font-size: 0 !important;
}

.dial-btn.dial-active .btn-text::after,
.record-btn .btn-text::after {
    display: block !important;
    width: 130px !important;
    margin-top: 7px !important;
    font-size: clamp(15px, 4.6vw, 21px) !important;
    line-height: 1.08 !important;
    font-weight: 520 !important;
}

.dial-btn.dial-active .btn-text::after {
    content: "\6302\65ad";
}

.record-btn.recording .btn-text::after {
    content: "\5173\95ed\9ea6\514b\98ce";
}

.record-btn:not(.recording) .btn-text::after {
    content: "\6253\5f00\9ea6\514b\98ce";
}

.dial-btn:not(.dial-active) {
    display: none !important;
}

.dial-btn.dial-active {
    display: flex !important;
}

.dial-btn.dial-active::before {
    background: #ff3034 !important;
    box-shadow: 0 0 22px rgba(255, 48, 52, 0.28) !important;
}

.dial-btn.dial-active .btn-icon {
    transform: rotate(135deg) !important;
}

.record-btn {
    display: none !important;
}

.watch-screen:has(.dial-btn.dial-active) .record-btn {
    display: flex !important;
}

.record-btn.recording {
    animation: none !important;
    opacity: 1 !important;
}

.record-btn.recording::before {
    background: rgba(62, 62, 62, 0.98) !important;
}

.record-btn.muted {
    color: rgba(255, 255, 255, 0.62) !important;
    opacity: 0.74 !important;
}

.record-btn.muted::before {
    background: rgba(28, 28, 28, 0.96) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

.record-btn.recording .btn-icon {
    opacity: 1 !important;
}

.record-btn.muted .btn-icon {
    opacity: 0.62 !important;
}

.record-btn.recording .btn-icon path {
    d: path("M12,14A3,3 0 0,0 15,11V5A3,3 0 0,0 9,5V11A3,3 0 0,0 12,14M17.3,11A5.3,5.3 0 0,1 12,16.3A5.3,5.3 0 0,1 6.7,11H5A7,7 0 0,0 11,17.92V21H13V17.92A7,7 0 0,0 19,11H17.3Z") !important;
}

.record-btn.muted .btn-icon path {
    d: path("M19,11C19,12.19 18.66,13.3 18.07,14.24L16.62,12.79C16.87,12.24 17,11.63 17,11H19M15,11.16L9,5.18V5A3,3 0 0,1 15,5V11.16M4.27,3L21,19.73L19.73,21L15.54,16.81C14.77,17.27 13.91,17.58 13,17.72V21H11V17.72C7.61,17.23 5,14.32 5,10.8H7C7,13.57 9.23,15.8 12,15.8C12.35,15.8 12.69,15.76 13,15.69L11.08,13.77A3,3 0 0,1 9,10.91V10.68L3,4.27L4.27,3Z") !important;
}

.record-btn.recording::before {
    animation: watchMicPulse 1.6s ease-in-out infinite !important;
}

@keyframes watchMicPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.16);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

.chat-container {
    position: absolute !important;
    left: 22px !important;
    right: 22px !important;
    bottom: 142px !important;
    z-index: 18 !important;
    width: auto !important;
}

.chat-stream {
    width: 100% !important;
    max-height: 66px !important;
    margin: 0 !important;
    align-items: center !important;
}

.message-bubble {
    max-width: 100% !important;
    padding: 7px 10px !important;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

.chat-message.ai .message-bubble,
.chat-message.user .message-bubble {
    background: rgba(255, 255, 255, 0.08) !important;
}

.chat-ipt,
#live2d-stage {
    display: none !important;
}

@media (max-width: 220px), (max-height: 260px) {
    .watch-topbar {
        top: 14px !important;
        left: 18px !important;
        right: 18px !important;
    }

    .watch-topbar h1,
    .watch-topbar time {
        font-size: 22px !important;
    }

    .assistant-orb {
        width: 46vw !important;
    }

    .control-bar {
        bottom: 14px !important;
        gap: 36px !important;
    }

    .control-btn {
        width: 70px !important;
        height: 92px !important;
    }

    .control-btn::before {
        width: 58px !important;
        height: 58px !important;
    }

    .control-btn .btn-icon {
        width: 30px !important;
        height: 30px !important;
        margin-top: 14px !important;
    }

    .control-btn .btn-text {
        width: 96px !important;
        font-size: 14px !important;
    }
}

/* ==================== Swipe pages and history screen ==================== */
.watch-pages {
    position: fixed !important;
    inset: 0 !important;
    width: 200vw !important;
    height: 100vh !important;
    display: flex !important;
    transition: transform 0.24s ease-out !important;
    will-change: transform !important;
}

.watch-pages .watch-screen {
    flex: 0 0 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
}

.home-page .chat-container {
    display: none !important;
}

.page-indicator {
    position: fixed !important;
    left: 50% !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    z-index: 50 !important;
    display: flex !important;
    gap: 6px !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
}

.page-dot {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.22) !important;
}

.page-dot.active {
    background: rgba(255, 255, 255, 0.74) !important;
}

.history-page {
    padding: 0 !important;
    background: #000 !important;
}

.history-topbar {
    position: absolute !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 24px !important;
    right: 24px !important;
    z-index: 5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.history-topbar h2,
.history-topbar time {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(23px, 8vw, 34px) !important;
    line-height: 1 !important;
    font-weight: 760 !important;
    letter-spacing: 0 !important;
}

.history-page .chat-container {
    display: block !important;
    position: absolute !important;
    inset: 70px 14px 22px !important;
    width: auto !important;
    z-index: 2 !important;
}

.history-page .chat-stream {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 8px 0 12px !important;
    pointer-events: auto !important;
    scrollbar-width: none !important;
}

.history-page .chat-stream::-webkit-scrollbar {
    display: none !important;
}

.history-page .chat-message {
    display: flex !important;
    width: 100% !important;
    animation: none !important;
}

.history-page .chat-message.user {
    justify-content: flex-end !important;
}

.history-page .chat-message.ai {
    justify-content: flex-start !important;
}

.history-page .message-bubble {
    max-width: 78% !important;
    padding: 8px 10px !important;
    border-radius: 14px !important;
    border: 0 !important;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: clamp(13px, 4.4vw, 17px) !important;
    line-height: 1.35 !important;
    text-align: left !important;
    word-break: break-word !important;
    text-shadow: none !important;
}

.history-page .chat-message.ai .message-bubble {
    background: rgba(255, 255, 255, 0.12) !important;
}

.history-page .chat-message.user .message-bubble {
    background: rgba(255, 255, 255, 0.28) !important;
}

.chat-empty {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    color: rgba(255, 255, 255, 0.42) !important;
    font-size: clamp(15px, 5vw, 20px) !important;
    pointer-events: none !important;
}

.chat-empty.hidden {
    display: none !important;
}

.history-page .chat-ipt {
    display: none !important;
}

body.show-history .page-indicator {
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
}

/* ==================== Orb voice response ==================== */
.assistant-orb {
    --orb-scale: 1;
    --orb-wave-opacity: 0;
    --orb-wave-soft-opacity: 0;
    --orb-glow-near: 28px;
    --orb-glow-far: 62px;
    top: 24% !important;
    width: min(68vw, 280px) !important;
    transform: translateX(-50%) scale(var(--orb-scale)) !important;
    overflow: visible !important;
}

.watch-screen:has(.dial-btn.dial-active) .assistant-orb {
    top: 32% !important;
    width: min(22vw, 96px) !important;
}

.assistant-orb::before,
.assistant-orb::after {
    content: "" !important;
    position: absolute !important;
    inset: -10% !important;
    z-index: -1 !important;
    border-radius: 46% 54% 50% 50% / 54% 46% 52% 48% !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(1) rotate(0deg) !important;
}

.assistant-orb.speaking {
    box-shadow:
        0 0 var(--orb-glow-near) rgba(255, 255, 255, 0.84),
        0 0 var(--orb-glow-far) rgba(255, 255, 255, 0.32) !important;
}

.assistant-orb.speaking::before {
    opacity: var(--orb-wave-opacity) !important;
    background:
        radial-gradient(circle, transparent 58%, rgba(255, 255, 255, 0.82) 62%, transparent 70%),
        conic-gradient(from 20deg, transparent, rgba(255, 255, 255, 0.42), transparent, rgba(255, 255, 255, 0.26), transparent) !important;
    filter: blur(6px) !important;
    animation: orbWaveA 2.4s ease-in-out infinite !important;
}

.assistant-orb.speaking::after {
    inset: -18% !important;
    opacity: var(--orb-wave-soft-opacity) !important;
    background: radial-gradient(circle, transparent 54%, rgba(255, 255, 255, 0.45) 61%, transparent 73%) !important;
    filter: blur(10px) !important;
    animation: orbWaveB 3.2s ease-in-out infinite reverse !important;
}

@keyframes orbWaveA {
    0%,
    100% {
        border-radius: 46% 54% 50% 50% / 54% 46% 52% 48%;
        transform: scale(1.06) rotate(0deg);
    }

    50% {
        border-radius: 56% 44% 53% 47% / 44% 56% 45% 55%;
        transform: scale(1.18) rotate(18deg);
    }
}

@keyframes orbWaveB {
    0%,
    100% {
        border-radius: 52% 48% 43% 57% / 46% 57% 43% 54%;
        transform: scale(1.12) rotate(0deg);
    }

    50% {
        border-radius: 42% 58% 55% 45% / 58% 42% 56% 44%;
        transform: scale(1.28) rotate(-22deg);
    }
}
