:root {
    color-scheme: light;
    --bg-color: #f7f8fa;
    --bg-sub: #ffffff;
    --card-bg: #ffffff;
    --elevated-bg: #ffffff;
    --text-main: #1a1d24;
    --text-sub: #5b616e;
    --text-weak: #8a8f9a;
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(0, 0, 0, 0.08);
    --panel-bg: #ffffff;
    --panel-border: rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --seg-bg: rgba(0, 0, 0, 0.05);
    --overlay-bg: rgba(18, 20, 28, 0.45);
    --orb-1: #e4e9ff;
    --orb-2: #eaf0ff;
    --orb-3: #f1e9ff;
    --logo-color: #4d6bfe;
    --primary: #4d6bfe;
    --primary-hover: #3f5cf0;
    --primary-soft: rgba(77, 107, 254, 0.12);
    --success: #34c77b;
    --warning: #f0a83c;
    --danger: #f2555a;
    --danger-soft: rgba(242, 85, 90, 0.1);
    --warning-soft: rgba(240, 168, 60, 0.16);
    --shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
    --shadow-card: 0 4px 16px -4px rgba(16, 24, 40, 0.1);
    --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, 0.2);
    --btn-bg: var(--primary);
    --btn-hover: var(--primary-hover);
    --cord-color: #ced2da;
    --cord-handle: #e2e5ea;
    --action-bg: rgba(0, 0, 0, 0.02);
    --action-border: rgba(0, 0, 0, 0.08);
    --action-hover: rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus: rgba(77, 107, 254, 0.14);
    --focus-ring: rgba(77, 107, 254, 0.4);
    --error-color: var(--danger);
    --gold: #f0a83c;
    --gold-soft: rgba(240, 168, 60, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

body.dark {
    color-scheme: dark;
    --bg-color: #0d0d12;
    --bg-sub: #15151c;
    --card-bg: #1a1a22;
    --elevated-bg: #20202a;
    --text-main: #f2f3f5;
    --text-sub: #a8adb8;
    --text-weak: #6f7480;
    --glass-bg: rgba(21, 21, 28, 0.86);
    --glass-border: rgba(255, 255, 255, 0.08);
    --panel-bg: #1a1a22;
    --panel-border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --seg-bg: rgba(255, 255, 255, 0.06);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --orb-1: #15152b;
    --orb-2: #10182c;
    --orb-3: #1a1230;
    --logo-color: #8ea1ff;
    --primary: #4d6bfe;
    --primary-hover: #6b83ff;
    --primary-soft: rgba(77, 107, 254, 0.18);
    --danger-soft: rgba(242, 85, 90, 0.16);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
    --cord-color: #3a3d46;
    --cord-handle: #555a66;
    --action-bg: rgba(255, 255, 255, 0.04);
    --action-border: rgba(255, 255, 255, 0.08);
    --action-hover: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: rgba(77, 107, 254, 0.2);
    --focus-ring: rgba(107, 131, 255, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    position: relative;
    overflow: hidden;
    scrollbar-color: var(--cord-color) transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary-soft);
    color: var(--text-main);
}

.page-home {
    display: flex;
    flex-direction: column;
}

.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.page-chat {
    display: flex;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.5;
    transition: background 0.5s ease;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--orb-1) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--orb-2) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--orb-3) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.4;
}

.night-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease, visibility 1.5s ease;
    pointer-events: none;
}

body.dark .night-sky {
    opacity: 1;
    visibility: visible;
}

.moon {
    position: absolute;
    top: 12%;
    right: 18%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset -25px 0 0 0 #fef08a;
    filter: drop-shadow(0 0 20px rgba(254, 240, 138, 0.3));
    transform: rotate(-20deg);
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0.8;
}

.pull-cord {
    position: fixed;
    top: 0;
    right: 24px;
    z-index: 200;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.cord-line {
    width: 2px;
    height: 80px;
    background: var(--cord-color);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s;
}

.cord-handle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cord-handle);
    border: 2px solid var(--cord-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s, border-color 0.5s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pull-cord.pulling .cord-line {
    height: 110px;
}

.pull-cord.pulling .cord-handle {
    transform: translateY(30px);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    width: 100%;
    transition: color 0.25s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--logo-color);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
}

.lang-switch {
    display: flex;
    background: var(--seg-bg);
    border-radius: 100px;
    padding: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
}

.lang-switch span {
    padding: 6px 16px;
    border-radius: 100px;
    color: var(--text-sub);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    user-select: none;
}

.lang-switch span:hover {
    color: var(--text-main);
}

.lang-switch span.active {
    background: var(--panel-bg);
    color: var(--logo-color);
    box-shadow: var(--shadow);
}

.main-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 80px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    min-height: 0;
}

.hero-title {
    font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: 0.15em;
    line-height: 1.3;
    margin-bottom: 56px;
    text-align: center;
}

body.dark .hero-title {
    text-shadow: none;
}

.input-wrapper {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-card), 0 0 0 3px var(--focus-ring);
}

textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1.05rem;
    color: var(--text-main);
    min-height: 56px;
    padding: 8px 0;
    background: transparent;
    line-height: 1.6;
    font-family: inherit;
}

textarea::placeholder {
    color: var(--text-sub);
    font-weight: 300;
}

.input-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--btn-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-card);
}

.send-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    margin-left: -1px;
    margin-top: 1px;
}

.bottom-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 100px;
    background: var(--action-bg);
    border: 1px solid var(--action-border);
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.action-btn:hover {
    background: var(--action-hover);
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.user-wrapper {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px 6px 6px;
    border-radius: 100px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.user-badge:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-name {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    min-width: 170px;
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--elevated-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.menu-item:focus-visible {
    outline: none;
    background: var(--hover-bg);
    box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.menu-item.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--overlay-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 28px 24px 20px;
    border-radius: var(--radius-md);
    background: var(--elevated-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal {
    transform: none;
}

.solid-modal {
    max-width: 400px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-desc.warning-text {
    color: var(--error-color);
    font-size: 0.85rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.modal-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.modal-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal-btn.cancel {
    background: var(--input-bg);
    color: var(--text-sub);
    border: 1px solid var(--input-border);
}

.modal-btn.cancel:hover:not(:disabled) {
    background: var(--action-hover);
    color: var(--text-main);
}

.modal-btn.confirm {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--danger-soft);
}

.modal-btn.confirm:hover:not(:disabled) {
    background: #e04348;
    transform: translateY(-1px);
}

.modal-btn.primary-btn {
    background: var(--btn-bg);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-soft);
}

.modal-btn.primary-btn:hover:not(:disabled) {
    background: var(--btn-hover);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-sub);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    background: var(--input-focus);
    color: var(--text-main);
}

.modal-close svg {
    width: 14px;
    height: 14px;
}

.modal-close.show-close {
    display: flex;
}

.achievement-modal .modal-close {
    display: flex;
}

.achievement-modal {
    max-width: 360px;
}

.achievement-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-icon svg {
    width: 38px;
    height: 38px;
}

.achievement-label {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 10px;
}

.achievement-title {
    font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: 0.08em;
}

.achievement-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 24px;
}

.achievement-modal .modal-btn.confirm {
    background: var(--gold);
    box-shadow: 0 2px 8px var(--warning-soft);
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    padding: 12px 22px;
    border-radius: 100px;
    background: var(--elevated-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 500;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 52px;
    height: 52px;
    color: var(--logo-color);
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-sub);
    font-weight: 300;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    font-size: 0.95rem;
    color: var(--text-main);
    caret-color: var(--primary);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-weak);
    font-weight: 300;
}

.form-group input:focus,
.form-group input:focus-visible,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-sub);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group input.error,
.form-group.has-error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}

.form-group.code-group {
    flex-direction: row;
    align-items: center;
    position: relative;
    gap: 0;
}

.form-group.code-group input {
    padding-right: 140px;
}

.code-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--logo-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.code-btn:hover:not(:disabled) {
    background: var(--primary-soft);
}

.code-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.code-btn:disabled {
    color: var(--text-weak);
    cursor: not-allowed;
}

.form-error {
    min-height: 20px;
    font-size: 0.85rem;
    color: var(--error-color);
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-error.show {
    opacity: 1;
}

.login-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--btn-bg);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 14px var(--primary-soft);
    margin-top: 4px;
}

.login-btn:hover:not(:disabled) {
    background: var(--btn-hover);
}

.login-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.login-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.login-agreement {
    font-size: 0.75rem;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.6;
    font-weight: 300;
}

.login-agreement a {
    color: var(--logo-color);
    text-decoration: none;
}

.login-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.login-switch-link {
    border: none;
    background: transparent;
    padding: 4px 2px;
    color: var(--text-sub);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
}

.login-switch-link:hover {
    color: var(--logo-color);
}

.login-footer {
    text-align: center;
    margin-top: 28px;
}

.login-footer a {
    color: var(--text-sub);
    font-size: 0.85rem;
    text-decoration: none;
}

.settings-overlay {
    background: var(--overlay-bg);
}

.settings-panel {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 800px;
    height: 480px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(8px) scale(0.99);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-overlay.show .settings-panel {
    transform: none;
}

.settings-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.settings-close:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.settings-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.settings-close svg {
    width: 16px;
    height: 16px;
}

.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 28px 16px;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0 12px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.settings-nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.settings-nav-item:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.settings-nav-item.active {
    background: var(--primary-soft);
    color: var(--logo-color);
}

.settings-content {
    flex: 1;
    padding: 36px 36px 28px;
    overflow-y: auto;
    scrollbar-color: var(--cord-color) transparent;
}

.settings-content::-webkit-scrollbar,
.batch-list::-webkit-scrollbar {
    width: 8px;
}

.settings-content::-webkit-scrollbar-track,
.batch-list::-webkit-scrollbar-track {
    background: transparent;
}

.settings-content::-webkit-scrollbar-thumb,
.batch-list::-webkit-scrollbar-thumb {
    background: var(--cord-color);
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb:hover,
.batch-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-weak);
}

body.dark input:-webkit-autofill,
body.dark input:-webkit-autofill:hover,
body.dark input:-webkit-autofill:focus,
body.dark textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--text-main);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-sub) inset;
    caret-color: var(--text-main);
    transition: background-color 9999s ease-out;
}

.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.settings-block {
    margin-bottom: 28px;
}

.settings-block-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 14px;
}

.theme-options {
    display: flex;
    gap: 12px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: transparent;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-option svg {
    width: 22px;
    height: 22px;
    color: var(--text-sub);
}

.theme-option:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
}

.theme-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.theme-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.theme-option.active svg {
    color: var(--logo-color);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid var(--panel-border);
}

.settings-row-label {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 500;
}

.settings-row-value {
    font-size: 0.88rem;
    color: var(--text-sub);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-select {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--seg-bg);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.settings-select svg {
    width: 14px;
    height: 14px;
    color: var(--text-sub);
}

.settings-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.88rem;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.account-action-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-action-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--logo-color);
}

.account-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.account-action-btn.danger {
    color: var(--danger);
    border-color: var(--danger-soft);
}

.account-action-btn.danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: var(--danger);
}

.chat-sidebar {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    height: 100vh;
    padding: 18px 14px;
    background: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    z-index: 30;
}

.chat-sidebar.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
    opacity: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--logo-color);
    letter-spacing: -0.5px;
    line-height: 1;
}

.sidebar-logo svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.sidebar-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.new-chat-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--logo-color);
}

.new-chat-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.new-chat-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-sub);
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    caret-color: var(--primary);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-search input:focus {
    border-color: var(--primary);
    background: var(--bg-sub);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

@keyframes dsAutoFillStart {
    from { opacity: 1; }
    to { opacity: 1; }
}

#search-input:-webkit-autofill {
    animation-name: dsAutoFillStart;
    animation-duration: 1ms;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    margin: 0 -6px;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
}

.conversation-list::-webkit-scrollbar {
    width: 4px;
}

.conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: var(--cord-color);
    border-radius: 2px;
}

.conv-section {
    font-size: 0.72rem;
    color: var(--text-sub);
    padding: 10px 10px 4px;
    letter-spacing: 0.05em;
}

.conv-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.82rem;
}

.conv-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.conv-item:hover {
    background: var(--hover-bg);
}

.conv-item.active {
    background: var(--primary-soft);
}

.conv-title {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-item.active .conv-title {
    color: var(--logo-color);
    font-weight: 500;
}

.conv-more {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.2s ease;
}

.conv-item:hover .conv-more {
    display: flex;
}

.conv-more:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.conv-more:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.conv-more svg {
    width: 14px;
    height: 14px;
}

.conv-pin-icon {
    width: 12px;
    height: 12px;
    color: var(--logo-color);
    flex-shrink: 0;
}

.conv-menu {
    position: fixed;
    z-index: 600;
    min-width: 160px;
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--elevated-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conv-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.conv-menu button svg {
    width: 15px;
    height: 15px;
    color: var(--text-sub);
    flex-shrink: 0;
}

.conv-menu button:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.conv-menu button.danger {
    color: var(--danger);
}

.conv-menu button.danger svg {
    color: var(--danger);
}

.conv-menu button.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.sidebar-user {
    position: relative;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
}

.sidebar-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sidebar-user-badge:hover {
    background: var(--hover-bg);
}

.sidebar-user-badge:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--btn-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user .user-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: auto;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.sidebar-open {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    background: var(--panel-bg);
    color: var(--text-sub);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-open:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

.sidebar-open:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.sidebar-open svg {
    width: 18px;
    height: 18px;
}

.chat-sidebar.collapsed + .chat-main .sidebar-open {
    display: flex;
}

.chat-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
}

.chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.chat-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: var(--cord-color);
    border-radius: 3px;
}

.chat-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-sub);
}

.chat-welcome {
    width: 100%;
    max-width: 780px;
    margin: auto;
    text-align: center;
    padding: 80px 0 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.chat-welcome-title {
    font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--text-main);
    letter-spacing: 0.15em;
    line-height: 1.3;
    margin-bottom: 14px;
}

.chat-welcome-sub {
    font-size: 0.95rem;
    color: var(--text-sub);
    font-weight: 300;
}

.chat-messages {
    width: 100%;
    max-width: 780px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeInMessages 0.3s ease;
}

@keyframes fadeInMessages {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: msgFadeIn 0.25s ease forwards;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

.msg.user .msg-avatar {
    background: var(--btn-bg);
    color: #fff;
}

.msg.assistant .msg-avatar {
    background: var(--primary-soft);
    color: var(--logo-color);
}

.msg-avatar svg {
    width: 18px;
    height: 18px;
}

.msg.user {
    flex-direction: row-reverse;
}

.msg.user .msg-body {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.msg.user .msg-content {
    text-align: left;
    background: var(--primary-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
    padding: 10px 14px;
    max-width: 100%;
}

.msg.user .msg-content code {
    background: var(--panel-border);
}

.msg-body {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.msg-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.msg-content {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.msg-content p {
    margin-bottom: 12px;
}

.msg-content p:last-child {
    margin-bottom: 0;
}

.msg-content ul,
.msg-content ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.msg-content ul:last-child,
.msg-content ol:last-child {
    margin-bottom: 0;
}

.msg-content li {
    margin-bottom: 6px;
}

.msg-content li:last-child {
    margin-bottom: 0;
}

.msg-content strong {
    font-weight: 600;
}

.msg-content .msg-h {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.msg-content .msg-empty {
    color: var(--text-sub);
}

.msg-content code {
    background: var(--input-bg);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 0.88em;
    color: var(--logo-color);
}

.code-block {
    --code-bg: #f6f7fb;
    --code-text: #2d3748;
    --code-border: rgba(0, 0, 0, 0.08);
    --code-header-bg: rgba(0, 0, 0, 0.03);
    --code-header-border: rgba(0, 0, 0, 0.08);
    --code-header-text: #6b7280;
    --code-action-text: #6b7280;
    --code-action-hover: rgba(0, 0, 0, 0.06);
    --code-action-hover-text: #374151;
    margin: 14px 0;
    border-radius: var(--radius-md);
    background: var(--code-bg);
    color: var(--code-text);
    overflow: hidden;
    border: 1px solid var(--code-border);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body.dark .code-block {
    --code-bg: #15151c;
    --code-text: #e4e4eb;
    --code-border: rgba(255, 255, 255, 0.08);
    --code-header-bg: rgba(255, 255, 255, 0.04);
    --code-header-border: rgba(255, 255, 255, 0.06);
    --code-header-text: #a1a1aa;
    --code-action-text: #a1a1aa;
    --code-action-hover: rgba(255, 255, 255, 0.08);
    --code-action-hover-text: #e4e4eb;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--code-header-bg, rgba(255, 255, 255, 0.04));
    border-bottom: 1px solid var(--code-header-border, rgba(255, 255, 255, 0.06));
    font-size: 0.78rem;
    color: var(--code-header-text, #a1a1aa);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body.dark .code-block-header {
    --code-header-bg: rgba(255, 255, 255, 0.04);
    --code-header-border: rgba(255, 255, 255, 0.06);
    --code-header-text: #a1a1aa;
}

.code-lang {
    font-family: "SF Mono", Consolas, Monaco, monospace;
    letter-spacing: 0.03em;
}

.code-actions {
    display: flex;
    gap: 6px;
}

.code-action {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--code-action-text, #a1a1aa);
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark .code-action {
    --code-action-text: #a1a1aa;
}

.code-action:hover {
    background: var(--code-action-hover, rgba(255, 255, 255, 0.08));
    color: var(--code-action-hover-text, #e4e4eb);
}

.code-action svg {
    width: 13px;
    height: 13px;
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre;
    color: var(--code-text);
}

.code-block pre::-webkit-scrollbar {
    height: 6px;
}

.code-block pre::-webkit-scrollbar-track {
    background: transparent;
}

.code-block pre::-webkit-scrollbar-thumb {
    background: var(--code-scrollbar-thumb, rgba(255, 255, 255, 0.15));
    border-radius: 3px;
}

.code-block pre::-webkit-scrollbar-thumb:hover {
    background: var(--code-scrollbar-thumb-hover, rgba(255, 255, 255, 0.25));
}

body .code-block pre::-webkit-scrollbar-thumb {
    --code-scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --code-scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);
}

body.dark .code-block pre::-webkit-scrollbar-thumb {
    --code-scrollbar-thumb: rgba(255, 255, 255, 0.15);
    --code-scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 6px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-sub);
    animation: typing 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-area {
    position: relative;
    flex-shrink: 0;
    padding: 12px 24px 14px;
    background: linear-gradient(to top, var(--bg-color) 55%, transparent);
    z-index: 20;
}

.chat-input-box {
    max-width: 780px;
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-card), 0 0 0 3px var(--focus-ring);
}

.chat-input-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tool-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--input-border);
    background: transparent;
    color: var(--text-sub);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tool-chip svg {
    width: 14px;
    height: 14px;
}

.tool-chip:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
    color: var(--logo-color);
}

.tool-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.tool-chip.active {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: #fff;
}

.tool-chip.active:hover {
    background: var(--btn-hover);
    border-color: var(--btn-hover);
    color: #fff;
}

#chat-input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.98rem;
    color: var(--text-main);
    caret-color: var(--primary);
    padding: 4px 0;
    background: transparent;
    line-height: 1.6;
    font-family: inherit;
    min-height: 28px;
    max-height: 200px;
}

#chat-input::placeholder {
    color: var(--text-weak);
    font-weight: 300;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.input-hint {
    font-size: 0.72rem;
    color: var(--text-sub);
    font-weight: 300;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--btn-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 2px 8px var(--primary-soft);
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.chat-send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.chat-send-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.chat-send-btn svg {
    width: 16px;
    height: 16px;
}

.chat-send-btn.loading svg {
    display: none;
}

.chat-send-btn.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chat-disclaimer {
    max-width: 780px;
    margin: 10px auto 0;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-sub);
    font-weight: 300;
    pointer-events: auto;
}

.share-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.share-link-box input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    min-width: 0;
}

.share-copy-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--btn-bg);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.share-copy-btn:hover {
    background: var(--btn-hover);
}

.share-copy-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 16px;
    text-align: left;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.batch-item:hover {
    background: var(--hover-bg);
}

.batch-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--btn-bg);
    cursor: pointer;
    flex-shrink: 0;
}

.batch-item-title {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-page-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 24px;
    overflow-y: auto;
}

.share-page-wrap {
    width: 100%;
    max-width: 780px;
}

.share-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    color: var(--logo-color);
    font-size: 1.15rem;
    font-weight: 600;
}

.share-page-header svg {
    width: 24px;
    height: 24px;
}

.share-page-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
    font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
    letter-spacing: 0.05em;
}

.share-page-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 32px;
}

.share-page-foot {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
    text-align: center;
}

.share-page-foot a {
    color: var(--logo-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 820px) {
    .chat-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 12px 0 32px rgba(0, 0, 0, 0.15);
    }
    .chat-sidebar.mobile-open {
        transform: translateX(0);
    }
    .chat-sidebar.collapsed {
        width: 280px;
        padding: 18px 14px;
        opacity: 1;
        overflow: visible;
        transform: translateX(-100%);
    }
    .sidebar-open {
        display: flex;
    }
    .chat-scroll {
        padding: 70px 16px 24px;
    }
    .chat-input-area {
        padding: 12px 16px 10px;
    }
}

@media (max-width: 720px) {
    .settings-panel {
        flex-direction: column;
        height: 80vh;
        max-height: 640px;
        border-radius: 20px;
    }
    .settings-sidebar {
        width: 100%;
        padding: 20px 16px 12px;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        gap: 14px;
    }
    .settings-title {
        padding: 0 8px;
    }
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 4px;
    }
    .settings-nav-item {
        width: auto;
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .settings-content {
        padding: 24px 20px;
    }
    .theme-options {
        gap: 8px;
    }
    .theme-option {
        padding: 16px 6px;
        font-size: 0.8rem;
    }
    .theme-option svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 16px 60px 16px 20px;
    }
    .nav-right {
        gap: 12px;
    }
    .nav-link {
        display: none;
    }
    .pull-cord {
        right: 10px;
    }
    .cord-line {
        height: 60px;
    }
    .cord-handle {
        width: 12px;
        height: 12px;
    }
    .pull-cord.pulling .cord-line {
        height: 80px;
    }
    .pull-cord.pulling .cord-handle {
        transform: translateY(20px);
    }
    .main-content {
        padding: 80px 20px 60px;
    }
    .hero-title {
        margin-bottom: 40px;
    }
    .input-wrapper {
        padding: 12px 16px;
        border-radius: 20px;
    }
    .moon {
        width: 60px;
        height: 60px;
        top: 10%;
        right: 10%;
    }
    .bottom-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    .action-btn {
        justify-content: center;
        width: 100%;
    }
    .user-wrapper {
        bottom: 16px;
        left: 16px;
    }
    .user-badge {
        padding: 5px 14px 5px 5px;
    }
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .user-name {
        font-size: 0.85rem;
        max-width: 90px;
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 1.4rem;
    }
}
.page-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-wrap {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.error-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--logo-color);
    letter-spacing: -0.5px;
    margin-bottom: 48px;
}

.error-logo svg {
    width: 24px;
    height: 24px;
}

.error-code {
    font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 300;
    color: var(--logo-color);
    line-height: 1;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

body.dark .error-code {
    text-shadow: none;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.error-desc {
    font-size: 0.92rem;
    color: var(--text-sub);
    line-height: 1.7;
    margin-bottom: 36px;
    font-weight: 300;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
}

.error-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--logo-color);
    transform: translateY(-1px);
}

.error-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.error-btn.primary {
    background: var(--btn-bg);
    border-color: var(--btn-bg);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-soft);
}

.error-btn.primary:hover {
    background: var(--btn-hover);
    border-color: var(--btn-hover);
    color: #ffffff;
}

@media (max-width: 480px) {
    .error-actions {
        flex-direction: column;
        width: 100%;
    }
    .error-btn {
        width: 100%;
    }
    .error-logo {
        margin-bottom: 32px;
    }
}

.announce-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--gold-soft);
    border: 1px solid var(--warning-soft);
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 26px;
}

.announce-bar svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--gold);
}

.chat-main > .announce-bar {
    flex: 0 0 auto;
    width: auto;
    align-items: center;
    margin: 0;
    border-radius: 0;
    border-width: 0 0 1px 0;
}

.chat-main > .announce-bar > svg {
    margin-top: 0;
}

.announce-bar > span {
    flex: 1 1 auto;
    min-width: 0;
}

.announce-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-left: 4px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announce-close:hover {
    background: var(--warning-soft);
    color: var(--text-main);
}

.announce-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.announce-close svg {
    width: 14px;
    height: 14px;
    margin: 0;
    color: inherit;
}

@media (max-width: 820px) {
    .chat-main > .announce-bar {
        padding-left: 62px;
    }
}

@media (max-width: 420px) {
    .hero-title,
    .chat-welcome-title {
        letter-spacing: 0.08em;
    }
    .chat-scroll {
        padding: 64px 14px 20px;
    }
    .chat-input-box {
        padding: 12px 14px;
    }
    .settings-panel {
        height: 88vh;
    }
    .toast {
        max-width: calc(100vw - 32px);
        white-space: normal;
        text-align: center;
    }
}

body.page-chat .msg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

body.page-chat .msg:hover .msg-actions,
body.page-chat .msg.editing .msg-actions,
body.page-chat .msg-actions:focus-within {
    opacity: 1;
}

body.page-chat .msg.user .msg-actions {
    justify-content: flex-end;
}

body.page-chat .msg-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: none;
    border-radius: 100px;
    background: transparent;
    color: var(--text-sub);
    font-family: inherit;
    font-size: 0.75rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

body.page-chat .msg-action:hover {
    background: var(--hover-bg);
    color: var(--text-main);
}

body.page-chat .msg-action svg {
    width: 14px;
    height: 14px;
}

body.page-chat .msg-action.playing {
    color: var(--primary);
}

body.page-chat .msg-action.loading {
    opacity: 0.55;
}

body.page-chat .msg-action:disabled {
    cursor: default;
}

body.page-chat .msg-edit {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

body.page-chat .msg-edit-input {
    width: 100%;
    min-height: 64px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
}

body.page-chat .msg-edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
}

body.page-chat .msg-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

body.page-chat .msg-edit-btn {
    padding: 6px 14px;
    border: 1px solid var(--input-border);
    border-radius: 100px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

body.page-chat .msg-edit-btn:hover:not(:disabled) {
    background: var(--hover-bg);
}

body.page-chat .msg-edit-btn.primary {
    background: var(--btn-bg);
    border-color: transparent;
    color: #fff;
}

body.page-chat .msg-edit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

body.page-chat .voice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.page-chat .voice-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

body.page-chat .voice-option:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
}

body.page-chat .voice-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

body.page-chat .voice-option input {
    accent-color: var(--primary);
    flex-shrink: 0;
}

body.page-chat .voice-option-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.page-chat .voice-option-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
}

body.page-chat .voice-option-desc {
    font-size: 0.76rem;
    color: var(--text-sub);
}

body.page-chat .voice-preview {
    flex-shrink: 0;
    padding: 4px 12px;
    border: 1px solid var(--input-border);
    border-radius: 100px;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

body.page-chat .voice-preview:hover:not(:disabled) {
    background: var(--hover-bg);
}

body.page-chat .voice-preview:disabled {
    opacity: 0.6;
    cursor: default;
}

body.page-chat .voice-switch {
    position: relative;
    width: 44px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 100px;
    background: var(--seg-bg);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease;
}

body.page-chat .voice-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}

body.page-chat .voice-switch.active {
    background: var(--primary);
}

body.page-chat .voice-switch.active span {
    transform: translateX(20px);
}

@media (hover: none), (max-width: 820px) {
    body.page-chat .msg-actions {
        opacity: 1;
    }
}

.brand-logo {
    display: block;
}

.logo svg.brand-logo,
.error-logo svg.brand-logo,
.share-page-header svg.brand-logo,
.sidebar-logo svg.brand-logo {
    width: auto;
    height: 36px;
    flex-shrink: 0;
}

.login-header svg.brand-logo {
    display: block;
    width: auto;
    height: 38px;
    margin: 0 auto 20px;
}

.brand-mark {
    display: block;
}

body.page-home:not(.share-page-body) {
    overflow-y: auto;
    overflow-x: hidden;
}

body.page-home:not(.share-page-body) .main-content {
    min-height: 100vh;
}

.site-footer {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    width: 100%;
    padding: 56px 48px 40px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px 24px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.footer-col-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-weak);
}

.footer-link {
    font-size: 0.88rem;
    color: var(--text-sub);
    text-decoration: none;
    word-break: break-word;
    transition: color 0.18s ease;
}

.footer-link:hover {
    color: var(--text-main);
}

.footer-bottom {
    max-width: 1120px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-weak);
}

body.page-legal,
body.page-security,
body.page-join {
    height: auto;
    min-height: 100vh;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
}

.pub-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 24px 0;
}

.pub-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.pub-brand svg.brand-logo {
    display: block;
    width: auto;
    height: 32px;
}

.pub-back {
    font-size: 0.88rem;
    color: var(--text-sub);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.pub-back:hover {
    color: var(--text-main);
}

.pub-main {
    position: relative;
    z-index: 10;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 96px;
}

.pub-title {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0.02em;
    margin-bottom: 10px;
}

.pub-updated {
    font-size: 0.82rem;
    color: var(--text-weak);
    margin-bottom: 40px;
}

.pub-nav {
    display: flex;
    gap: 18px;
    margin-bottom: 36px;
}

.pub-nav a {
    font-size: 0.88rem;
    color: var(--logo-color);
    text-decoration: none;
}

.pub-nav a:hover {
    text-decoration: underline;
}

.pub-section {
    margin-bottom: 44px;
    scroll-margin-top: 32px;
}

.pub-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

.pub-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 22px 0 8px;
}

.pub-section p {
    font-size: 0.94rem;
    line-height: 1.85;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.pub-section ul {
    margin: 0 0 12px;
    padding-left: 22px;
}

.pub-section li {
    font-size: 0.94rem;
    line-height: 1.85;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.pub-section a {
    color: var(--primary);
    text-decoration: none;
}

.pub-section a:hover {
    text-decoration: underline;
}

@media (max-width: 820px) {
    .site-footer {
        padding: 40px 24px 32px;
    }
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .logo svg.brand-logo {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        margin-top: 32px;
    }
}

body.page-home .getapp,
body.page-chat .getapp {
    position: relative;
    display: inline-flex;
}

body.page-home .getapp-trigger,
body.page-chat .getapp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

body.page-home .getapp-trigger:hover,
body.page-chat .getapp-trigger:hover {
    color: var(--text-main);
}

body.page-home .getapp-trigger svg,
body.page-chat .getapp-trigger svg {
    width: 15px;
    height: 15px;
    flex: none;
}

body.page-home .getapp-pop,
body.page-chat .getapp-pop {
    position: absolute;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 222px;
    max-width: calc(100vw - 24px);
    padding: 16px 16px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: #1b1b23;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

body.page-home .getapp-pop::after,
body.page-chat .getapp-pop::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    background: #1b1b23;
}

body.page-home .getapp-open .getapp-pop,
body.page-chat .getapp-open .getapp-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.page-home .getapp-qr,
body.page-chat .getapp-qr {
    display: block;
    width: 190px;
    height: 190px;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
}

body.page-home .getapp-tip,
body.page-chat .getapp-tip {
    color: #c9ccd4;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: center;
}

body.page-home .getapp-dl,
body.page-chat .getapp-dl {
    color: #8fa4ff;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
}

body.page-home .getapp-dl:hover,
body.page-chat .getapp-dl:hover {
    text-decoration: underline;
}

body.page-home .getapp-pop {
    top: calc(100% + 12px);
    right: 0;
    transform: translateY(-6px);
}

body.page-home .getapp-pop::after {
    top: -6px;
    right: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
}

body.page-chat .getapp {
    display: flex;
    width: 100%;
}

body.page-chat .getapp-trigger {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}

body.page-chat .getapp-trigger:hover {
    background: var(--hover-bg);
}

body.page-chat .getapp-pop {
    bottom: calc(100% + 12px);
    left: 0;
    transform: translateY(6px);
}

body.page-chat .getapp-pop::after {
    bottom: -6px;
    left: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(45deg);
}