:root {
    --demo-bg: #eef2f8;
    --demo-surface: #ffffff;
    --demo-text: #1f1f1f;
    --demo-muted: #61656b;
    --demo-outline: #dbe2ea;
    --demo-primary: #1a73e8;
    --demo-primary-strong: #165fbe;
    --demo-shadow: 0 14px 36px rgba(23, 34, 58, 0.08);
    --demo-font-body: 15px;
    --demo-font-title: 16px;
    --demo-font-muted: 13px;
    --demo-system-font-size: 14px;
    --demo-system-font-weight: 500;
    --demo-system-line-height: 1.45;
    --demo-sidebar-width: 276px;
    --demo-sidebar-mini-width: 64px;
    --demo-safe-area-top: env(safe-area-inset-top, 0px);
    --demo-safe-area-right: env(safe-area-inset-right, 0px);
    --demo-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --demo-safe-area-left: env(safe-area-inset-left, 0px);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Google Sans Text', 'Google Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 100% 0%, rgba(26, 115, 232, 0.08), transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(217, 101, 112, 0.08), transparent 40%),
        var(--demo-bg);
    color: var(--demo-text);
    font-size: var(--demo-font-body);
    line-height: 1.56;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    min-height: 100vh;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.demo-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 30, 42, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1090;
}

.demo-sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.demo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--demo-sidebar-mini-width);
    height: 100dvh;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--demo-outline);
    box-shadow: none;
    transform: translateX(0);
    transition: width 0.22s cubic-bezier(0.2, 0, 0, 1), transform 0.22s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.22s cubic-bezier(0.2, 0, 0, 1);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.demo-sidebar.open {
    width: var(--demo-sidebar-width);
    transform: translateX(0);
    box-shadow: 0 16px 34px rgba(18, 28, 52, 0.18);
}

.demo-sidebar-header {
    padding: 10px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.demo-sidebar-top-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.demo-sidebar-close,
.demo-menu-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: var(--demo-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.demo-sidebar-close:hover,
.demo-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2b3037;
}

.demo-sidebar-close svg,
.demo-menu-btn svg {
    width: 20px;
    height: 20px;
}

.demo-sidebar-search-btn {
    height: 32px;
    min-width: 42px;
    padding: 0 12px;
    border: none;
    border-radius: 16px;
    background: #edf2f9;
    color: #5f6368;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.demo-sidebar-search-btn:hover {
    background: #e4ebf6;
    color: #2b3037;
}

.demo-sidebar-search-btn:active {
    background: #dbe4f3;
}

.demo-sidebar-search-btn svg {
    width: 18px;
    height: 18px;
}

.demo-sidebar:not(.open) .demo-sidebar-header {
    align-items: center;
    padding: 10px 10px 8px;
}

.demo-sidebar:not(.open) .demo-sidebar-top-row {
    justify-content: center;
}

.demo-sidebar:not(.open) .demo-sidebar-search-btn,
.demo-sidebar:not(.open) .demo-sidebar-newchat,
.demo-sidebar:not(.open) .demo-sidebar-section-label,
.demo-sidebar:not(.open) .demo-sidebar-agent-list,
.demo-sidebar:not(.open) .demo-sidebar-history,
.demo-sidebar:not(.open) .demo-sidebar-footer {
    display: none;
}

.demo-sidebar-newchat {
    width: 100%;
    min-width: 0;
    height: 36px;
    border-radius: 18px;
    background: transparent;
    color: #2b3037;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 12px;
    font-size: var(--demo-system-font-size);
    font-weight: var(--demo-system-font-weight);
    line-height: var(--demo-system-line-height);
    transition: background 0.15s ease, color 0.15s ease;
}

.demo-sidebar-newchat:hover {
    background: #f2f6fc;
}

.demo-sidebar-newchat:active {
    background: #e9eef7;
}

.demo-sidebar-newchat svg {
    width: 18px;
    height: 18px;
    color: #5f6368;
}

.demo-sidebar-agent-list {
    padding: 4px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.demo-sidebar-agent-entry {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 18px;
    padding: 0 12px;
    background: transparent;
    color: #2b3037;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
    font-size: var(--demo-system-font-size);
    font-weight: var(--demo-system-font-weight);
    line-height: var(--demo-system-line-height);
}

.demo-sidebar-agent-entry:hover {
    background: #f2f6fc;
}

.demo-sidebar-agent-entry-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.demo-sidebar-agent-chevron {
    width: 14px;
    height: 14px;
    color: #707985;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease;
}

.demo-sidebar-agent-chevron svg {
    width: 14px;
    height: 14px;
    display: block;
}

.demo-sidebar-agent-entry[aria-expanded="true"] .demo-sidebar-agent-chevron {
    transform: rotate(90deg);
}

.demo-sidebar-agent-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid #edf1f6;
}

.demo-sidebar-section-label {
    margin-top: 2px;
    padding: 8px 12px 5px;
    font-size: var(--demo-system-font-size);
    font-weight: var(--demo-system-font-weight);
    line-height: var(--demo-system-line-height);
    color: #6f757d;
    border-top: 1px solid #edf1f6;
    letter-spacing: 0;
}

.demo-sidebar-history {
    padding: 4px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.demo-sidebar-footer {
    position: relative;
    padding: 6px 8px calc(10px + var(--demo-safe-area-bottom));
    border-top: 1px solid #edf1f6;
    background: #fff;
    flex-shrink: 0;
    z-index: 4;
}

.demo-sidebar-settings {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    justify-content: flex-start;
    font-family: inherit;
}

.demo-sidebar-settings-dropdown {
    top: auto;
    bottom: calc(100% + 8px);
    left: 8px;
    right: 8px;
    min-width: 0;
    width: auto;
}

.demo-sidebar-history-item {
    display: block;
    text-decoration: none;
    border-radius: 14px;
    padding: 8px 10px;
    transition: background 0.15s ease;
}

.demo-sidebar-history-item:hover {
    background: #f2f6fc;
}

.demo-sidebar-history-title {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #2b3037;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-sidebar-history-meta {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #7a828c;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-sidebar-empty {
    font-size: 12px;
    color: #7f8690;
    padding: 8px 10px 6px;
}

.demo-sidebar-item {
    height: 36px;
    border-radius: 18px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2b3037;
    font-size: var(--demo-system-font-size);
    font-weight: var(--demo-system-font-weight);
    line-height: var(--demo-system-line-height);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s ease, color 0.15s ease;
}

.demo-sidebar-item:hover {
    background: #f2f6fc;
}

.demo-sidebar-item.active {
    background: rgba(26, 115, 232, 0.11);
    color: var(--demo-primary);
    font-weight: 500;
}

.demo-sidebar-item-manage {
    font-weight: 500;
}

.demo-sidebar-item-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #1a73e8;
}

.demo-sidebar-item-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

.demo-sidebar-item-icon-agent {
    font-size: 14px;
    color: #5f6368;
}

.demo-sidebar-item-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-conversation-search-layer {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1380;
}

.demo-conversation-search-layer.show {
    display: block;
}

.demo-conversation-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 29, 40, 0.34);
}

.demo-conversation-search-panel {
    position: relative;
    width: min(760px, calc(100% - 40px));
    max-height: calc(100% - 80px);
    margin: 52px auto 24px;
    border-radius: 20px;
    border: 1px solid #e3e8f1;
    background: #fff;
    box-shadow: 0 28px 64px rgba(18, 28, 52, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.demo-conversation-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 10px;
}

.demo-conversation-search-header h2 {
    margin: 0;
    font-size: 36px;
    font-weight: 400;
    color: #1f1f1f;
    line-height: 1.1;
}

.demo-conversation-search-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 18px;
    background: transparent;
    color: #6c727b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.demo-conversation-search-close:hover {
    background: #f2f6fc;
    color: #2b3037;
}

.demo-conversation-search-close svg {
    width: 19px;
    height: 19px;
}

.demo-conversation-search-input-wrap {
    margin: 0 20px 10px;
    border: 1px solid #d3dbe8;
    border-radius: 999px;
    padding: 0 14px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-conversation-search-input-wrap svg {
    width: 20px;
    height: 20px;
    color: #646b75;
    flex-shrink: 0;
}

.demo-conversation-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 22px;
    color: #1f1f1f;
}

.demo-conversation-search-input::placeholder {
    color: #8a9099;
}

.demo-conversation-search-meta {
    padding: 6px 20px 10px;
    font-size: 24px;
    font-weight: 500;
    color: #1f1f1f;
}

.demo-conversation-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px;
}

.demo-conversation-search-item {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 12px;
    min-height: 54px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.demo-conversation-search-item:hover {
    background: #f2f6fc;
}

.demo-conversation-search-item.active {
    background: rgba(26, 115, 232, 0.1);
}

.demo-conversation-search-item-main {
    min-width: 0;
    flex: 1;
}

.demo-conversation-search-item-title {
    font-size: 24px;
    color: #2b3037;
    line-height: 1.22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-conversation-search-item-snippet {
    margin-top: 2px;
    font-size: 16px;
    color: #7a828c;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-conversation-search-item-date {
    flex-shrink: 0;
    font-size: 24px;
    color: #4a4f55;
}

.demo-conversation-search-highlight {
    background: rgba(26, 115, 232, 0.18);
    border-radius: 4px;
    padding: 0 2px;
}

.demo-conversation-search-empty {
    padding: 22px 14px;
    font-size: 19px;
    color: #7f8690;
}

.demo-page {
    min-height: 100dvh;
    min-height: 100vh;
    padding: calc(20px + var(--demo-safe-area-top)) calc(24px + var(--demo-safe-area-right))
        calc(96px + var(--demo-safe-area-bottom))
        calc(var(--demo-sidebar-mini-width) + 24px + var(--demo-safe-area-left));
}

.demo-topbar,
.demo-main {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.demo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 500;
}

.topbar-brand .demo-menu-btn {
    display: none;
}

.brand-icon {
    font-size: 22px;
    background: linear-gradient(135deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
    -webkit-background-clip: text;
    color: transparent;
}

.brand-badge {
    font-size: 12px;
    color: var(--demo-primary);
    border: 1px solid rgba(26, 115, 232, 0.25);
    background: rgba(26, 115, 232, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
}

.variant-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.variant-pill {
    text-decoration: none;
    font-size: 12px;
    color: var(--demo-muted);
    border: 1px solid var(--demo-outline);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    padding: 4px 10px;
    transition: all 0.16s ease;
}

.variant-pill:hover {
    border-color: #b8c7dc;
    color: #2b3037;
}

.variant-pill.active {
    border-color: rgba(26, 115, 232, 0.34);
    color: var(--demo-primary);
    background: rgba(26, 115, 232, 0.1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--demo-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.topbar-btn:hover {
    background: var(--demo-primary-strong);
    transform: translateY(-1px);
}

.user-menu {
    position: relative;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--demo-surface);
    border: 1px solid var(--demo-outline);
    box-shadow: 0 4px 12px rgba(15, 26, 61, 0.08);
    font-family: inherit;
    cursor: pointer;
}

.user-chip:hover {
    background: #f6f9ff;
}

.user-chip-credits {
    color: var(--demo-primary);
    font-size: 13px;
    font-weight: 500;
}

.user-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4 0%, #9b72cb 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.user-chip-name {
    font-size: 13px;
    color: var(--demo-muted);
}

.user-chip-arrow {
    width: 16px;
    height: 16px;
    color: #7d8692;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--demo-outline);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(15, 26, 61, 0.16);
    padding: 6px;
    z-index: 1300;
}

/* 左侧栏设置必须从 footer 位置向上弹出，避免被通用下拉定位覆盖 */
.demo-sidebar-footer .demo-sidebar-settings-dropdown {
    top: auto;
    right: 8px;
    bottom: calc(100% + 8px);
    left: 8px;
    min-width: 0;
    width: auto;
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    z-index: 1310;
}

.user-dropdown-item {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #2f343b;
    font: inherit;
    font-size: 14px;
    text-align: left;
    padding: 0 10px;
    cursor: pointer;
}

.user-dropdown-item.with-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.menu-item-red-dot,
.settings-item-red-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ea4335;
    box-shadow: 0 0 0 2px rgba(234, 67, 53, 0.16);
    flex-shrink: 0;
}

.user-dropdown-item:hover {
    background: #f2f6fc;
}

.user-dropdown-item.danger {
    color: #c5221f;
}

.demo-main {
    margin-top: 46px;
}

.demo-page-copyright {
    margin: 32px auto 0;
    text-align: center;
    font-size: 12px;
    color: #8a919b;
    letter-spacing: 0.01em;
}

.hero-area {
    text-align: left;
    margin-bottom: 36px;
}

.hero-greeting {
    margin: 0 0 8px;
    font-size: clamp(32px, 2.2vw, 42px);
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
    -webkit-background-clip: text;
    color: transparent;
}

.hero-title {
    margin: 0;
    font-size: clamp(32px, 2.2vw, 42px);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.4px;
    color: #21252b;
}

.combo-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.entry-panel {
    background: var(--demo-surface);
    border: 1px solid var(--demo-outline);
    border-radius: 34px;
    box-shadow: var(--demo-shadow);
    padding: 16px 24px 14px;
    position: relative;
}

.entry-input {
    width: 100%;
    border: none;
    resize: none;
    outline: none;
    font: inherit;
    font-size: 26px;
    line-height: 1.56;
    color: var(--demo-text);
    background: transparent;
    min-height: 102px;
    max-height: 280px;
    padding: 8px 0;
}

.entry-input::placeholder {
    color: #8a9098;
}

.entry-file-input {
    display: none;
}

.entry-file-preview {
    margin-top: 12px;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
}

.entry-file-preview.show {
    display: flex;
}

.entry-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
    height: 34px;
    border: 1px solid #d5deeb;
    border-radius: 999px;
    padding: 0 8px 0 10px;
    background: #f4f7fb;
}

.entry-file-chip-icon {
    font-size: 13px;
    line-height: 1;
}

.entry-file-chip-name {
    font-size: 12px;
    color: #3d434b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-file-chip-remove {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #77808d;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.entry-file-chip-remove:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #2f343b;
}

.entry-footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.entry-left-actions,
.entry-right-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.entry-right-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.entry-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--demo-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
}

.entry-icon-btn:hover {
    background: #edf2f8;
    color: #2d3239;
}

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

.entry-tools-btn,
.entry-model-btn {
    height: 40px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #3b4047;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 6px;
    cursor: pointer;
    transition: background 0.16s ease;
    min-width: 0;
}

.entry-tools-btn:hover,
.entry-model-btn:hover {
    background: #edf2f8;
}

.entry-tools-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.entry-model-btn svg {
    width: 16px;
    height: 16px;
    color: #707680;
    flex-shrink: 0;
}

.entry-tools-btn span {
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#entryModelLabel {
    display: inline-block;
    min-width: 0;
    max-width: min(42vw, 180px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-send-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.32);
    transition: transform 0.15s ease, background 0.15s ease;
}

.entry-send-btn svg {
    width: 23px;
    height: 23px;
}

.entry-send-btn:hover:not(:disabled) {
    background: var(--demo-primary-strong);
    transform: translateY(-1px);
}

.entry-send-btn:disabled {
    background: #c6ceda;
    cursor: not-allowed;
    box-shadow: none;
}

.entry-popover {
    position: absolute;
    bottom: 78px;
    min-width: 196px;
    background: #fff;
    border: 1px solid var(--demo-outline);
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(15, 26, 61, 0.14);
    padding: 6px;
    z-index: 1250;
}

#entryToolsPopover {
    left: 22px;
}

#entryModelPopover {
    right: 22px;
}

.entry-popover-item {
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #2f343b;
    font: inherit;
    font-size: 14px;
    text-align: left;
    padding: 0 10px;
    cursor: pointer;
}

.entry-popover-item:hover {
    background: #f2f6fc;
}

.entry-popover-item.active {
    background: rgba(26, 115, 232, 0.11);
    color: var(--demo-primary);
    font-weight: 500;
}

.combo-divider {
    display: none;
}

.my-agents-section {
    margin-top: 64px;
}

.my-agents-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.agent-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--demo-outline);
    border-radius: 16px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    background: #fff;
    min-height: 66px;
}

.agent-pill:hover {
    background: #f4f8ff;
    transform: translateY(-1px);
}

.agent-pill-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(26, 115, 232, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.agent-pill-name {
    font-size: var(--demo-font-title);
    font-weight: 500;
    line-height: 1.34;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modules-section {
    margin-top: 72px;
    padding-bottom: 20px;
}

.category-group + .category-group {
    margin-top: 34px;
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.section-link {
    color: var(--demo-primary);
    text-decoration: none;
    font-size: 13px;
}

.section-link:hover {
    text-decoration: underline;
}

.section-count {
    font-size: 12px;
    color: var(--demo-muted);
    background: #f0f4f9;
    border-radius: 999px;
    padding: 2px 8px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.module-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    border: 1px solid #e4e9f1;
    border-radius: 18px;
    padding: 16px 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    background: #fff;
    min-height: 98px;
}

.module-card:hover {
    transform: translateY(-1px);
    border-color: #c8d8f0;
    box-shadow: 0 10px 18px rgba(15, 26, 61, 0.08);
}

.module-card-locked {
    opacity: 0.62;
    cursor: not-allowed;
    background: #f1f4f9;
    border-color: #d8dee8;
    box-shadow: none;
    transform: none;
}

.module-card-locked:hover {
    transform: none;
    box-shadow: none;
    border-color: #d8dee8;
}

.module-card-external .module-card-name::after {
    content: " ↗";
    color: var(--demo-muted);
}

.module-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.module-card-info {
    min-width: 0;
}

.module-card-name {
    display: block;
    font-size: var(--demo-font-title);
    font-weight: 500;
    color: var(--demo-text);
    letter-spacing: 0.005em;
}

.module-card-desc {
    display: block;
    font-size: var(--demo-font-muted);
    color: var(--demo-muted);
    margin-top: 4px;
    line-height: 1.45;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.module-card-lock {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #b45309;
}

/* 方案 A：Gemini 风格紧凑网格，避免卡片过长 */
.demo-variant-v1 {
    --v1-content-max-width: 1120px;
    --v1-module-gap: 14px;
    --v1-entry-max-width: calc((var(--v1-content-max-width) * 3 - var(--v1-module-gap)) / 4);
}

.demo-variant-v1 .combo-card {
    width: min(100%, var(--v1-content-max-width));
    margin-left: auto;
    margin-right: auto;
}

/* 🔥 精简版输入框 - 紧凑样式（新增） */
.demo-variant-v1 .entry-panel {
    min-height: 100px;
    padding: 12px 20px 10px;
}

.demo-variant-v1 .entry-input {
    font-size: 18px;
    line-height: 1.5;
    min-height: 40px;
    max-height: 150px;
    padding: 6px 0;
}

.demo-variant-v1 .entry-footer {
    margin-top: 6px;
    padding-top: 8px;
}

.demo-variant-v1 .hero-area,
.demo-variant-v1 .entry-panel,
.demo-variant-v1 .my-agents-section,
.demo-variant-v1 .modules-section {
    max-width: var(--v1-content-max-width);
}

/* 输入框宽度收窄到接近模块前三卡宽度 */
.demo-variant-v1 .entry-panel {
    width: 100%;
    max-width: min(100%, var(--v1-entry-max-width));
    margin-left: 0;
    margin-right: auto;
}

.demo-variant-v1 .hero-greeting {
    font-size: clamp(28px, 2vw, 36px);
}

.demo-variant-v1 .hero-title {
    font-size: clamp(30px, 2.2vw, 38px);
}

.demo-variant-v1 .my-agents-list {
    grid-template-columns: repeat(auto-fit, minmax(208px, 238px));
    justify-content: flex-start;
    gap: 12px;
}

.demo-variant-v1 .section-row {
    justify-content: flex-start;
    gap: 10px;
}

.demo-variant-v1 .section-link {
    margin-left: 8px;
}

.demo-variant-v1 .section-count {
    margin-left: 6px;
}

.demo-variant-v1 .my-agents-section .section-title {
    font-size: 18px;
}

.demo-variant-v1 .modules-section .section-title {
    font-size: 20px;
}

.demo-variant-v1 .agent-pill {
    min-height: 60px;
    padding: 12px 14px;
    border-radius: 14px;
}

.demo-variant-v1 .agent-pill-icon {
    min-width: 36px;
    width: auto;
    height: 36px;
    padding: 0 8px;
    border-radius: 11px;
    white-space: nowrap;
    line-height: 1;
}

.demo-variant-v1 .agent-pill-name {
    font-size: var(--demo-font-title);
    font-weight: 500;
    line-height: 1.34;
}

.demo-variant-v1 .modules-section {
    margin-top: 118px;
}

.demo-variant-v1 .module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
}

.demo-variant-v1 .module-card {
    min-height: 92px;
    padding: 12px 14px;
    border-radius: 16px;
    align-items: center;
    gap: 10px;
}

.demo-variant-v1 .module-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
}

.demo-variant-v1 .module-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
}

.demo-variant-v1 .module-card-name {
    font-size: 16px;
    line-height: 1.34;
    width: 100%;
    font-weight: 500;
}

.demo-variant-v1 .module-card-desc {
    font-size: 13px;
    line-height: 1.4;
    margin-top: 2px;
    width: 100%;
    -webkit-line-clamp: 2;
}

/* 方案 A 桌面端：首屏留白与视觉节奏 */
@media (min-width: 1024px) {
    .demo-variant-v1 .demo-main {
        margin-top: 100px;
    }

    .demo-variant-v1 .hero-area,
    .demo-variant-v1 .entry-panel,
    .demo-variant-v1 .my-agents-section,
    .demo-variant-v1 .modules-section {
        margin-left: auto;
        margin-right: auto;
    }

    .demo-variant-v1 .hero-area {
        margin-bottom: 52px;
    }

    /* 🔥 精简版 - 更紧凑的输入框 */
    .demo-variant-v1 .entry-panel {
        min-height: 96px;
        padding: 12px 20px 8px;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-left: 0;
        margin-right: auto;
    }

    .demo-variant-v1 .entry-input {
        font-size: 18px;
        line-height: 1.5;
        min-height: 44px;
        max-height: 140px;
        padding: 6px 0;
    }

    .demo-variant-v1 .entry-footer {
        margin-top: auto;
        padding-top: 8px;
    }

    .demo-variant-v1 .my-agents-section {
        margin-top: 64px;
    }
}

/* 方案 B：更平衡的居中导语 + 更重的卡片边框 */
.demo-variant-v2 .hero-area {
    text-align: center;
}

.demo-variant-v2 .hero-greeting {
    font-size: clamp(28px, 2vw, 34px);
}

.demo-variant-v2 .hero-title {
    font-size: clamp(32px, 2.8vw, 44px);
}

.demo-variant-v2 .entry-panel {
    border-radius: 30px;
    padding: 16px 22px 13px;
    box-shadow: 0 10px 24px rgba(23, 34, 58, 0.07);
}

.demo-variant-v2 .entry-input {
    min-height: 106px;
    font-size: 19px;
}

.demo-variant-v2 .section-title {
    font-size: 18px;
}

.demo-variant-v2 .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.demo-variant-v2 .module-card {
    border-radius: 18px;
    border-color: #d4deeb;
    min-height: 96px;
}

.demo-variant-v2 .module-card-name {
    font-size: 14px;
}

.demo-variant-v2 .module-card-desc {
    white-space: normal;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 34, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--demo-outline);
    box-shadow: 0 20px 40px rgba(15, 26, 61, 0.22);
    padding: 18px;
}

.login-modal-card {
    width: min(420px, 100%);
}

.register-modal-card {
    width: min(460px, 100%);
    max-height: min(82vh, 860px);
    overflow-y: auto;
    overflow-x: hidden;
}

.settings-modal-card,
.credits-modal-card {
    width: min(520px, 100%);
    max-height: min(78vh, 820px);
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.modal-close-btn {
    border: none;
    background: transparent;
    font-size: 26px;
    color: var(--demo-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.modal-subtitle {
    margin: 8px 0 14px;
    font-size: 13px;
    color: var(--demo-muted);
    line-height: 1.45;
}

.settings-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.settings-summary-item {
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafe;
}

.settings-summary-label {
    display: block;
    font-size: 12px;
    color: #77808b;
}

.settings-summary-value {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    color: #2d3239;
    font-weight: 500;
}

.settings-block {
    margin-top: 14px;
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    padding: 10px 12px 12px;
}

.settings-block-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #2d3239;
}

.settings-title-with-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding-right: 2px;
}

.update-entry {
    border: 1px solid #e6ebf2;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
}

.update-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.update-entry-date {
    font-size: 13px;
    color: #4a5563;
    font-weight: 500;
}

.update-entry-count {
    font-size: 12px;
    color: #6c7580;
}

.update-entry-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #2d3239;
    font-size: 13px;
    line-height: 1.5;
}

.update-entry-list li + li {
    margin-top: 4px;
}

.credits-log-list {
    margin-top: 8px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #e6ebf2;
    border-radius: 10px;
    background: #fff;
}

.credits-log-item {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f3f8;
}

.credits-log-item:last-child {
    border-bottom: none;
}

.credits-log-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.credits-log-reason {
    font-size: 13px;
    color: #2d3239;
}

.credits-log-amount {
    font-size: 13px;
    font-weight: 500;
}

.credits-log-amount.positive {
    color: #0f9d58;
}

.credits-log-amount.negative {
    color: #c5221f;
}

.credits-log-time {
    margin-top: 2px;
    font-size: 12px;
    color: #7a808a;
}

.contact-id-box {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e0e6f0;
    background: #f7faff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.contact-id-value {
    font-size: 15px;
    color: #1f2430;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.referral-link-box {
    align-items: flex-start;
}

.referral-link-value {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
    font-size: 14px;
}

.contact-copy-btn {
    border: none;
    border-radius: 10px;
    background: rgba(26, 115, 232, 0.12);
    color: var(--demo-primary);
    font: inherit;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
}

.contact-copy-btn:hover {
    background: rgba(26, 115, 232, 0.2);
}

.modal-secondary-btn,
.modal-primary-btn {
    width: 100%;
    margin-top: 12px;
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-secondary-btn {
    background: #f0f4f9;
    color: var(--demo-text);
}

.modal-primary-btn {
    background: var(--demo-primary);
    color: #fff;
}

.form-label {
    display: block;
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--demo-muted);
}

.form-input {
    width: 100%;
    border: 1px solid var(--demo-outline);
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--demo-primary);
    box-shadow: 0 0 0 1px var(--demo-primary);
}

.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #6f757d;
}

.register-module-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 4px;
}

.register-module-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--demo-outline);
    border-radius: 999px;
    font-size: 12px;
    color: var(--demo-text);
    background: #fff;
}

.register-module-item input {
    width: 14px;
    height: 14px;
    accent-color: var(--demo-primary);
}

.form-error {
    margin: 10px 0 0;
    padding: 9px 10px;
    font-size: 12px;
    color: #c5221f;
    background: rgba(197, 34, 31, 0.08);
    border-radius: 8px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: #1f1f1f;
    color: #fff;
    font-size: 13px;
    border-radius: 999px;
    padding: 9px 14px;
    z-index: 1100;
}

@media (max-width: 1100px) {
    .my-agents-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-variant-v2 .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-variant-v1 .my-agents-list {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        justify-content: stretch;
    }

    .demo-variant-v1 .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        width: 100%;
    }

    .demo-variant-v1 .entry-panel {
        max-width: 100%;
    }
}

@media (max-width: 920px) {
    .demo-variant-v1 .my-agents-list,
    .demo-variant-v1 .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }
}

@media (max-width: 1023px) {
    .demo-sidebar {
        width: min(86vw, 320px);
        transform: translateX(-100%);
        box-shadow: 0 16px 34px rgba(18, 28, 52, 0.18);
    }

    .demo-sidebar.open {
        width: min(86vw, 320px);
        transform: translateX(0);
    }

    .demo-sidebar:not(.open) .demo-sidebar-header {
        align-items: stretch;
        padding: 10px 12px 6px;
    }

    .demo-sidebar:not(.open) .demo-sidebar-top-row {
        justify-content: space-between;
    }

    .demo-sidebar:not(.open) .demo-sidebar-search-btn {
        display: inline-flex;
    }

    .demo-sidebar:not(.open) .demo-sidebar-newchat {
        display: inline-flex;
    }

    .demo-sidebar:not(.open) .demo-sidebar-section-label {
        display: block;
    }

    .demo-sidebar:not(.open) .demo-sidebar-agent-list,
    .demo-sidebar:not(.open) .demo-sidebar-history {
        display: flex;
    }

    .demo-sidebar:not(.open) .demo-sidebar-footer {
        display: block;
    }

    .demo-page {
        padding: calc(20px + var(--demo-safe-area-top)) calc(24px + var(--demo-safe-area-right))
            calc(96px + var(--demo-safe-area-bottom))
            calc(24px + var(--demo-safe-area-left));
    }

    .topbar-brand .demo-menu-btn {
        display: inline-flex;
    }

    .demo-variant-v1 .modules-section {
        margin-top: 72px;
    }

    .demo-variant-v1 .my-agents-section {
        margin-top: 52px;
    }

    .demo-conversation-search-panel {
        width: calc(100% - 24px);
        max-height: calc(100% - 24px);
        margin: 12px auto;
        border-radius: 18px;
    }

    .demo-conversation-search-header {
        padding: 16px 16px 8px;
    }

    .demo-conversation-search-header h2 {
        font-size: 30px;
    }

    .demo-conversation-search-input-wrap {
        margin: 0 16px 8px;
    }

    .demo-conversation-search-input {
        font-size: 20px;
    }

    .demo-conversation-search-meta {
        padding: 4px 16px 8px;
        font-size: 20px;
    }

    .demo-conversation-search-results {
        padding: 0 8px 10px;
    }

    .demo-conversation-search-item-title,
    .demo-conversation-search-item-date {
        font-size: 20px;
    }

    .demo-conversation-search-item-snippet {
        font-size: 14px;
    }
}

@media (max-width: 760px) {
    .demo-page {
        padding: calc(14px + var(--demo-safe-area-top)) calc(12px + var(--demo-safe-area-right))
            calc(64px + var(--demo-safe-area-bottom))
            calc(12px + var(--demo-safe-area-left));
    }

    .demo-main {
        margin-top: 20px;
    }

    .hero-area {
        margin-bottom: 24px;
    }

    .hero-greeting {
        font-size: 26px;
        margin-bottom: 6px;
    }

    .hero-title {
        font-size: 30px;
    }

    .entry-panel {
        border-radius: 24px;
        padding: 14px 14px 10px;
    }

    .entry-input {
        min-height: 88px;
        max-height: 220px;
        font-size: 20px;
    }

    .entry-footer {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .entry-file-preview {
        margin-top: 10px;
        gap: 6px;
    }

    .entry-file-chip {
        max-width: 100%;
    }

    .entry-file-chip-name {
        max-width: 180px;
    }

    .entry-right-actions {
        margin-left: auto;
    }

    .entry-icon-btn {
        width: 36px;
        height: 36px;
    }

    .entry-tools-btn,
    .entry-model-btn {
        font-size: 14px;
        height: 36px;
        max-width: 42vw;
    }

    .entry-send-btn {
        width: 50px;
        height: 50px;
    }

    .entry-send-btn svg {
        width: 21px;
        height: 21px;
    }

    .module-grid,
    .my-agents-list,
    .demo-variant-v2 .module-grid {
        grid-template-columns: 1fr;
    }

    .demo-variant-v1 .module-grid,
    .demo-variant-v1 .my-agents-list {
        grid-template-columns: 1fr;
    }

    .demo-variant-v1 .my-agents-section .section-title {
        font-size: 16px;
    }

    .demo-variant-v1 .modules-section .section-title {
        font-size: 17px;
    }

    .demo-variant-v1 .my-agents-section {
        margin-top: 44px;
    }

    .demo-variant-v1 .modules-section {
        margin-top: 48px;
    }

    .my-agents-section {
        margin-top: 44px;
    }

    .modules-section {
        margin-top: 48px;
    }

    .variant-switch {
        display: none;
    }

    .demo-sidebar {
        width: min(86vw, 320px);
    }

    .demo-menu-btn {
        width: 36px;
        height: 36px;
    }

    .demo-conversation-search-header h2 {
        font-size: 26px;
    }

    .demo-conversation-search-meta {
        font-size: 18px;
    }

    .demo-conversation-search-input {
        font-size: 18px;
    }

    .demo-conversation-search-item {
        min-height: 48px;
        padding: 8px 10px;
    }

    .demo-conversation-search-item-title,
    .demo-conversation-search-item-date {
        font-size: 17px;
    }

    .demo-conversation-search-item-snippet {
        font-size: 13px;
    }

    .demo-conversation-search-empty {
        font-size: 16px;
    }
}

@media (max-width: 900px) and (max-height: 620px) {
    .demo-page {
        padding-bottom: calc(42px + var(--demo-safe-area-bottom));
    }

    .demo-main {
        margin-top: 16px;
    }

    .entry-panel {
        padding: 12px 12px 10px;
        border-radius: 22px;
    }

    .entry-input {
        min-height: 64px;
        max-height: 150px;
        font-size: 16px;
    }
}
