:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6e9cd2;
    --accent-color: #ff6b6b;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --gray-light: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --chat-glass-opacity: 0.62;
    --chat-glass-soft-opacity: 0.74;
    --chat-glass-strong-opacity: 0.84;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    min-height: 100vh;
}

input,
textarea,
select,
button {
    font-size: 16px;
}

.ai-container {
    max-width: 1400px!important;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin: 0;
}

header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.chat-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 700px;
    backdrop-filter: blur(10px);
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-status {
    background-color: var(--success-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
}

.user-message .message-stack {
    align-items: flex-end;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.user-message .avatar {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ff8e8e 100%);
}

.message-content {
    background-color: var(--light-color);
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
}

.message-sender {
    font-weight: 600;
    font-size: 0.66rem;
    line-height: 1;
    margin: 0 10px 4px;
    color: var(--primary-color);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    opacity: 0.78;
}

.user-message .message-sender {
    color: var(--accent-color);
}

.message-time {
    font-size: 0.62rem;
    line-height: 1;
    color: rgba(71, 85, 105, 0.72);
    font-weight: 500;
}

.user-message .message-time {
    color: rgba(239, 68, 68, 0.72);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 15px;
    color: #6c757d;
    font-size: 0.9rem;
    display: none;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input {
    padding: 20px;
    border-top: 1px solid var(--gray-light);
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-container input {
    flex: 1;
    padding: 15px;
    border: 1px solid var(--gray-light);
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.input-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.input-container button {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74, 111, 165, 0.3);
}

.suggestions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.suggestions span {
    font-size: 0.9rem;
    color: #6c757d;
}

.suggestion-btn {
    padding: 8px 15px;
    background-color: var(--light-color);
    border: 1px solid var(--gray-light);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.product-links, .stats-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    backdrop-filter: blur(10px);
}

.product-links h3, .stats-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--dark-color);
    transition: var(--transition);
}

.product-card:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.product-card i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.stats-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 加载动画 */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: var(--transition);
}

.loader-wrapper.active {
    visibility: visible;
    opacity: 1;
}

.loader {
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 5px solid var(--gray-light);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1.1rem;
    color: var(--dark-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .chat-container {
        height: 600px;
    }
}

@media (max-width: 576px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .message {
        max-width: 90%;
    }

    .suggestions {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* 导航栏样式 */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.7rem;
}

/* 产品详情容器 */
.product-detail-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

/* 产品头部信息 */
.product-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.product-image {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info h1 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 2rem;
}

.product-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.brand, .category {
    padding: 5px 12px;
    background-color: var(--light-color);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.rating-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.average-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stars {
    font-size: 1.5rem;
    color: var(--warning-color);
    margin-bottom: 10px;
}

.rating-count {
    color: #6c757d;
    font-size: 0.9rem;
}

.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-level {
    width: 30px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--warning-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 标签导航 */
.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 标签内容 */
.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 评价筛选器 */
.review-filters {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.9rem;
    color: #6c757d;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    background-color: white;
}

.filter-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--secondary-color);
}

/* 评价列表 */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.review-card {
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
}

.review-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.reviewer-name {
    font-weight: 500;
}

.review-date {
    font-size: 0.9rem;
    color: #6c757d;
}

.review-rating {
    color: var(--warning-color);
    font-size: 1.1rem;
}

.review-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
    font-size: 1.1rem;
}

.review-text {
    margin-bottom: 15px;
    line-height: 1.6;
}

.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-helpful {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}

.helpful-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    transition: var(--transition);
}

.helpful-btn:hover {
    color: var(--primary-color);
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 15px;
    background-color: var(--light-color);
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-info {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 规格表格 */
.specs-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.spec-row {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-name {
    width: 150px;
    padding: 15px;
    background-color: var(--light-color);
    font-weight: 500;
}

.spec-value {
    flex: 1;
    padding: 15px;
}

/* 问答区域 */
.qa-section .chat-container {
    height: 500px;
}

/* 底部信息 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .product-header {
        grid-template-columns: 1fr;
    }

    .rating-overview {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nav-menu {
        display: none;
    }
}

@media (max-width: 768px) {
    .review-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .spec-row {
        flex-direction: column;
    }

    .spec-name {
        width: 100%;
        border-bottom: 1px solid var(--gray-light);
    }
}

/* Pure chat workspace */
.chat-app-body {
    background:
        radial-gradient(circle at 12% 12%, rgba(110, 156, 210, 0.22), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(255, 107, 107, 0.12), transparent 26%),
        linear-gradient(135deg, #edf4fb 0%, #f7fafc 46%, #e8f0f8 100%);
    width: 100%;
    min-height: var(--chat-viewport-height, 100vh);
    overflow: hidden;
    position: relative;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.chat-app-body *,
.chat-app-body *::before,
.chat-app-body *::after {
    box-sizing: border-box;
}

.chat-app-body.has-app-background::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--chat-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: none;
    opacity: 1;
    z-index: -2;
}

.chat-app-body.has-app-background::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(245, 249, 252, 0.06), rgba(235, 243, 250, 0.03));
    z-index: -1;
    pointer-events: none;
}

.chat-app-body.has-app-background .chat-workspace {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: none;
}

.chat-app-body.has-app-background .chat-sidebar {
    background:
        linear-gradient(180deg, rgba(23, 32, 51, 0.30), rgba(23, 32, 51, 0.18));
    backdrop-filter: none;
}

.chat-app-body.has-app-background .workspace-bar {
    background:
        linear-gradient(180deg, rgba(23, 32, 51, 0.30), rgba(23, 32, 51, 0.16));
    backdrop-filter: none;
}

.chat-app-body.has-app-background .brand-mark,
.chat-app-body.has-app-background .workspace-title,
.chat-app-body.has-app-background .session-item,
.chat-app-body.has-app-background .settings-title,
.chat-app-body.has-app-background .setting-field,
.chat-app-body.has-app-background .setting-check {
    color: #fff;
    text-shadow:
        0 1px 2px rgba(8, 13, 24, 0.92),
        0 0 10px rgba(8, 13, 24, 0.46);
}

.chat-app-body.has-app-background .session-item {
    font-weight: 600;
    background: rgba(15, 23, 42, 0.18);
    border-color: rgba(255, 255, 255, 0.16);
}

.chat-app-body.has-app-background .session-item:hover,
.chat-app-body.has-app-background .session-item.is-active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.34);
}

.chat-app-body.has-app-background .workspace-subtitle {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.chat-app-body.has-app-background .composer textarea {
    color: #111827;
}

.chat-app-body.has-app-background .composer textarea::placeholder {
    color: rgba(17, 24, 39, 0.62);
}

.chat-app-body.has-app-background .icon-button,
.chat-app-body.has-app-background .session-action,
.chat-app-body.has-app-background .page-nav-link {
    color: #fff;
    text-shadow: 0 1px 2px rgba(8, 13, 24, 0.72);
}

.chat-app-body.has-app-background .workspace-page-nav {
    background:
        linear-gradient(180deg, rgba(23, 32, 51, 0.24), rgba(23, 32, 51, 0.12));
    backdrop-filter: none;
}

.chat-app-body.has-app-background .page-nav-link {
    background: rgba(15, 23, 42, 0.18);
    border-color: rgba(255, 255, 255, 0.18);
}

.chat-app-body.has-app-background .brand-icon {
    box-shadow:
        0 6px 18px rgba(23, 32, 51, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chat-app-body.has-app-background .session-title-button {
    color: #fff;
    text-shadow:
        0 1px 2px rgba(8, 13, 24, 0.92),
        0 0 10px rgba(8, 13, 24, 0.46);
}

.chat-app {
    height: var(--chat-viewport-height, 100vh);
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    color: #243043;
    padding: 14px;
    gap: 14px;
}

.chat-sidebar,
.session-list,
.chat-workspace,
.messages-panel,
.settings-drawer,
.code-block pre {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-sidebar:hover,
.session-list:hover,
.chat-workspace:hover,
.messages-panel:hover,
.settings-drawer:hover,
.code-block pre:hover,
.chat-sidebar:focus-within,
.session-list:focus-within,
.chat-workspace:focus-within,
.messages-panel:focus-within,
.settings-drawer:focus-within,
.code-block pre:focus-within {
    scrollbar-color: rgba(74, 111, 165, 0.42) transparent;
}

.chat-sidebar::-webkit-scrollbar,
.session-list::-webkit-scrollbar,
.chat-workspace::-webkit-scrollbar,
.messages-panel::-webkit-scrollbar,
.settings-drawer::-webkit-scrollbar,
.code-block pre::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.chat-sidebar::-webkit-scrollbar-track,
.session-list::-webkit-scrollbar-track,
.chat-workspace::-webkit-scrollbar-track,
.messages-panel::-webkit-scrollbar-track,
.settings-drawer::-webkit-scrollbar-track,
.code-block pre::-webkit-scrollbar-track {
    background: transparent;
}

.chat-sidebar::-webkit-scrollbar-thumb,
.session-list::-webkit-scrollbar-thumb,
.chat-workspace::-webkit-scrollbar-thumb,
.messages-panel::-webkit-scrollbar-thumb,
.settings-drawer::-webkit-scrollbar-thumb,
.code-block pre::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
    background-color: transparent;
}

.chat-sidebar:hover::-webkit-scrollbar-thumb,
.session-list:hover::-webkit-scrollbar-thumb,
.chat-workspace:hover::-webkit-scrollbar-thumb,
.messages-panel:hover::-webkit-scrollbar-thumb,
.settings-drawer:hover::-webkit-scrollbar-thumb,
.code-block pre:hover::-webkit-scrollbar-thumb,
.chat-sidebar:focus-within::-webkit-scrollbar-thumb,
.session-list:focus-within::-webkit-scrollbar-thumb,
.chat-workspace:focus-within::-webkit-scrollbar-thumb,
.messages-panel:focus-within::-webkit-scrollbar-thumb,
.settings-drawer:focus-within::-webkit-scrollbar-thumb,
.code-block pre:focus-within::-webkit-scrollbar-thumb {
    background-color: rgba(74, 111, 165, 0.42);
}

.chat-sidebar::-webkit-scrollbar-thumb:hover,
.session-list::-webkit-scrollbar-thumb:hover,
.chat-workspace::-webkit-scrollbar-thumb:hover,
.messages-panel::-webkit-scrollbar-thumb:hover,
.settings-drawer::-webkit-scrollbar-thumb:hover,
.code-block pre::-webkit-scrollbar-thumb:hover {
    background-color: rgba(74, 111, 165, 0.62);
}

.settings-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    margin: 8px 0 4px;
}

.settings-section-title {
    font-weight: 600;
    font-size: 0.9em;
    color: rgba(0, 0, 0, 0.6);
    padding: 4px 0;
}

.settings-api-group {
    min-width: 0;
    max-width: 100%;
    margin: 0 0 18px;
    padding: 14px 14px 2px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.settings-api-group + .setting-field {
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.settings-api-group .settings-divider {
    margin: 10px 0 6px;
}

.workflow-settings-group {
    display: grid;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    margin: 6px 0 14px;
}

.workflow-setting-card {
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    border: 1px solid rgba(107, 126, 153, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.workflow-setting-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: #1f2937;
    font-size: 0.94rem;
    font-weight: 700;
}

.workflow-setting-head small {
    color: rgba(71, 85, 105, 0.56);
    font-size: 0.74rem;
    font-weight: 600;
}

.workflow-setting-card .setting-field {
    margin-bottom: 10px;
}

.workflow-setting-card .setting-field:last-child {
    margin-bottom: 0;
}

.sidebar-collapsed .chat-app {
    grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar-collapsed .chat-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-18px);
}

.chat-sidebar {
    background: rgba(255, 255, 255, var(--chat-glass-opacity));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 18px 55px rgba(74, 111, 165, 0.14);
    backdrop-filter: blur(18px) saturate(1.18);
    overflow: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.sidebar-top,
.workspace-bar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 700;
}

.brand-mark i,
.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
}

.brand-icon {
    background-size: cover;
    background-position: center;
    flex: 0 0 auto;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 12px;
    background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(12px);
}

.icon-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.site-message-button {
    position: relative;
}

.site-message-button.has-unread {
    border-color: rgba(37, 99, 235, 0.42);
    color: var(--primary-color);
}

.site-message-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
}

.chat-header-clear-button {
    border-color: rgba(251, 113, 133, 0.36);
    color: #be123c;
}

.chat-header-clear-button:hover {
    border-color: rgba(251, 113, 133, 0.72);
    background: rgba(255, 241, 244, 0.82);
    color: #9f1239;
}

.chat-header-clear-button:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.session-list {
    flex: 1;
    overflow: auto;
    padding: 8px 12px 18px;
}

.session-item {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    padding: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px repeat(2, 30px);
    align-items: center;
    gap: 4px;
}

.session-item:hover,
.session-item.is-active {
    background: rgba(255, 255, 255, 0.62);
    color: var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(74, 111, 165, 0.14);
}

.session-title-button,
.session-action {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.session-title-button {
    min-width: 0;
    text-align: left;
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-action {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.56;
    transition: var(--transition);
}

.session-item:hover .session-action,
.session-item:focus-within .session-action {
    opacity: 0.72;
}

.session-action:hover {
    opacity: 1;
    background: rgba(74, 111, 165, 0.12);
}

.chat-workspace {
    position: relative;
    min-width: 0;
    height: calc(var(--chat-viewport-height, 100vh) - 28px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.72));
    box-shadow: 0 18px 60px rgba(74, 111, 165, 0.16);
    backdrop-filter: blur(18px) saturate(1.14);
    overflow: hidden;
}

.workspace-bar {
    background: rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.68));
    border-bottom: 1px solid rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(16px);
    margin: 0;
    text-align: left;
}

.workspace-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workspace-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.workspace-subtitle {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--success-color);
    margin-top: 0;
    font-size: 0;
    flex: 0 0 auto;
}

.workspace-subtitle.is-busy {
    background: var(--danger-color);
    animation: progressPulse 1.1s ease-in-out infinite;
}

.session-id-copy-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.session-id-copy-button:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4f46e5;
}

.session-id-copy-button i {
    font-size: 0.7rem;
}

.toolbar {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.session-processing {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0;
}

.session-item.is-processing .session-processing {
    opacity: 0.88;
}

.session-processing i {
    font-size: 13px;
    animation: spin 1s linear infinite;
}

.workspace-page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.54));
    border-bottom: 1px solid rgba(255, 255, 255, 0.48);
    overflow-x: auto;
    scrollbar-width: none;
}

.workspace-page-nav::-webkit-scrollbar {
    display: none;
}

.page-nav-link {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.page-nav-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.page-nav-more-button,
.sign-command-more-button {
    display: none;
}

.messages-panel {
    position: relative;
    overflow: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    isolation: isolate;
    padding: 42px min(7vw, 88px) 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    transition: background-image 0.2s ease;
}

.message-scroll-tools {
    position: absolute;
    right: min(5vw, 34px);
    bottom: 128px;
    z-index: 30;
    display: grid;
    gap: 8px;
}

.message-scroll-tools.is-hidden {
    display: none;
}

.message-scroll-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.54);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.message-scroll-button:hover {
    transform: translateY(-1px);
    background: rgba(37, 99, 235, 0.76);
}

.chat-top-chip-row {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 40;
    min-height: 16px;
    margin: 0;
    padding: 2px 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.model-chip {
    flex: 0 0 auto;
    margin: 0;
    padding: 1px 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
    color: rgba(248, 251, 255, 0.70);
    font-size: 8px;
    line-height: 1.35;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.codex-media-task-dock {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    pointer-events: none;
}

.codex-media-task-dock.is-empty {
    display: none;
}

.codex-media-task-pill {
    max-width: min(210px, 42%);
    min-width: 0;
    min-height: 16px;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.20);
    color: rgba(248, 251, 255, 0.78);
    cursor: pointer;
    font-size: 8px;
    line-height: 1.25;
    pointer-events: auto;
    backdrop-filter: blur(5px);
}

.codex-media-task-pill:hover {
    background: rgba(15, 138, 106, 0.42);
}

.codex-media-task-pill.done {
    background: rgba(15, 138, 106, 0.30);
}

.codex-media-task-pill.error {
    background: rgba(167, 71, 32, 0.38);
}

.codex-media-task-status {
    flex: 0 0 auto;
    font-weight: 700;
}

.codex-media-task-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messages-panel.has-chat-background {
    background: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.messages-panel .message {
    max-width: min(780px, 88%);
    position: relative;
    z-index: 1;
}

.messages-panel.has-chat-background .message-content {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.50), rgba(15, 23, 42, 0.34));
    color: #f8fbff;
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 16px 38px rgba(8, 13, 24, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
    text-shadow: 0 1px 2px rgba(8, 13, 24, 0.72);
    backdrop-filter: none;
}

.messages-panel.has-chat-background .user-message .message-content {
    background:
        linear-gradient(180deg, rgba(74, 111, 165, 0.62), rgba(49, 80, 126, 0.46));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.36);
}

.messages-panel.has-chat-background .message-sender {
    color: #dbeafe;
    font-weight: 700;
    text-shadow:
        0 1px 2px rgba(8, 13, 24, 0.86),
        0 0 10px rgba(8, 13, 24, 0.36);
}

.messages-panel.has-chat-background .user-message .message-sender {
    color: rgba(255, 255, 255, 0.82);
}

.messages-panel.has-chat-background .message-content p,
.messages-panel.has-chat-background .message-content li,
.messages-panel.has-chat-background .message-content div {
    color: inherit;
}

.messages-panel.has-chat-background .thinking-toggle {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.80));
    color: #0f172a;
    border-color: rgba(255, 255, 255, 0.62);
    box-shadow:
        0 10px 26px rgba(8, 13, 24, 0.24),
        0 0 0 1px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    text-shadow: none;
    backdrop-filter: blur(12px) saturate(1.18);
}

.messages-panel.has-chat-background .thinking-toggle:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.88));
    border-color: rgba(255, 255, 255, 0.78);
}

.messages-panel.has-chat-background .thinking-mark {
    color: #2563eb;
    filter: drop-shadow(0 1px 2px rgba(37, 99, 235, 0.28));
}

.messages-panel.has-chat-background .thinking-body {
    color: #f8fbff;
    border-left-color: rgba(255, 255, 255, 0.46);
    text-shadow: 0 1px 2px rgba(8, 13, 24, 0.72);
}

.messages-panel.has-chat-background .message-time {
    color: rgba(248, 251, 255, 0.72);
}

.chat-app-body.has-app-background .composer {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.72)), rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.50)));
    backdrop-filter: blur(8px) saturate(1.08);
}

.chat-app-body.has-app-background .sign-command-bar {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.20), rgba(15, 23, 42, 0.10));
}

.chat-app-body.has-app-background .sign-command-button {
    background: rgba(15, 23, 42, 0.18);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-shadow: 0 1px 2px rgba(8, 13, 24, 0.72);
}

.chat-app-body.has-app-background .clear-chat-button {
    background:
        linear-gradient(180deg, rgba(244, 63, 94, 0.22), rgba(127, 29, 29, 0.18)),
        rgba(15, 23, 42, 0.22);
    border-color: rgba(251, 113, 133, 0.36);
    color: #fff5f6;
}

.chat-app-body.has-app-background .quick-command-divider {
    background: rgba(255, 255, 255, 0.24);
}

.message-content {
    position: relative;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow:
        0 12px 34px rgba(30, 41, 59, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.message-inline-actions {
    position: absolute;
    top: 7px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.message-content:hover .message-inline-actions,
.message-content:focus-within .message-inline-actions {
    opacity: 1;
    pointer-events: auto;
}

.message.is-tools-idle .message-inline-actions,
.message.is-tools-idle .message-content:hover .message-inline-actions,
.message.is-tools-idle .message-content:focus-within .message-inline-actions {
    opacity: 0;
    pointer-events: none;
}

.message-metrics {
    position: relative;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.48);
    color: rgba(71, 85, 105, 0.64);
    font-size: 0.62rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(1px);
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.message-metrics i {
    font-size: 0.62rem;
}

.message-metrics span {
    display: inline;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}

.message-metrics::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 7px);
    z-index: 30;
    width: max-content;
    max-width: min(520px, calc(100vw - 40px));
    padding: 8px 10px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    font-size: 0.74rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    transform: translateY(3px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.message-metrics:hover::after,
.message-metrics:focus-visible::after,
.message-metrics.is-open::after {
    opacity: 1;
    transform: translateY(0);
}

.message-metrics:hover,
.message-metrics:focus-visible,
.message-metrics.is-open {
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    transform: translateY(-1px);
}

.message:hover .message-metrics,
.message:focus-within .message-metrics,
.message.is-tools-open .message-metrics,
.message-metrics.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.message-action-row {
    display: flex;
    align-items: center;
    gap: 1px;
    width: fit-content;
    max-width: 100%;
    margin-top: -6px;
    margin-left: 12px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.34));
    box-shadow:
        0 5px 14px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(10px) saturate(1.08);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.message-action-row .message-metrics {
    margin-left: 0;
}

.message:hover .message-action-row,
.message:focus-within .message-action-row,
.message.is-tools-open .message-action-row,
.message-action-row:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.message.is-tools-idle .message-metrics,
.message.is-tools-idle:hover .message-metrics,
.message.is-tools-idle:focus-within .message-metrics,
.message.is-tools-idle .message-metrics.is-open,
.message.is-tools-idle .message-action-row,
.message.is-tools-idle:hover .message-action-row,
.message.is-tools-idle:focus-within .message-action-row,
.message.is-tools-idle .message-action-row:hover {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
}

.user-message-actions {
    align-self: flex-end;
    margin-right: 12px;
    margin-left: 0;
}

.message-quick-action {
    position: relative;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(71, 85, 105, 0.64);
    cursor: pointer;
    font-size: 0.62rem;
    line-height: 1;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.message-sender .message-top-action {
    width: 18px;
    height: 18px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(1px);
}

.message:hover .message-sender .message-top-action,
.message:focus-within .message-sender .message-top-action,
.message.is-tools-open .message-sender .message-top-action,
.message-sender .message-top-action.is-done {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.message.is-tools-idle .message-sender .message-top-action,
.message.is-tools-idle:hover .message-sender .message-top-action,
.message.is-tools-idle:focus-within .message-sender .message-top-action,
.message.is-tools-idle .message-sender .message-top-action.is-done {
    opacity: 0;
    pointer-events: none;
    transform: translateY(1px);
}

.message-quick-action::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 7px);
    z-index: 30;
    width: max-content;
    max-width: 160px;
    padding: 4px 7px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.message-quick-action:hover,
.message-quick-action.is-done {
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    transform: translateY(-1px);
}

.message-delete-button:hover {
    background: rgba(220, 38, 38, 0.10);
    color: #dc2626;
}

.message-quick-action:hover::after,
.message-quick-action.is-done::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (hover: none) {
    .message-metrics {
        cursor: pointer;
    }

    .message-action-row {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-2px);
    }

    .message.is-tools-open .message-action-row {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .message-sender .message-top-action {
        opacity: 0;
        pointer-events: none;
        transform: translateY(1px);
    }

    .message.is-tools-open .message-sender .message-top-action,
    .message-sender .message-top-action.is-done {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .message-metrics::after {
        left: 50%;
        bottom: calc(100% + 8px);
        width: min(320px, calc(100vw - 32px));
        transform: translate(-50%, 3px);
    }

    .message-metrics.is-open::after {
        transform: translate(-50%, 0);
    }
}

@media (max-width: 760px) {
    .message-metrics {
        min-width: 0;
        height: 18px;
        margin-top: 0;
        margin-left: 0;
        padding: 0 6px;
        justify-content: center;
        gap: 4px;
        border: 1px solid rgba(148, 163, 184, 0.16);
        background: rgba(255, 255, 255, 0.46);
        color: rgba(71, 85, 105, 0.62);
        box-shadow: none;
        backdrop-filter: none;
    }

    .message-metrics span {
        display: inline;
        font-size: 0.58rem;
    }

    .message-metrics i {
        font-size: 0.58rem;
    }

    .message-metrics::after {
        left: 0;
        bottom: calc(100% + 6px);
        width: min(250px, calc(100vw - 92px));
        padding: 6px 8px;
        border-color: rgba(100, 116, 139, 0.16);
        border-radius: 8px;
        background: rgba(248, 251, 255, 0.92);
        color: #475569;
        box-shadow: 0 10px 24px rgba(71, 85, 105, 0.16);
        font-size: 0.66rem;
        line-height: 1.45;
        transform: translateY(3px);
        backdrop-filter: blur(10px) saturate(1.04);
    }

    .message-metrics.is-open::after {
        transform: translateY(0);
    }

    .bot-message .message-metrics {
        margin-left: 0;
    }

    .message-action-row .message-metrics {
        margin-left: 0;
    }

    .message-action-row {
        gap: 1px;
        margin-top: -5px;
        margin-left: 10px;
        padding: 1px;
    }

    .message-quick-action {
        width: 17px;
        height: 17px;
        font-size: 0.58rem;
    }

    .user-message-actions {
        margin-right: 10px;
        margin-left: 0;
    }
}

.message-inline-action {
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(37, 99, 235, 0.20);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.76);
    color: #2563eb;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.message-inline-action:hover {
    background: rgba(37, 99, 235, 0.12);
}

.scheduler-chat-list {
    display: grid;
    gap: 8px;
    width: min(920px, calc(100vw - 128px));
    max-width: 100%;
}

.scheduler-chat-list-head {
    font-weight: 800;
    line-height: 1.45;
}

.scheduler-chat-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    contain: paint;
}

.scheduler-chat-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
}

.scheduler-chat-table th,
.scheduler-chat-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    text-align: left;
    vertical-align: top;
    line-height: 1.45;
}

.scheduler-chat-table th {
    background: rgba(15, 23, 42, 0.32);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
}

.scheduler-chat-table tr:last-child td {
    border-bottom: 0;
}

.scheduler-chat-task-name-cell {
    width: 25%;
}

.scheduler-chat-cron {
    width: 13%;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.scheduler-chat-cron-expression,
.scheduler-chat-cron-description {
    display: block;
    overflow-wrap: anywhere;
}

.scheduler-chat-cron-description {
    margin-top: 5px;
    color: rgba(191, 219, 254, 0.96);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.42;
}

.scheduler-chat-status,
.scheduler-chat-push {
    width: 13%;
}

.scheduler-chat-time {
    width: 22%;
}

.scheduler-chat-action-cell {
    width: 14%;
}

.scheduler-chat-task-title {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.scheduler-chat-task-id,
.scheduler-chat-time span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.scheduler-chat-status {
    font-weight: 800;
    color: rgba(187, 247, 208, 0.96);
}

.scheduler-chat-status.is-error {
    color: rgba(254, 202, 202, 0.98);
}

.scheduler-chat-task-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.scheduler-chat-task-action {
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.20);
    color: inherit;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.scheduler-chat-task-action:hover {
    background: rgba(37, 99, 235, 0.26);
    border-color: rgba(255, 255, 255, 0.46);
}

.scheduler-chat-task-action-delete:hover {
    background: rgba(220, 38, 38, 0.28);
}

.message-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.message-link:hover {
    text-decoration: underline;
}

.file-info-block {
    margin: 10px 0 14px;
    padding: 2px 0 2px 10px;
    border-left: 3px solid rgba(37, 99, 235, 0.36);
    display: grid;
    gap: 5px;
}

.file-info-line {
    color: rgba(248, 250, 252, 0.94);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.messages-panel:not(.has-chat-background) .file-info-line {
    color: rgba(30, 41, 59, 0.88);
}

.file-info-title {
    margin-bottom: 2px;
    font-weight: 800;
}

.file-action-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.file-action-line .message-link {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-action-label {
    flex: 0 0 auto;
    font-weight: 700;
}

.file-action-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.68);
    color: #2563eb;
    cursor: pointer;
    font-size: 0.78rem;
}

.file-action-icon:hover {
    background: rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.file-media-previews {
    display: grid;
    gap: 6px;
    margin: 8px 0 10px;
}

.file-media-preview {
    margin: 0;
    max-width: min(520px, 100%);
}

.file-media-frame {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: rgba(255, 255, 255, 0.28);
}

.file-media-frame.is-placeholder {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-media-frame img,
.file-media-frame video {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    background: rgba(15, 23, 42, 0.08);
}

.file-media-frame img {
    cursor: zoom-in;
}

.file-media-open {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.64);
    color: #2563eb;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
}

.file-media-open:hover {
    background: rgba(37, 99, 235, 0.10);
}

.file-media-expand {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.62);
    color: #fff;
    cursor: pointer;
}

.file-media-preview figcaption {
    display: none;
}

.codex-chat-assets {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    overflow-anchor: none;
}

.codex-chat-assets.is-album {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: min(560px, 100%);
}

.codex-chat-asset {
    position: relative;
    margin: 0;
    border: 1px solid rgba(107, 126, 153, 0.22);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
    overflow-anchor: none;
}

.codex-chat-asset img,
.codex-chat-asset video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--codex-chat-asset-ratio, auto);
    overflow-anchor: none;
}

.codex-chat-asset img {
    cursor: zoom-in;
}

.codex-chat-asset video {
    max-height: min(58vh, 520px);
    background: #0f172a;
}

.codex-chat-asset img.is-loading,
.codex-chat-asset video.is-loading {
    aspect-ratio: var(--codex-chat-asset-ratio, 4 / 3);
    min-height: 180px;
    background:
        linear-gradient(135deg, rgba(226, 232, 240, 0.72), rgba(248, 250, 252, 0.92));
}

.codex-chat-asset-cache-status {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.64);
    color: #fff;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
    overflow-anchor: none;
}

.codex-chat-assets.is-album .codex-chat-asset img,
.codex-chat-assets.is-album .codex-chat-asset video {
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
}

.codex-chat-asset-index {
    position: absolute;
    top: 7px;
    right: 7px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.codex-chat-asset-expand {
    position: absolute;
    left: 7px;
    top: 7px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.58);
    color: #fff;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.codex-chat-asset:hover .codex-chat-asset-expand,
.codex-chat-asset:focus-within .codex-chat-asset-expand {
    opacity: 1;
}

.codex-chat-asset-expand:hover {
    transform: scale(1.04);
}

.codex-chat-asset figcaption {
    padding: 8px 10px;
    border-top: 1px solid rgba(107, 126, 153, 0.18);
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.35;
}

.chat-image-prompt-summary {
    margin-top: 9px;
}

.chat-image-prompt-summary-toggle {
    width: fit-content;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(248, 250, 252, 0.82);
    color: #2563eb;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 800;
    list-style: none;
}

.chat-image-prompt-summary-toggle::-webkit-details-marker {
    display: none;
}

.chat-image-prompt-summary[open] .chat-image-prompt-summary-toggle {
    background: rgba(37, 99, 235, 0.10);
}

.chat-image-prompt-summary-toggle small {
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
}

.chat-image-prompt-summary-body {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.chat-image-prompt-image {
    display: grid;
    gap: 8px;
}

.chat-image-prompt-image-head {
    width: fit-content;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(37, 99, 235, 0.07);
    color: #2563eb;
    font-size: 0.70rem;
    font-weight: 800;
}

.chat-image-prompt-row {
    padding: 8px 9px;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.78);
}

.chat-image-prompt-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-image-prompt-row-head strong {
    color: #334155;
    font-size: 0.76rem;
}

.chat-image-prompt-copy-button {
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.78);
    color: #2563eb;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}

.chat-image-prompt-row p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.codex-plain-stream {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: grid;
    gap: 5px;
}

.codex-plain-stream-step {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    line-height: 1.42;
}

.codex-plain-stream-step.active {
    color: rgba(255, 255, 255, 0.92);
}

.codex-plain-stream-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    flex: 0 0 auto;
}

.codex-plain-stream-step.active .codex-plain-stream-dot {
    background: #bfdbfe;
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.14);
    animation: codexPlainPulse 1.1s ease-in-out infinite;
}

.chat-mode-modal {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(16px) saturate(1.12);
}

.chat-mode-panel {
    width: min(540px, 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
    overflow: hidden;
}

.chat-mode-head {
    padding: 18px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.chat-mode-kicker {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
}

.chat-mode-head h2 {
    margin: 3px 0 0;
    color: #172033;
    font-size: 1.18rem;
    line-height: 1.25;
}

.chat-mode-close {
    flex: 0 0 auto;
}

.chat-mode-options {
    padding: 0 18px 18px;
    display: grid;
    gap: 10px;
}

.chat-mode-option {
    width: 100%;
    min-height: 78px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #172033;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.chat-mode-option:hover,
.chat-mode-option:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.40);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.13);
    outline: none;
}

.chat-mode-option:disabled,
.chat-mode-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.54;
}

.chat-mode-option:disabled:hover,
.chat-mode-option.is-disabled:hover {
    transform: none;
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: none;
}

.chat-mode-option.is-primary {
    border-color: rgba(37, 99, 235, 0.34);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.90));
}

.chat-mode-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    font-size: 1rem;
}

.chat-mode-option.is-primary .chat-mode-icon {
    background: #2563eb;
    color: #fff;
}

.chat-mode-text {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.chat-mode-text strong {
    font-size: 0.96rem;
    line-height: 1.2;
}

.chat-mode-text small {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
}

.chat-mode-workspace {
    margin: -4px 18px 18px;
    display: grid;
    gap: 7px;
    color: #172033;
    font-size: 0.82rem;
    font-weight: 800;
}

.chat-mode-workspace select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #172033;
    font: inherit;
    font-weight: 700;
}

.chat-mode-workspace small {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.chat-mode-model-picker {
    margin-top: 0;
}

.chat-mode-actions {
    padding: 0 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.chat-mode-actions button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 800;
}

.media-intent-modal {
    position: fixed;
    inset: 0;
    z-index: 3300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(14px) saturate(1.1);
}

.media-intent-panel {
    width: min(560px, 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.97);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
    overflow: hidden;
}

.media-intent-head {
    padding: 18px 18px 12px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: flex-start;
}

.media-intent-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.media-intent-close:hover,
.media-intent-close:focus-visible {
    color: #172033;
    border-color: rgba(78, 121, 255, 0.42);
    outline: none;
}

.media-intent-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
}

.media-intent-kicker {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
}

.media-intent-head h2 {
    margin: 3px 0 0;
    color: #172033;
    font-size: 1.16rem;
    line-height: 1.28;
}

.media-intent-head p {
    margin: 7px 0 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.45;
}

.media-intent-preview {
    margin: 0 18px 14px;
    max-height: 110px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.media-route-choice {
    margin: 0 18px 14px;
    display: grid;
    gap: 12px;
}

.media-chatgpt-button {
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(78, 121, 255, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #24304a;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.media-chatgpt-button > i {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.media-chatgpt-button span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.media-chatgpt-button strong,
.media-comfyui-head strong {
    color: #172033;
    font-size: 0.94rem;
    line-height: 1.25;
}

.media-chatgpt-button small {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.35;
}

.media-comfyui-card {
    border: 1px solid rgba(78, 121, 255, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.64);
    padding: 12px;
}

.media-comfyui-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.media-comfyui-head span {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.media-kind-choice {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.media-kind-choice legend {
    grid-column: 1 / -1;
    margin: 0 0 8px;
    padding: 0;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 800;
}

.media-kind-option {
    min-height: 58px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.media-kind-option input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    flex: 0 0 auto;
}

.media-kind-option span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.media-kind-option strong {
    color: #172033;
    font-size: 0.9rem;
    line-height: 1.2;
}

.media-kind-option small {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.25;
}

.media-kind-option.is-selected {
    border-color: rgba(37, 99, 235, 0.48);
    background: rgba(239, 246, 255, 0.95);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.10);
}

.media-comfyui-submit {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border: 1px solid rgba(37, 99, 235, 0.34);
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 800;
    cursor: pointer;
}

.media-chatgpt-button:hover,
.media-chatgpt-button:focus-visible,
.media-comfyui-submit:hover,
.media-comfyui-submit:focus-visible {
    border-color: rgba(78, 121, 255, 0.58);
    box-shadow: 0 10px 24px rgba(78, 121, 255, 0.16);
    outline: none;
}

.media-intent-actions {
    padding: 0 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.media-intent-actions button {
    min-height: 40px;
    border-radius: 10px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    font-weight: 800;
    cursor: pointer;
}

.media-intent-secondary {
    background: rgba(255, 255, 255, 0.82);
    color: #475569;
}

.media-intent-primary {
    border-color: rgba(37, 99, 235, 0.34);
    background: #2563eb;
    color: #fff;
}

.chat-soft-notice {
    position: fixed;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 3600;
    max-width: min(520px, calc(100vw - 28px));
    min-height: 42px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.96);
    color: #334155;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.20);
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.chat-soft-notice.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.chat-soft-notice.is-error {
    border-color: rgba(220, 38, 38, 0.24);
    color: #7f1d1d;
}

.chat-soft-notice i {
    flex: 0 0 auto;
}

.chat-soft-notice span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.35;
}

.chat-soft-modal {
    position: fixed;
    inset: 0;
    z-index: 3550;
    display: grid;
    place-items: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.chat-soft-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.chat-soft-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(12px) saturate(1.05);
}

.chat-soft-modal-panel {
    position: relative;
    width: min(420px, 100%);
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
    color: #172033;
}

.chat-soft-modal-panel h2 {
    margin: 0 0 8px;
    font-size: 1.08rem;
    line-height: 1.3;
}

.chat-soft-modal-panel p {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.5;
}

.chat-soft-modal-input {
    width: 100%;
    min-height: 40px;
    margin-top: 14px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #172033;
    outline: none;
}

.chat-soft-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.chat-soft-modal-actions button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 800;
}

.chat-soft-modal-secondary {
    border: 1px solid rgba(148, 163, 184, 0.36);
    background: rgba(255, 255, 255, 0.82);
    color: #334155;
}

.chat-soft-modal-primary {
    border: 1px solid rgba(37, 99, 235, 0.28);
    background: #2563eb;
    color: #fff;
}

.chat-soft-modal-primary.danger {
    border-color: rgba(220, 38, 38, 0.26);
    background: #dc2626;
}

.site-message-modal .chat-soft-modal-panel {
    width: min(640px, 100%);
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(148, 163, 184, 0.12);
}

/* ---------- header ---------- */

.site-message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: #fafbfc;
}

.site-message-head-left {
    min-width: 0;
    flex: 1 1 auto;
}

.site-message-head-left h2 {
    margin: 0 0 2px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.site-message-head-left h2 i {
    color: #6366f1;
    font-size: 0.95rem;
}

.site-message-head-left p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.site-message-unread-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

.site-message-unread-pill.is-zero {
    background: #cbd5e1;
}

.site-message-head-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.site-message-head-btn {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.site-message-head-btn i {
    font-size: 0.68rem;
}

.site-message-head-btn:hover {
    background: #f8fafc;
    border-color: #6366f1;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.site-message-head-btn[data-action="select-toggle"] {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(238, 242, 255, 0.6);
}

.site-message-head-btn[data-action="select-toggle"]:hover {
    background: rgba(224, 231, 255, 0.8);
}

.site-message-head-btn[data-action="select-delete"] {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(254, 242, 242, 0.6);
    display: none;
}

.site-message-head-btn[data-action="select-delete"]:hover {
    background: rgba(254, 226, 226, 0.8);
}

.site-message-head-btn[data-action="clear-all"]:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(254, 242, 242, 0.5);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

/* ---------- selection bar ---------- */

.site-message-selection-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(238, 242, 255, 0.7);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
    font-size: 0.78rem;
    font-weight: 700;
    color: #4338ca;
}

.site-message-selection-bar.is-active {
    display: flex;
}

.site-message-selection-bar span {
    flex: 1;
    text-align: right;
    color: #64748b;
    font-weight: 600;
    font-size: 0.72rem;
}

/* ---------- list ---------- */

.site-message-list {
    max-height: min(64vh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 16px;
    display: grid;
    gap: 8px;
    align-content: start;
    grid-auto-rows: auto;
    background: rgba(248, 250, 252, 0.6);
}

/* ---------- card ---------- */

.site-message-item {
    position: relative;
    padding: 12px 14px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 10px;
    align-items: start;
}

.site-message-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.site-message-item.is-unread {
    border-left: 3px solid #6366f1;
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.55), #fff 40%);
}

.site-message-item.is-read {
    border-left: 3px solid transparent;
}

.site-message-item.is-expanded {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.09);
}

/* selection checkbox */

.site-message-checkbox {
    grid-row: 1 / -1;
    align-self: center;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    display: none;
    flex-shrink: 0;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.site-message-checkbox:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.site-message-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.site-message-item.is-selectable .site-message-checkbox {
    display: block;
}

/* content wrapper inside card */

.site-message-card-body {
    min-width: 0;
    overflow: hidden;
}

/* delete button per message */
.site-message-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.76rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.site-message-item:hover .site-message-delete-btn {
    opacity: 1;
}

.site-message-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.site-message-item.is-selectable .site-message-delete-btn {
    display: none;
}

/* unread dot */

.site-message-dot {
    display: none;
}

/* title row */

.site-message-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.35;
    min-width: 0;
}

.site-message-title-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-message-time {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* summary row */

.site-message-summary {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.site-message-item.is-expanded .site-message-summary {
    white-space: normal;
    overflow: visible;
    margin-bottom: 8px;
}

/* source badge */

.site-message-source {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.site-message-item.is-expanded .site-message-source {
    display: flex;
}

.site-message-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-message-source-tag i {
    font-size: 0.6rem;
}

/* expanded body */

.site-message-body {
    display: none;
    margin-top: 6px;
    min-width: 0;
}

.site-message-item.is-expanded .site-message-body {
    display: block;
}

.site-message-body pre {
    max-height: 260px;
    margin: 0;
    padding: 11px 12px;
    overflow: auto;
    border-radius: 8px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.76rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* expand hint */

.site-message-expand-hint {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    transition: color 0.15s;
}

.site-message-item:hover .site-message-expand-hint {
    color: #6366f1;
}

.site-message-item.is-expanded .site-message-expand-hint {
    color: #64748b;
}

.site-message-expand-hint i {
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.site-message-item.is-expanded .site-message-expand-hint i {
    transform: rotate(180deg);
}

/* empty */

.site-message-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 52px 16px;
    color: #cbd5e1;
    text-align: center;
}

.site-message-empty i {
    font-size: 2.5rem;
    opacity: 0.45;
}

.site-message-empty span {
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
}

/* ---------- actions (desktop) ---------- */

.site-message-modal .chat-soft-modal-actions {
    margin-top: 0;
    padding: 12px 20px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
    justify-content: flex-end;
}

.site-message-modal .chat-soft-modal-actions button {
    min-height: 36px;
    padding: 0 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
}

.hardware-status-modal .chat-soft-modal-panel {
    width: min(560px, 100%);
    padding: 0;
    overflow: hidden;
}

.hardware-status-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(37, 99, 235, 0.07));
}

.hardware-status-head h2 {
    margin: 0 0 4px;
}

.hardware-status-head p {
    margin: 0;
}

.hardware-status-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
}

.hardware-status-body {
    padding: 16px 18px;
}

.hardware-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hardware-status-card {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
}

.hardware-status-card.is-wide {
    grid-column: 1 / -1;
}

.hardware-status-card span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 800;
}

.hardware-status-card strong {
    display: block;
    color: #172033;
    font-size: 0.91rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}

.hardware-status-card em {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 0.78rem;
    font-style: normal;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.hardware-status-loading,
.hardware-status-error {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    color: #334155;
}

.hardware-status-error {
    align-items: flex-start;
    border-color: rgba(220, 38, 38, 0.22);
    color: #7f1d1d;
}

.hardware-status-error strong {
    display: block;
    margin-bottom: 5px;
    line-height: 1.4;
}

.hardware-status-error p {
    margin: 0;
    color: #64748b;
}

.hardware-status-notes {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.hardware-status-notes p {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 8px;
    background: rgba(255, 251, 235, 0.78);
    color: #92400e;
    font-size: 0.8rem;
}

.hardware-status-actions {
    align-items: center;
    padding: 0 18px 18px;
    margin-top: 0;
}

.hardware-status-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.hardware-status-actions button:disabled {
    cursor: progress;
    opacity: 0.62;
}

@media (max-width: 560px) {
    .hardware-status-modal {
        padding: 12px;
    }

    .hardware-status-head {
        padding: 16px 16px 12px;
    }

    .hardware-status-body {
        padding: 14px 16px;
    }

    .hardware-status-grid {
        grid-template-columns: 1fr;
    }

    .hardware-status-actions {
        padding: 0 16px 16px;
    }
}

.file-media-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.file-media-modal-shell {
    width: min(1180px, 100%);
    height: min(820px, calc(var(--chat-viewport-height, 100vh) - 36px));
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.file-media-modal.is-image {
    padding: clamp(8px, 2vmin, 18px);
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(5px);
}

.file-media-modal.is-image .file-media-modal-shell {
    position: relative;
    width: auto;
    height: auto;
    max-width: var(--file-media-preview-max-width, calc(100vw - 36px));
    max-height: var(--file-media-preview-max-height, calc(var(--chat-viewport-height, 100vh) - 36px));
    display: block;
    overflow: visible;
    border-radius: 9px;
    background: transparent;
    box-shadow: 0 18px 58px rgba(0, 0, 0, 0.34);
}

.file-media-modal-head {
    min-height: 48px;
    flex: 0 0 auto;
    padding: 8px 12px 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.file-media-modal-title {
    flex: 1 1 auto;
    min-width: 0;
    color: #1f2937;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-media-modal-close {
    flex: 0 0 32px;
}

.file-media-modal.is-image .file-media-modal-head {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 7px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.file-media-modal.is-image .file-media-modal-title {
    display: none;
}

.file-media-modal.is-image .file-media-modal-close {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.34);
    color: rgba(255, 255, 255, 0.86);
    box-shadow: none;
    backdrop-filter: blur(6px);
    opacity: 0.88;
    pointer-events: auto;
}

.file-media-modal.is-image .file-media-modal-close:hover,
.file-media-modal.is-image .file-media-modal-close:focus-visible {
    background: rgba(15, 23, 42, 0.52);
    color: #fff;
    opacity: 1;
    transform: none;
}

.file-media-modal-body {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #0f172a;
}

.file-media-modal.is-image .file-media-modal-body {
    width: auto;
    height: auto;
    max-width: var(--file-media-preview-max-width, calc(100vw - 36px));
    max-height: var(--file-media-preview-max-height, calc(var(--chat-viewport-height, 100vh) - 36px));
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    background: rgba(2, 6, 23, 0.78);
}

.file-media-modal-body img,
.file-media-modal-body video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    object-fit: contain;
}

.file-media-modal.is-image .file-media-modal-body img {
    width: auto;
    height: auto;
    max-width: var(--file-media-preview-max-width, calc(100vw - 36px));
    max-height: var(--file-media-preview-max-height, calc(var(--chat-viewport-height, 100vh) - 36px));
    border-radius: 6px;
    background: #020617;
}

.message:hover .message-content {
    box-shadow:
        0 16px 42px rgba(30, 41, 59, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

.message:hover .message-content.has-scheduler-chat-list {
    box-shadow:
        0 12px 34px rgba(30, 41, 59, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    transform: none;
}

.bot-message.status-error .message-content {
    border-color: rgba(220, 53, 69, 0.46);
    box-shadow:
        0 12px 34px rgba(30, 41, 59, 0.10),
        0 0 0 1px rgba(220, 53, 69, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.bot-message.status-pending .message-content,
.bot-message.status-waiting .message-content,
.bot-message.status-receiving .message-content {
    border-color: rgba(82, 121, 181, 0.34);
    box-shadow:
        0 14px 38px rgba(74, 111, 165, 0.14),
        0 0 0 1px rgba(82, 121, 181, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.bot-message .message-content.is-progress-only {
    min-width: 52px;
    padding: 9px 11px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 252, 0.66));
    box-shadow:
        0 10px 24px rgba(30, 41, 59, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.bot-message.status-done .message-content,
.bot-message.status-sent .message-content {
    border-color: rgba(40, 167, 69, 0.22);
}

.empty-chat {
    margin: auto;
    color: rgba(71, 85, 105, 0.62);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.composer {
    margin: 0 min(7vw, 88px) 24px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, var(--chat-glass-strong-opacity)), rgba(255, 255, 255, var(--chat-glass-opacity)));
    box-shadow:
        0 18px 48px rgba(30, 41, 59, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(22px) saturate(1.18);
}

.composer-files {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 0 2px 4px;
}

.composer-files.is-hidden {
    display: none;
}

.file-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.file-item {
    flex: 0 0 auto;
    max-width: 220px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 14px;
    border: 1px solid rgba(74, 111, 165, 0.15);
    background: rgba(255, 255, 255, 0.62);
    color: #334155;
    font-size: 12px;
}

.file-thumb {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(74, 111, 165, 0.10);
    display: grid;
    place-items: center;
}

.file-info {
    min-width: 0;
}

.file-name,
.file-meta {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name {
    font-weight: 700;
}

.file-meta {
    color: rgba(71, 85, 105, 0.66);
    font-size: 11px;
}

.file-remove,
.composer-file-clear {
    border: 0;
    color: #64748b;
    background: transparent;
    cursor: pointer;
}

.composer-file-clear {
    width: auto;
    min-width: 72px;
    height: 30px;
    border-radius: 12px;
    border: 1px solid rgba(74, 111, 165, 0.14);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: none;
    font-size: 12px;
}

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    font-size: 11px;
}

.message-attachment span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-input-wrap {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 4px;
    border-radius: 16px;
    transition: grid-template-columns 0.16s ease;
}

.composer-input-wrap.has-composer-clear {
    grid-template-columns: minmax(0, 1fr) 34px;
}

.composer textarea {
    width: 100%;
    min-height: 44px;
    max-height: 160px;
    border: 0;
    resize: none;
    outline: none;
    padding: 11px 10px;
    background: transparent;
    color: #1f2937;
    font: inherit;
    line-height: 1.4;
    border-radius: 16px;
    padding-right: 10px;
    scrollbar-gutter: stable;
}

.composer button {
    width: 48px;
    height: 44px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(74, 111, 165, 0.26);
}

.composer .file-remove {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    box-shadow: none;
}

.composer .composer-file-clear {
    width: auto;
    height: 30px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.56);
    color: #64748b;
    box-shadow: none;
}

.composer .composer-clear-button {
    position: static;
    width: 34px;
    height: 34px;
    margin-bottom: 5px;
    border-radius: 11px;
    border: 1px solid rgba(100, 116, 139, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.72));
    color: #64748b;
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.composer .composer-clear-button[hidden] {
    display: none;
}

.composer .composer-clear-button:hover {
    transform: translateY(-1px);
    color: #334155;
    border-color: rgba(74, 111, 165, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(226, 232, 240, 0.82));
    box-shadow:
        0 10px 22px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.composer .composer-clear-button.is-undo {
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.24);
    background:
        linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.78));
}

.composer button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.settings-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    z-index: 1200;
}

.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1201;
    width: min(420px, 92vw);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: -16px 0 40px rgba(36, 48, 67, 0.18);
    padding: 0 18px 18px;
    backdrop-filter: blur(22px) saturate(1.16);
}

.is-hidden {
    display: none !important;
}

.settings-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -18px 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(18px) saturate(1.12);
}

.settings-drawer > :not(.settings-head),
.settings-drawer label,
.settings-drawer section,
.settings-drawer .setting-field,
.settings-drawer .setting-check,
.settings-drawer .settings-api-group,
.settings-drawer .workflow-settings-group,
.settings-drawer .workflow-setting-card,
.settings-drawer .toolbar-toggle-list,
.settings-drawer .model-setting-row {
    min-width: 0;
    max-width: 100%;
}

.settings-drawer.is-model-loading {
    cursor: wait;
}

.settings-drawer.is-model-loading .settings-head::after {
    content: "正在查询模型...";
    margin-left: auto;
    margin-right: 10px;
    color: rgba(71, 85, 105, 0.78);
    font-size: 12px;
    font-weight: 600;
}

.settings-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.setting-field,
.setting-check {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    gap: 8px;
    margin-bottom: 16px;
    color: #475569;
    font-size: 0.9rem;
}

.setting-check {
    flex-direction: row;
    align-items: center;
}

.toolbar-toggle-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    max-width: 100%;
    gap: 8px;
    margin-bottom: 16px;
}

.toolbar-toggle-item {
    margin-bottom: 0;
    padding: 8px 10px;
    border: 1px solid rgba(107, 126, 153, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.86rem;
}

.toolbar-toggle-item input {
    flex: 0 0 auto;
}

.toolbar-toggle-item span {
    line-height: 1.35;
    overflow: visible;
    white-space: normal;
}

.setting-field input,
.setting-field select,
.setting-field textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(107, 126, 153, 0.24);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    font: inherit;
}

.model-setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.model-setting-row select {
    flex: 1 1 auto;
    min-width: 0;
}

.model-unload-button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(107, 126, 153, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.model-unload-button:hover:not(:disabled),
.model-unload-button:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.92);
}

.model-unload-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.upload-card {
    border: 1px solid rgba(107, 126, 153, 0.18);
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.9));
}

.upload-preview {
    border: 1px dashed rgba(107, 126, 153, 0.34);
    background-color: rgba(226, 232, 240, 0.52);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.avatar-preview {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    margin: 0 auto 10px;
}

.background-preview {
    width: 100%;
    height: 112px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.upload-preview.has-image {
    border-style: solid;
    border-color: rgba(74, 111, 165, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.upload-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px 36px;
    align-items: center;
    gap: 8px;
}

.upload-actions span {
    color: #475569;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-button,
.upload-clear {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(107, 126, 153, 0.22);
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-button:hover,
.upload-clear:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.native-file-input {
    display: none;
}

.setting-field input:focus,
.setting-field select:focus,
.setting-field textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.14);
}

.message-progress {
    margin-top: 8px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    min-height: 28px;
    padding: 5px 10px 5px 7px;
    border: 1px solid rgba(147, 197, 253, 0.26);
    border-radius: 999px;
    background:
        radial-gradient(circle at 17px 50%, rgba(191, 219, 254, 0.34), transparent 34px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(219, 234, 254, 0.58)),
        rgba(248, 250, 252, 0.76);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    overflow: hidden;
    color: #64748b;
    animation: messageProgressGlow 2.6s ease-in-out infinite;
}

.message-progress::before {
    display: none;
}

.message-progress-core {
    position: relative;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.message-progress-breath,
.message-progress-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(125, 211, 252, 0.28);
    background:
        radial-gradient(circle, rgba(224, 242, 254, 0.78), rgba(125, 211, 252, 0.22) 58%, transparent 72%);
    border-radius: 999px;
    animation: messageProgressBreath 2.05s ease-in-out infinite;
}

.message-progress-cursor {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 32%, #ffffff, #bae6fd 40%, #38bdf8 100%);
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.10),
        0 0 15px rgba(56, 189, 248, 0.58);
    animation: messageProgressBeat 1.7s ease-in-out infinite;
}

.message-progress-text {
    color: #52647a;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.message-progress-ticks {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.message-progress-ticks i {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, #eff6ff, #bae6fd 55%, #7dd3fc 100%);
    box-shadow: 0 0 9px rgba(125, 211, 252, 0.50);
    animation: messageProgressTick 1.55s ease-in-out infinite;
}

.message-progress-ticks i:nth-child(2) {
    animation-delay: 0.16s;
}

.message-progress-ticks i:nth-child(3) {
    animation-delay: 0.32s;
}

.message-progress.pending,
.message-progress.waiting,
.message-progress.receiving,
.message-progress.done,
.message-progress.sent,
.message-progress.error {
    overflow: visible;
}

.message-progress.waiting::before,
.message-progress.receiving::before,
.message-progress.pending::before {
    display: none;
}

.message-progress.done::before,
.message-progress.sent::before {
    background: var(--success-color);
}

.message-progress.done,
.message-progress.sent {
    display: none;
}

.message-progress.error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.10);
    color: var(--danger-color);
    min-height: 0;
    padding: 3px 8px;
    font-size: 0.74rem;
    font-weight: 700;
}

.message-progress.codex-progress {
    border-color: rgba(94, 234, 212, 0.28);
    background:
        radial-gradient(circle at 22% 50%, rgba(94, 234, 212, 0.24), transparent 34%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.88), rgba(20, 184, 166, 0.18), rgba(30, 64, 175, 0.30)),
        rgba(15, 23, 42, 0.88);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 10px 24px rgba(2, 6, 23, 0.20);
}

.message-progress.codex-progress .message-progress-ring {
    background:
        conic-gradient(from 0deg, rgba(94, 234, 212, 0), #5eead4, #93c5fd, rgba(94, 234, 212, 0) 78%);
}

.message-progress.codex-progress .message-progress-breath {
    border-color: rgba(94, 234, 212, 0.28);
    background:
        radial-gradient(circle, rgba(204, 251, 241, 0.72), rgba(45, 212, 191, 0.22) 58%, transparent 72%);
}

.message-progress.codex-progress .message-progress-text {
    color: rgba(204, 251, 241, 0.82);
}

.message-progress.codex-progress .message-progress-cursor {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background:
        radial-gradient(circle at 35% 32%, #ecfeff, #5eead4 48%, #0f766e 100%);
    box-shadow:
        0 0 0 3px rgba(45, 212, 191, 0.16),
        0 0 18px rgba(45, 212, 191, 0.80);
}

.message-progress.codex-progress .message-progress-ticks i {
    background:
        radial-gradient(circle at 35% 35%, #ecfeff, #5eead4 55%, #38bdf8 100%);
    box-shadow: 0 0 13px rgba(94, 234, 212, 0.70);
}

.message-progress.pending,
.message-progress.waiting,
.message-progress.receiving {
    position: relative;
    width: 42px;
    min-width: 42px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    gap: 5px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    box-shadow: none;
    animation: none;
}

.message-progress.pending::after,
.message-progress.waiting::after,
.message-progress.receiving::after {
    display: none;
}

.message-progress.pending .message-progress-core,
.message-progress.waiting .message-progress-core,
.message-progress.receiving .message-progress-core {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0 24%, rgba(96, 165, 250, 0.58) 25% 43%, transparent 44%),
        conic-gradient(from 0deg, rgba(37, 99, 235, 0.10), #60a5fa, #a78bfa, rgba(37, 99, 235, 0.10));
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.08),
        0 0 14px rgba(96, 165, 250, 0.30);
    animation: messageProgressDial 1.4s linear infinite, messageProgressSoftBeat 1.6s ease-in-out infinite;
}

.message-progress.pending .message-progress-core::after,
.message-progress.waiting .message-progress-core::after,
.message-progress.receiving .message-progress-core::after {
    display: none;
}

.message-progress.pending .message-progress-breath,
.message-progress.pending .message-progress-cursor,
.message-progress.waiting .message-progress-breath,
.message-progress.waiting .message-progress-cursor,
.message-progress.receiving .message-progress-breath,
.message-progress.receiving .message-progress-cursor {
    display: none;
}

.message-progress.pending .message-progress-ticks,
.message-progress.waiting .message-progress-ticks,
.message-progress.receiving .message-progress-ticks {
    gap: 3px;
}

.message-progress.pending .message-progress-ticks i,
.message-progress.waiting .message-progress-ticks i,
.message-progress.receiving .message-progress-ticks i {
    width: 3px;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.92), rgba(37, 99, 235, 0.48));
    box-shadow: none;
    animation: messageProgressBars 1.05s ease-in-out infinite;
}

.message-progress.pending .message-progress-ticks i:nth-child(2),
.message-progress.waiting .message-progress-ticks i:nth-child(2),
.message-progress.receiving .message-progress-ticks i:nth-child(2) {
    animation-delay: 0.13s;
}

.message-progress.pending .message-progress-ticks i:nth-child(3),
.message-progress.waiting .message-progress-ticks i:nth-child(3),
.message-progress.receiving .message-progress-ticks i:nth-child(3) {
    animation-delay: 0.26s;
}

.message-progress.codex-progress.pending,
.message-progress.codex-progress.waiting,
.message-progress.codex-progress.receiving {
    border-color: rgba(94, 234, 212, 0.28);
    background:
        linear-gradient(110deg, rgba(15, 23, 42, 0.94), rgba(15, 118, 110, 0.28) 52%, rgba(30, 41, 59, 0.90)),
        rgba(15, 23, 42, 0.92);
    color: #ccfbf1;
}

.message-progress.codex-progress.pending .message-progress-core,
.message-progress.codex-progress.waiting .message-progress-core,
.message-progress.codex-progress.receiving .message-progress-core {
    background:
        conic-gradient(from 0deg, #5eead4, #93c5fd, #22d3ee, #5eead4);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.10);
}

.message-progress.codex-progress.pending .message-progress-core::after,
.message-progress.codex-progress.waiting .message-progress-core::after,
.message-progress.codex-progress.receiving .message-progress-core::after {
    background: rgba(15, 23, 42, 0.92);
}

.message-progress.codex-progress.pending .message-progress-text,
.message-progress.codex-progress.waiting .message-progress-text,
.message-progress.codex-progress.receiving .message-progress-text {
    color: rgba(204, 251, 241, 0.92);
}

.message-progress.media-generation-progress.pending,
.message-progress.media-generation-progress.waiting,
.message-progress.media-generation-progress.receiving {
    width: min(320px, 100%);
    min-width: min(236px, 100%);
    max-width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    align-items: stretch;
    gap: 7px;
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.84)),
        rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    color: #334155;
    line-height: 1.35;
    animation: none;
}

.message-progress.media-generation-progress::before,
.message-progress.media-generation-progress::after {
    display: none;
}

.media-generation-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 800;
}

.media-generation-progress-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-generation-progress-percent {
    flex: 0 0 auto;
    color: #2563eb;
    font-variant-numeric: tabular-nums;
}

.media-generation-progress-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
}

.media-generation-progress-bar {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 8px;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f8cff, #20c997);
    box-shadow: 0 0 12px rgba(79, 140, 255, 0.28);
    transition: width 0.35s ease;
}

.media-generation-progress-detail {
    min-width: 0;
    color: #64748b;
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.media-task-info {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.media-task-info-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 7px;
    background: #2f5fae;
    color: #f1f6ff;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1.2;
    box-shadow:
        0 3px 8px rgba(15, 23, 42, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.12) inset;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-shadow: none;
}

.media-task-info-chip b {
    color: #c7ddff;
    font-weight: 800;
    white-space: nowrap;
}

.media-task-info-chip span {
    min-width: 0;
    max-width: min(178px, 48vw);
    color: #f8fbff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-generation-progress-actions {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.media-generation-progress-actions.is-standalone {
    margin-top: 8px;
}

.media-generation-progress-refresh {
    min-height: 32px;
    padding: 7px 13px;
    border: 1px solid #1d4ed8;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
    opacity: 1;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.24) inset;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.media-generation-progress-refresh:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.40), 0 0 0 1px rgba(255, 255, 255, 0.28) inset;
    transform: translateY(-1px);
}

.media-generation-progress-refresh:disabled {
    cursor: wait;
    opacity: 1;
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
    border-color: #2563eb;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.22) inset;
    transform: none;
}

.codex-chat-mode .chat-workspace {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.28);
}

.codex-chat-mode .workspace-bar,
.codex-chat-mode .composer,
.codex-chat-mode .workspace-page-nav,
.codex-chat-mode .sign-command-bar {
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.24);
}

.codex-chat-mode .workspace-title,
.codex-chat-mode .workspace-subtitle,
.codex-chat-mode .page-nav-link,
.codex-chat-mode .sign-command-button {
    color: #e2e8f0;
}

.codex-chat-mode .composer textarea {
    color: #e2e8f0;
}

.codex-chat-mode .composer textarea::placeholder {
    color: rgba(203, 213, 225, 0.66);
}

.codex-chat-mode .bot-message .message-content.has-codex-events {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.30);
    color: #e2e8f0;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.codex-event-timeline {
    margin-top: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.45);
}

.codex-event-group,
.codex-event-item {
    padding: 10px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.codex-event-group:first-child,
.codex-event-item:first-child {
    border-top: 0;
}

.codex-event-group-head,
.codex-event-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dbeafe;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

.codex-event-group-head::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.75);
    box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.10);
}

.codex-event-group.running .codex-event-group-head::before {
    display: none;
}

.codex-event-summary {
    margin-top: 7px;
    display: grid;
    gap: 5px;
}

.codex-event-summary p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: rgba(226, 232, 240, 0.92);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    line-height: 1.58;
}

.codex-change-list {
    margin-top: 9px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.44);
}

.codex-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.codex-change-row:first-child {
    border-top: 0;
}

.codex-change-path {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(226, 232, 240, 0.94);
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.78rem;
}

.codex-change-stat {
    flex: 0 0 auto;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.78rem;
    font-weight: 800;
}

.codex-change-stat .plus {
    color: #4ade80;
}

.codex-change-stat .minus {
    color: #f87171;
}

.codex-event-loading {
    position: relative;
    width: 13px;
    min-width: 13px;
    height: 13px;
    margin: 0 1px 0 0;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.codex-event-loading i {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: #93c5fd;
    opacity: 0.32;
    animation: codexMiniPulse 1.05s ease-in-out infinite;
}

.codex-event-loading i:nth-child(2) {
    animation-delay: 0.16s;
}

.codex-event-loading i:nth-child(3) {
    animation-delay: 0.32s;
}

.codex-event-loading i:nth-child(4) {
    display: none;
}

.codex-event-loading::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 6px;
    width: 4px;
    height: 1px;
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.45);
    animation: codexMiniLine 1.05s ease-in-out infinite;
}

.codex-event-details {
    margin-top: 8px;
    color: rgba(203, 213, 225, 0.68);
}

.codex-event-details summary {
    cursor: pointer;
    user-select: none;
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(203, 213, 225, 0.58);
}

.codex-event-details[open] summary {
    margin-bottom: 6px;
    color: #bfdbfe;
}

.codex-event-details pre,
.codex-event-item pre {
    margin: 6px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #cbd5e1;
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.45;
}

.codex-event-group.done .codex-event-group-head,
.codex-event-group.file_change .codex-event-group-head,
.codex-event-item.done .codex-event-head,
.codex-event-item.file_change .codex-event-head {
    color: #bbf7d0;
}

.codex-event-group.running .codex-event-group-head {
    color: #bfdbfe;
}

.codex-event-group.logs .codex-event-group-head {
    color: rgba(203, 213, 225, 0.72);
}

.codex-event-group.logs .codex-event-group-head::before {
    background: rgba(148, 163, 184, 0.55);
    box-shadow: none;
}

.codex-event-group.error .codex-event-group-head,
.codex-event-item.error .codex-event-head {
    color: #fca5a5;
}

.codex-final-answer {
    margin: 14px 0 0;
    padding: 13px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0;
    background: transparent;
    color: #f8fafc;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: pre-wrap;
}

.codex-final-head {
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 800;
}

.codex-final-body {
    color: rgba(241, 245, 249, 0.94);
    font-size: 0.86rem;
    line-height: 1.65;
}

.codex-final-body p {
    margin: 0 0 9px;
}

.codex-final-body p:last-child {
    margin-bottom: 0;
}

@keyframes chatThinkingWave {
    0%, 100% {
        height: 5px;
        opacity: 0.45;
    }
    45% {
        height: 12px;
        opacity: 1;
    }
}

@keyframes messageProgressOrbit {
    to {
        transform: rotate(360deg);
    }
}

@keyframes messageProgressGlow {
    0%, 100% {
        transform: translateY(0);
        filter: saturate(1);
    }
    45% {
        transform: translateY(-1px);
        filter: saturate(1.16);
    }
}

@keyframes messageProgressBreath {
    0%, 100% {
        transform: scale(0.86);
        opacity: 0.46;
    }
    45% {
        transform: scale(1.18);
        opacity: 0.92;
    }
}

@keyframes messageProgressBeat {
    0%, 100% {
        transform: scale(0.88);
        opacity: 0.76;
    }
    45% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@keyframes messageProgressTick {
    0%, 100% {
        opacity: 0.24;
        transform: translateY(1px) scale(0.72);
    }
    45% {
        opacity: 0.86;
        transform: translateY(-1px) scale(1.05);
    }
}

@keyframes messageProgressSweep {
    0%, 100% {
        transform: translateX(-78%);
        opacity: 0;
    }
    18%, 68% {
        opacity: 1;
    }
    88% {
        transform: translateX(78%);
        opacity: 0;
    }
}

@keyframes messageProgressDial {
    to {
        transform: rotate(360deg);
    }
}

@keyframes messageProgressSoftBeat {
    0%, 100% {
        filter: saturate(0.95);
        opacity: 0.78;
    }
    50% {
        filter: saturate(1.14);
        opacity: 1;
    }
}

@keyframes messageProgressBars {
    0%, 100% {
        transform: scaleY(0.52);
        opacity: 0.42;
    }
    45% {
        transform: scaleY(1);
        opacity: 0.95;
    }
}

@keyframes thinkingDotPulse {
    0%, 100% {
        opacity: 0.32;
        transform: translateY(1px);
    }
    45% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

@keyframes thinkingLoadingPulse {
    0%, 100% {
        opacity: 0.35;
        transform: scale(0.72);
    }
    45% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes thinkingMarkSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes codexMiniPulse {
    0%, 100% {
        transform: scale(0.72);
        opacity: 0.28;
    }
    45% {
        transform: scale(1);
        opacity: 0.92;
    }
}

@keyframes codexMiniLine {
    0%, 100% {
        opacity: 0.22;
        transform: scaleX(0.7);
    }
    45% {
        opacity: 0.7;
        transform: scaleX(1);
    }
}

@keyframes codexPlainPulse {
    0%, 100% {
        opacity: 0.42;
        transform: scale(0.82);
    }
    45% {
        opacity: 1;
        transform: scale(1.12);
    }
}

.code-block {
    margin-top: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    color: #e2e8f0;
    max-width: 100%;
}

.code-toolbar {
    min-height: 38px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(226, 232, 240, 0.10);
    color: #cbd5e1;
    font-size: 0.78rem;
}

.thinking-block {
    margin: 0 0 6px;
    border: 0;
    background: transparent;
}

.thinking-toggle {
    min-height: 28px;
    max-width: 100%;
    padding: 4px 9px 4px 5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.72));
    color: #172554;
    box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    cursor: pointer;
    user-select: none;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    backdrop-filter: blur(8px) saturate(1.08);
}

.thinking-toggle:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
    border-radius: 999px;
}

.thinking-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.thinking-toggle::after {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-right: 1.4px solid currentColor;
    border-bottom: 1.4px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.72;
    transition: transform 0.16s ease;
}

.thinking-block.is-open .thinking-toggle::after {
    transform: rotate(225deg) translateY(-1px);
}

.thinking-body {
    display: none;
    margin: 4px 0 6px 8px;
    padding: 0 0 0 13px;
    border-left: 1px solid rgba(148, 163, 184, 0.42);
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.7;
}

.thinking-block.is-open .thinking-body {
    display: block;
}

.thinking-loading-body {
    min-height: 24px;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.82rem;
}

.thinking-block.is-open .thinking-loading-body {
    display: inline-flex;
}

.thinking-loading-pulse {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.thinking-loading-pulse i {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.55);
    animation: thinkingLoadingPulse 1.05s ease-in-out infinite;
}

.thinking-loading-pulse i:nth-child(2) {
    animation-delay: 0.14s;
}

.thinking-loading-pulse i:nth-child(3) {
    animation-delay: 0.28s;
}

.thinking-mark {
    position: relative;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.thinking-mark::before,
.thinking-mark::after,
.thinking-mark i {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1.6px solid currentColor;
    border-radius: 999px;
}

.thinking-mark::before {
    transform: translate(-3px, -3px);
}

.thinking-mark::after {
    transform: translate(3px, -3px);
}

.thinking-mark i {
    transform: translate(0, 3px);
}

.thinking-block.is-loading .thinking-mark {
    animation: thinkingMarkSpin 1s linear infinite;
    animation-delay: var(--thinking-spin-delay, 0ms);
}

.code-toolbar-top {
    border-top: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.10);
}

.code-toolbar-bottom {
    border-top: 1px solid rgba(226, 232, 240, 0.10);
}

.code-actions {
    display: flex;
    gap: 6px;
}

.code-action {
    position: relative;
    width: 30px;
    height: 28px;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
}

.code-action::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    z-index: 5;
    max-width: 160px;
    padding: 4px 7px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.26);
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.code-toolbar-top .code-action::after {
    top: calc(100% + 7px);
    bottom: auto;
}

.code-action:hover,
.code-action.is-done {
    background: rgba(110, 156, 210, 0.38);
}

.code-action:hover::after,
.code-action.is-done::after {
    opacity: 1;
    transform: translateY(0);
}

.code-block pre {
    margin: 0;
    padding: 14px;
    overflow: auto;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.code-block code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: inherit;
    overflow-wrap: inherit;
}

.compact-code-block .code-toolbar {
    min-height: 34px;
    padding: 6px 10px;
}

.compact-code-block pre {
    padding: 10px 12px 12px;
}

.html-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(15, 23, 42, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.html-preview-shell {
    width: min(980px, 96vw);
    height: min(720px, 88vh);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.html-preview-head {
    height: 48px;
    padding: 0 12px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(107, 126, 153, 0.18);
    color: #334155;
    font-weight: 700;
}

.html-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.typing-indicator {
    min-height: 24px;
    padding: 0 min(7vw, 88px) 8px;
}

.typing-indicator > span {
    display: none;
}

.sign-command-bar {
    margin: 0 min(7vw, 88px) 6px;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, calc(var(--chat-glass-opacity) * 0.58));
    backdrop-filter: blur(10px) saturate(1.04);
    overflow-x: auto;
    scrollbar-width: none;
}

.sign-command-bar[hidden] {
    display: none !important;
}

[data-wenyuan-only][hidden] {
    display: none !important;
}

.sign-command-bar::-webkit-scrollbar {
    display: none;
}

.clear-chat-button {
    width: 32px;
    height: 28px;
    min-width: 32px;
    min-height: 28px;
    max-height: 28px;
    box-sizing: border-box;
    border-radius: 8px;
    border-color: rgba(251, 113, 133, 0.42);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.16)),
        rgba(159, 18, 57, 0.16);
    color: #fff1f2;
    text-shadow: 0 1px 2px rgba(76, 5, 25, 0.45);
    flex: 0 0 32px;
}

.clear-chat-button i {
    font-size: 0.78rem;
}

.clear-chat-button:hover {
    border-color: rgba(251, 113, 133, 0.82);
    background:
        linear-gradient(180deg, rgba(251, 113, 133, 0.26), rgba(159, 18, 57, 0.24)),
        rgba(255, 255, 255, 0.14);
    color: #fff;
}

.sign-command-button {
    min-width: auto;
    height: 28px;
    min-height: 28px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
    color: #334155;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.sign-command-button i {
    width: 0.9em;
    height: 0.9em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    line-height: 1;
    flex: 0 0 0.9em;
}

.sign-command-button span {
    line-height: 1;
}

.sign-command-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.sign-command-button.is-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: rgba(255, 255, 255, 0.74);
    color: #fff;
}

.quick-command-divider {
    width: 1px;
    height: 20px;
    flex: 0 0 auto;
    background: rgba(51, 65, 85, 0.14);
    margin: 0 2px;
}

@keyframes progressPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 760px) {
    html,
    body.chat-app-body {
        width: 100%;
        height: var(--chat-viewport-height, 100svh);
    overflow: hidden;
}

.message-rendered > .code-block:first-child {
    margin-top: 4px;
}

    .chat-app-body {
        overflow: hidden;
        background:
            radial-gradient(circle at 20% 0%, rgba(110, 156, 210, 0.24), transparent 32%),
            linear-gradient(180deg, #edf4fb 0%, #f8fbfd 100%);
        touch-action: manipulation;
        position: fixed;
        inset: 0;
    }

    .chat-app {
        grid-template-columns: 1fr;
        width: 100vw;
        height: var(--chat-viewport-height, 100svh);
        min-height: 0;
        padding: 0;
        gap: 0;
        overflow: hidden;
    }

    .chat-app::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1200;
        background: rgba(8, 13, 24, 0.34);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body:not(.sidebar-collapsed) .chat-app::after {
        opacity: 1;
        pointer-events: auto;
    }

    .chat-sidebar {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 312px);
        max-width: calc(100vw - 52px);
        height: var(--chat-viewport-height, 100svh);
        z-index: 1300;
        border-radius: 0 22px 22px 0;
        transform: translateX(-105%);
        box-shadow: 18px 0 44px rgba(8, 13, 24, 0.24);
        background: rgba(17, 24, 39, 0.88);
        border-color: rgba(255, 255, 255, 0.28);
    }

    .session-list {
        padding: 8px 10px max(18px, env(safe-area-inset-bottom, 0px));
    }

    .session-item {
        grid-template-columns: minmax(0, 1fr) 22px repeat(2, 34px);
        gap: 5px;
        padding: 5px;
    }

    .session-title-button {
        padding: 9px 6px;
    }

    .session-action {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        opacity: 0.86;
        background: rgba(255, 255, 255, 0.12);
    }

    .chat-app-body.has-app-background .chat-sidebar {
        background:
            linear-gradient(180deg, rgba(15, 23, 42, 0.90), rgba(15, 23, 42, 0.78));
    }

    body:not(.sidebar-collapsed) .chat-sidebar {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .sidebar-collapsed .chat-sidebar {
        transform: translateX(-105%);
    }

    .chat-workspace {
        width: 100vw;
        height: var(--chat-viewport-height, 100svh);
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.34);
        grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
        overflow: hidden;
    }

    .workspace-bar {
        min-height: 64px;
        gap: 6px;
        padding: max(env(safe-area-inset-top, 0px), 10px) 10px 8px;
        background: rgba(255, 255, 255, 0.52);
        border-bottom-color: rgba(255, 255, 255, 0.7);
        align-items: flex-end;
    }

    .workspace-heading {
        min-width: 0;
        flex: 1 1 auto;
    }

    .workspace-title {
        max-width: calc(100vw - 184px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .session-id-copy-button {
        width: 32px;
        min-height: 32px;
        padding: 0;
        border-radius: 10px;
        justify-content: center;
    }

    .session-id-copy-button span {
        display: none;
    }

    .toolbar {
        gap: 4px;
        align-items: center;
    }

    .workspace-page-nav {
        padding: 8px 10px;
        gap: 6px;
    }

    .page-nav-link,
    .page-nav-more-button {
        min-height: 32px;
        padding: 0 10px;
        border: 1px solid rgba(255, 255, 255, 0.72);
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
        color: #334155;
        font-size: 0.82rem;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
        backdrop-filter: blur(10px);
        transition: var(--transition);
    }

    .page-nav-link.is-mobile-overflow-hidden,
    .quick-command-divider.is-mobile-divider-hidden,
    .sign-command-button.is-mobile-overflow-hidden,
    .clear-chat-button.is-mobile-overflow-hidden,
    .mobile-overflow-toggle.is-hidden {
        display: none !important;
    }

    .page-nav-more-button:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
        transform: translateY(-1px);
    }

    .workspace-page-nav.has-mobile-overflow .page-nav-more-button,
    .sign-command-bar.has-mobile-overflow .sign-command-more-button {
        margin-left: auto;
    }

    .icon-button {
        width: 32px;
        height: 32px;
        border-radius: 11px;
        flex: 0 0 auto;
    }

    .messages-panel {
        padding: 34px 10px 10px;
        gap: 12px;
        min-height: 0;
        width: 100%;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .chat-app-body.keyboard-open .messages-panel {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .message-scroll-tools {
        right: max(2px, env(safe-area-inset-right));
        bottom: 154px;
        display: grid;
        gap: 3px;
        padding: 2px;
        border: 0;
        border-radius: 999px;
        background: rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(6px);
    }

    .message-scroll-button {
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.48);
        color: rgba(15, 23, 42, 0.74);
        font-size: 0.56rem;
        box-shadow: none;
    }

    .codex-media-task-pill {
        max-width: 38%;
        min-height: 16px;
        padding: 1px 4px;
        font-size: 7.5px;
    }

    .codex-media-task-title {
        display: none;
    }

    .messages-panel .message {
        width: 100%;
        max-width: 100%;
        gap: 8px;
        align-items: flex-start;
    }

    .messages-panel .message-stack {
        max-width: calc(100vw - 76px);
    }

    .messages-panel .avatar {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    .messages-panel .message-content {
        padding: 12px;
        border-radius: 18px;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        box-shadow:
            0 10px 26px rgba(30, 41, 59, 0.10),
            inset 0 1px 0 rgba(255, 255, 255, 0.34);
    }

    .scheduler-chat-list {
        width: min(100%, calc(100vw - 76px));
    }

    .scheduler-chat-table {
        min-width: 680px;
    }

    .scheduler-chat-table th,
    .scheduler-chat-table td {
        padding: 8px;
    }

    .scheduler-chat-task-action {
        min-height: 26px;
        padding: 0 8px;
    }

    .messages-panel .message-content p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .user-message .message-content {
        margin-left: auto;
    }

    .composer {
        margin: 0 10px 10px;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        padding: 8px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.76);
        box-shadow:
            0 12px 34px rgba(30, 41, 59, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.52);
    }

    .sign-command-bar {
        margin: 0 10px 5px;
        padding: 4px;
        gap: 4px;
        border-radius: 11px;
    }

    .workspace-page-nav.has-mobile-overflow:not(.is-mobile-overflow-expanded),
    .sign-command-bar.has-mobile-overflow:not(.is-mobile-overflow-expanded) {
        overflow: hidden;
    }

    .sign-command-button,
    .sign-command-more-button {
        width: 32px;
        min-width: 32px;
        height: 28px;
        min-height: 28px;
        max-height: 28px;
        padding: 0 7px;
        border: 1px solid rgba(255, 255, 255, 0.70);
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
        color: #334155;
        cursor: pointer;
        font-size: 0.74rem;
        font-weight: 700;
        gap: 4px;
        flex: 0 0 32px;
        overflow: hidden;
        line-height: 1;
        white-space: nowrap;
        transition: var(--transition);
        appearance: none;
        -webkit-appearance: none;
    }

    .sign-command-button.is-primary {
        background: rgba(255, 255, 255, var(--chat-glass-soft-opacity));
        border-color: rgba(255, 255, 255, 0.70);
        color: #334155;
    }

    .clear-chat-button {
        width: 30px;
        min-width: 30px;
        flex-basis: 30px;
        height: 28px;
        min-height: 28px;
        max-height: 28px;
    }

    .sign-command-button i,
    .sign-command-more-button i {
        width: 14px;
        height: 14px;
        font-size: 12px;
        flex-basis: 14px;
    }

    .sign-command-button span,
    .sign-command-more-button span,
    .page-nav-more-button span {
        display: none;
    }

    .quick-command-divider {
        height: 18px;
        margin: 0 1px;
    }

    .chat-app-body.keyboard-open .composer {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(var(--chat-keyboard-height, 0px) + max(6px, env(safe-area-inset-bottom, 0px)));
        z-index: 1100;
        margin: 0;
    }

    .chat-app-body.keyboard-open .sign-command-bar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(var(--chat-keyboard-height, 0px) + 76px + max(6px, env(safe-area-inset-bottom, 0px)));
        z-index: 1100;
        margin: 0;
    }

    .composer button {
        width: 44px;
        height: 42px;
    }

    .composer .composer-clear-button {
        width: 31px;
        height: 31px;
        margin-bottom: 5px;
        border-radius: 10px;
    }

    .composer .file-remove {
        width: 24px;
        height: 24px;
    }

    .composer .composer-file-clear {
        width: auto;
        height: 30px;
    }

    .composer textarea {
        min-height: 42px;
        max-height: 118px;
        padding: 10px 8px;
        font-size: 16px;
        transform: translateZ(0);
    }

    .settings-drawer input,
    .settings-drawer textarea,
    .settings-drawer select,
    .settings-drawer button {
        font-size: 16px;
    }

    .settings-drawer {
        width: 100vw;
        max-width: 100vw;
        padding: 0 14px 14px;
        border-left: 0;
    }

    .settings-head {
        margin: 0 -14px 16px;
        padding: max(env(safe-area-inset-top, 0px), 14px) 14px 12px;
    }

    .messages-panel::-webkit-scrollbar,
    .settings-drawer::-webkit-scrollbar,
    .code-block pre::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .code-block pre {
        padding: 12px;
        max-width: calc(100vw - 104px);
    }

    .code-block code {
        font-size: 0.82rem;
        white-space: pre;
    }

    .html-preview-modal {
        padding: 10px;
        align-items: stretch;
    }

    .html-preview-shell {
        width: 100%;
        height: 100%;
        border-radius: 12px;
    }

    .file-media-modal {
        padding: 8px;
    }

    .file-media-modal-shell {
        width: 100%;
        height: calc(var(--chat-viewport-height, 100svh) - 16px);
        border-radius: 10px;
    }

    .file-media-modal.is-image .file-media-modal-shell {
        width: auto;
        height: auto;
        max-width: var(--file-media-preview-max-width, calc(100vw - 16px));
        max-height: var(--file-media-preview-max-height, calc(100svh - 16px));
        border-radius: 9px;
    }

    .file-media-modal-head {
        min-height: 42px;
        padding: 6px 8px 6px 12px;
        gap: 8px;
    }

    .file-media-modal-close {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .file-media-modal.is-image .file-media-modal-head {
        top: 6px;
        right: 6px;
        min-height: 0;
        padding: 0;
    }

    .file-media-modal.is-image .file-media-modal-close {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .file-media-modal-body {
        padding: 8px;
    }

    .file-media-modal.is-image .file-media-modal-body {
        padding: 2px;
        max-width: var(--file-media-preview-max-width, calc(100vw - 16px));
        max-height: var(--file-media-preview-max-height, calc(100svh - 16px));
    }

    .file-media-modal.is-image .file-media-modal-body img {
        max-width: var(--file-media-preview-max-width, calc(100vw - 16px));
        max-height: var(--file-media-preview-max-height, calc(100svh - 16px));
    }

    .upload-grid {
        grid-template-columns: 1fr;
    }

    /* ---------- site message modal — mobile ---------- */

    .site-message-modal {
        padding: 0;
        align-items: stretch;
    }

    .site-message-modal .chat-soft-modal-backdrop {
        background: rgba(15, 23, 42, 0.45);
    }

    .site-message-modal .chat-soft-modal-panel {
        width: 100%;
        height: calc(var(--chat-viewport-height, 100svh) - 12px);
        max-height: calc(var(--chat-viewport-height, 100svh) - 12px);
        margin: 6px 6px 0;
        border-radius: 18px 18px 0 0;
        display: flex;
        flex-direction: column;
        box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.16);
    }

    .site-message-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 16px 12px;
        border-radius: 18px 18px 0 0;
    }

    .site-message-head-left h2 {
        font-size: 1.05rem;
    }

    .site-message-head-left p {
        font-size: 0.72rem;
        flex-wrap: wrap;
        gap: 6px;
    }

    .site-message-head-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .site-message-head-btn {
        flex: 1 1 auto;
        min-height: 32px;
        padding: 0 10px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .site-message-selection-bar {
        padding: 8px 14px;
        font-size: 0.74rem;
    }

    .site-message-list {
        flex: 1;
        max-height: none;
        padding: 10px 12px;
        gap: 8px;
        align-content: start;
        grid-auto-rows: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .site-message-item {
        padding: 10px 12px;
        padding-right: 36px;  /* 给右上角删除按钮留空间 */
        grid-template-columns: auto minmax(0, 1fr);
    }

    /* always show delete on mobile */
    .site-message-delete-btn {
        opacity: 0.6;
        top: 4px;
        right: 4px;
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .site-message-delete-btn:active {
        opacity: 1;
        background: rgba(239, 68, 68, 0.12);
        color: #ef4444;
    }

    .site-message-checkbox {
        width: 20px;
        height: 20px;
        border-radius: 6px;
    }

    .site-message-title {
        font-size: 0.84rem;
        gap: 6px;
    }

    .site-message-time {
        font-size: 0.66rem;
    }

    .site-message-summary {
        font-size: 0.74rem;
    }

    .site-message-body pre {
        max-height: 180px;
        padding: 10px 10px;
        font-size: 0.72rem;
    }

    .site-message-expand-hint {
        font-size: 0.66rem;
        margin-top: 6px;
    }

    .site-message-empty {
        padding: 32px 12px;
    }

    .site-message-empty i {
        font-size: 2rem;
    }

    .site-message-empty span {
        font-size: 0.78rem;
    }

    .site-message-modal .chat-soft-modal-actions {
        margin-top: 0;
        padding: 0 0 max(6px, env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(226, 232, 240, 0.6);
    }

    .site-message-modal .chat-soft-modal-actions button {
        width: calc(100% - 28px);
        margin: 10px 14px;
        min-height: 44px;
        font-size: 0.9rem;
        border-radius: 12px;
    }
}

@media (max-width: 420px) {
    .sign-command-button {
        width: 32px;
        min-width: 32px;
        padding: 0;
    }

    .sign-command-button span {
        display: none;
    }
}

@media (max-width: 560px) {
    .media-kind-choice {
        grid-template-columns: 1fr;
    }
}
