
:root {
    --brand-green: #2563eb;
    --brand-orange: #cc6633;
    --bubble-w: 20cm;
    --bubble-min-h: 1.8cm;
    --bubble-max-h: 8cm;
    --bubble-radius: 10px;
    --glow-color: rgba(0, 0, 0, .04);
    --glow-size: 18px;
    --glow-spread: 5px;
    --history-side-pad: 0.6cm;
    --btn-dim: 1cm;
    --toolbar-h: 0.5cm;
    --new-top: 0.96cm;
    --new-height: 1.00cm;
    --new-width: 1.74cm;
    --new-font: 15pt;
    --chat-top-pad: 2.6cm;
    --bubble-vert-gap: 24px;
    --input-w: 100%;
    --input-top-gap: 0.3cm;
    --input-min-h: 24px;
    --input-max-h: 200px;
    --form-bottom: 5cm;
    --form-height: var(--bubble-min-h);
    --backgraund-color: #faf9f7;
    --sidebar-width: 260px;
    --current-sidebar-width: var(--sidebar-width);
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

body.sidebar-collapsed {
    --current-sidebar-width: 64px;
}



#chat-wrapper {
    margin-left: var(--current-sidebar-width);
    width: auto;
    max-width: none;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--new-top) ) 0 calc(var(--form-bottom) + var(--form-height) + 0.5cm);
    transition: margin-left 0.3s ease;
}

#specialization-page {
    margin-left: var(--current-sidebar-width);
    width: calc(100% - var(--current-sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

#chat-input-wrapper {
    display: flex;
    flex-direction: column;
    margin-left: var(--current-sidebar-width);
    padding: 0 16px;
}

#chat-history {
    width: 90%;
    max-width: var(--bubble-w);
    margin: 0 auto;
    box-sizing: border-box;
}

/* Improved Chat Bubble Styles */
.chat-bubble.user {
    background-color: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.chat-bubble.bot {
    background-color: #ffffff;
    color: #1f2937;
    border-bottom-left-radius: 2px;
}

/* Spinner for Chat Bubble */
.chat-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

.loading-text {
    font-size: 0.9rem;
    color: #6c757d;
    vertical-align: middle;
}

.memory-usage-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-right: 10px;
}

.memory-usage-bar {
    position: relative;
    width: 40px;
    height: 8px;
    background: rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    overflow: hidden;
}

.memory-usage-fill {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 8px;
    transition: width 0.2s ease;
}

.memory-usage-text {
    font-size: 12px;
    color: #64748b;
    user-select: none;
    white-space: nowrap;
}

.input-usage-container {
    display: flex;
    align-items: center;
    padding: 0;
}

.input-usage-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-usage-bar {
    position: relative;
    width: 40px;
    height: 8px;
    background: rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    overflow: hidden;
}

.input-usage-fill {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 8px;
    transition: width 0.2s ease;
}

html, body {
    height: 100%;
}

body {
    background: var(--backgraund-color);
}

.chat-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: visible;
}

.chat-container > h3 {
    display: none;
}

.logo {
    position: fixed;
    min-width: 260px;
    left: calc((100vw + var(--current-sidebar-width)) / 2);
    transform: translateX(-50%);
    font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', '微软雅黑', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #000;
    white-space: nowrap;
    transition: opacity .4s ease, transform .4s ease, left 0.3s ease;
    user-select: none;
}

#hero-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    line-height: 1;
}

#hero-logo .hero-logo-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

#hero-logo .hero-logo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

#hero-logo .brand-beta {
    color: #3b82f6;
    font-size: 14px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

#hero-logo .hero-logo-subline {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    letter-spacing: 0;
    line-height: 1.35;
    text-shadow: none;
    white-space: normal;
    text-align: center;
    max-width: min(720px, 90vw);
}

#hero-logo .feature-disabled {
    color: #9ca3af;
}

#hero-logo {
    bottom: calc(35vh + 8cm);
    font-size: 40pt;
    text-shadow: -7px 4px 13px rgba(0, 0, 0, .14);
    z-index: 5;
}

body.engaged #hero-logo {
    opacity: 0;
    pointer-events: none;
}

#hero-logo .em {
    color: var(--brand-green);
}



@media (max-width: 767.98px) {
    /* 手机端及小平板 logo 居中显示 */
    .logo {
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }
}

#chat-form {
    position: fixed;
    left: calc((100vw + var(--current-sidebar-width)) / 2);
    transform: translateX(-50%);
    bottom: 25vh;
    width: var(--bubble-w);
    max-width: calc(90vw - var(--current-sidebar-width));
    background: #f4f4f4;
    border-radius: 26px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: bottom .45s ease, left 0.3s ease, max-width 0.3s ease;
    box-shadow: none;
    border: 1px solid transparent;
    height: auto;
    box-sizing: border-box;
}



#chat-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-left-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-left-top,
.chat-left-actions {
    display: contents;
}

.chat-right-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intent-dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
}

.intent-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.intent-trigger {
    width: 100%;
    height: 36px;
    padding: 0 34px 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    position: relative;
    user-select: none;
}

.intent-trigger::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}

.intent-trigger:hover {
    border-color: #cbd5e1;
}

.intent-trigger:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.intent-dropdown.open .intent-trigger {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.intent-dropdown.open .intent-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.intent-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    display: none;
    z-index: 1200;
}

.intent-dropdown.open .intent-menu {
    display: block;
}

.intent-option {
    width: 100%;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: pointer;
    text-align: left;
}

.intent-option:hover {
    background: #f1f5f9;
}

.intent-option.is-selected {
    background: #2563eb;
    color: #ffffff;
}

.intent-option.is-selected::after {
    content: '✓';
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
}

#chat-form.multiline {
    flex-direction: column;
    align-items: stretch;
}

#chat-form.multiline .chat-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

/* Fix for textarea height in multiline mode */
#chat-form.multiline #user-input.form-control {
    flex: none;
    width: 100% !important;
}

#chat-form {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#chat-form:focus-within {
    border-color: #d1d5db;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

@media (max-width: 576px) {
    #chat-form {
        bottom: 20vh;
        width: 92%;
        left: 50%;
    }

    #chat-controls-row {
        align-items: flex-end;
    }

    .chat-left-controls {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .chat-left-top {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }

    .input-usage-row {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-left-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
}

body.engaged #chat-form {
    bottom: 2.05cm;
}

body.engaged {
    --form-bottom: 2.05cm;
}

.input-group {
    width: 100%;
}

#user-input.form-control {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 8px;
    min-height: 24px;
    resize: none;
    overflow-x: hidden;
    overflow-y: hidden;
    line-height: 1.5;
    font-size: 1rem;
    color: #0f172a;
    display: block;
    width: auto !important;
    position: static;
    box-sizing: border-box;
}

.file-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 4px 8px 4px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f2f5;
    border-radius: 15px;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    max-width: 100%;
}

.file-chip-indicator {
    width: 20px;
    height: 20px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-chip-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    border-top-color: #2563eb;
    animation: fileChipSpin 0.9s linear infinite;
}

.file-chip-success {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4CAF50;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.file-chip-error {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.spec-upload-zone {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 18px 18px;
    background: #fafbfc;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.spec-upload-zone:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.spec-upload-zone.drag-over {
    background: #eff6ff;
    border-color: #2563eb;
}

.spec-status-log {
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    padding: 12px;
    min-height: 120px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

.spec-result {
    margin-top: 10px;
    min-height: 48px;
    color: #0f172a;
    font-size: 14px;
}

.spec-section-title {
    font-weight: 800;
    color: #0f172a;
}

.spec-wizard {
    display: flex;
    align-items: stretch;
}

.spec-stepper {
    width: 230px;
    flex: none;
    position: relative;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.spec-stepper::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: #e2e8f0;
}

.spec-step-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0;
    color: #94a3b8;
}

.spec-step-item[data-step="6"] {
    margin-top: auto;
}

.spec-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    margin-top: 2px;
    position: relative;
    z-index: 1;
    flex: none;
}

.spec-step-title {
    font-weight: 800;
    font-size: 14px;
    line-height: 1.2;
}

.spec-step-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #94a3b8;
}

.spec-step-item.active {
    color: #0f172a;
}

.spec-step-item.active .spec-step-dot {
    border-color: #2563eb;
    background: #2563eb;
}

.spec-step-item.active .spec-step-sub {
    color: #64748b;
}

.spec-step-item.completed {
    color: #0f172a;
}

.spec-step-item.completed .spec-step-dot {
    border-color: #22c55e;
    background: #22c55e;
}

.spec-step-content {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
}

#specialization-page .spec-step-content .form-control,
#specialization-page .spec-step-content .form-select {
    font-size: 13px;
}

#specialization-page .spec-step-content .form-control::placeholder {
    font-size: 13px;
}

#specialization-page #spec-progress-card {
    margin-top: 0 !important;
}

.spec-inner-card {
    border: none !important;
    box-shadow: none !important;
}

.spec-section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.spec-live-indicator {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-spinner-ring {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: #2563eb;
    animation: spec-spin 0.8s linear infinite;
}

@keyframes spec-spin {
    to {
        transform: rotate(360deg);
    }
}

.spec-step-panel {
    display: none;
}

.spec-step-panel.active {
    display: block;
}

.spec-step4-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.spec-clear-btn {
    width: auto;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.spec-step-panel[data-step="5"].active {
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.spec-step-panel[data-step="5"].active .spec-step-actions {
    margin-top: 12px;
}

.spec-step-panel[data-step="5"] .spec-action-btn {
    font-size: 12px;
    padding: 8px 14px;
}

.spec-start-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-start-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 13px;
}

.spec-step-actions {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    align-items: stretch;
}

.spec-step-actions:empty {
    display: none;
}

.spec-step-actions.single {
    grid-template-columns: 1fr;
}

.spec-step-actions.dual {
    grid-template-columns: 1fr 1fr;
}

.spec-action-btn {
    width: 100%;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
}

.spec-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.spec-back-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.spec-step-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #0f172a;
}

.spec-step-badge {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    flex: none;
}

.spec-shell {
    max-width: 1400px;
    padding-top: 18px;
    padding-bottom: 120px;
}

.spec-layout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.spec-main {
    flex: 1 1 0;
    min-width: 0;
}

.spec-side {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.spec-interactive-host {
    position: sticky;
    top: 16px;
    min-height: 520px;
    background: transparent;
    border: none;
    padding: 0;
    overflow: visible;
}

#spec-interactive-host.has-panel {
    overflow: auto;
    max-height: calc(100vh - 120px);
}

#spec-interactive-host .interactive-panel {
    width: 100%;
    max-width: none;
    margin: 0;
}

#spec-interactive-host .classification-panel-container,
#spec-interactive-host .keypoint-panel-container,
#spec-interactive-host .propose-panel-container {
    margin: 0;
}

#spec-interactive-host .classification-panel-container .interactive-panel.classification-panel .panel-body {
    padding: 16px 16px !important;
}

#spec-interactive-host .classification-panel-container .interactive-panel.classification-panel .panel-footer {
    padding: 16px 16px !important;
}

#spec-interactive-host .keypoint-panel-container .interactive-panel.keypoint-panel {
    box-shadow: none !important;
}

@media (max-width: 1100px) {
    .spec-layout {
        flex-direction: column;
    }

    .spec-side {
        width: 100%;
    }

    .spec-interactive-host {
        position: static;
    }

    .spec-wizard {
        flex-direction: column;
    }

    .spec-stepper {
        width: 100%;
        padding: 0;
    }

    .spec-stepper::before {
        display: none;
    }

    .spec-step-item {
        padding: 6px 0;
    }
}

.file-chip-neutral {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e0e0e0;
}

.file-chip-icon {
    width: 16px;
    height: 16px;
    flex: none;
}

.file-chip-retry {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

.file-chip-retry:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.file-chip-name {
    font-size: 12px;
    color: #0f172a;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-chip-close {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    flex: none;
    line-height: 1;
    padding-left: 2px;
}

.file-chip-close:hover {
    color: #334155;
}

@keyframes fileChipSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.input-counter {
    font-size: 12px;
    color: #64748b;
    user-select: none;
    white-space: nowrap;
}

.chat-input-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.chat-input-action-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.chat-input-action-btn.send-btn {
    background: #2563eb;
    color: #ffffff;
}

.chat-input-action-btn.send-btn:hover {
    background: #1d4ed8;
}

.chat-input-action-btn.stop-btn {
    background: #2563eb;
    color: #ffffff;
}

.chat-input-action-btn.stop-btn:hover {
    background: #1d4ed8;
}
.chat-input-action-btn svg {
    width: 20px;
    height: 20px;
    display: block;   /* 防止 baseline 偏移 */
}

.chat-input-action-btn.upload-btn {
    width: auto;
    height: auto;
    border-radius: 6px;
    padding: 4px 10px;
    gap: 4px;
    flex-shrink: 0;
}

.chat-input-action-btn.upload-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chat-input-action-btn.upload-btn span {
    font-size: 13px;
    white-space: nowrap;
}

body.running #send-btn {
    display: none !important;
}

#stop-btn {
    display: none;
}

body.running #stop-btn {
    display: inline-flex;
}

/* OCR Loading Modal */
#ocr-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#ocr-loading-content {
    background: white;
    padding: 24px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ocr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brand-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reset-btn {
    position: fixed;
    top: var(--new-top);
    left: calc((100vw + var(--current-sidebar-width)) / 2 - min((90vw - var(--current-sidebar-width)) / 2, var(--bubble-w) / 2));
    width: var(--new-width);
    height: var(--new-height);
    background: #cccccc !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', '微软雅黑', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: var(--new-font);
    line-height: 1;
    display: none !important;
    z-index: 40;
    transition: left 0.3s ease;
}

body.engaged .reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#ai-warning {
    position: fixed;
    left: calc((100vw + var(--current-sidebar-width)) / 2);
    transform: translateX(-50%);
    bottom: 1cm;
    color: #bdbdbd;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease, transform .4s ease, left 0.3s ease;
    z-index: 35;
    user-select: none;
}

body.engaged #ai-warning {
    opacity: 1;
    pointer-events: auto;
}

#top-mask {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: calc(var(--new-top) + var(--new-height));
    background: var(--backgraund-color);
    z-index: 24;
    pointer-events: none;
    display: none;
}

body.engaged #top-mask {
    display: block;
}

#bottom-mask {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--form-bottom) + var(--form-height));
    background: var(--backgraund-color);
    z-index: 24;
    pointer-events: none;
    display: none;
}

body.engaged #bottom-mask {
    display: block;
}



body.engaged #chat-wrapper {
    display: block;
}


#chat-history {
    padding: 12px 16px;
    position: static;
    width: 100%;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-bubble {
    background: #ffffff;
    border-radius: var(--bubble-radius);
    box-shadow: 0 0 var(--glow-size) var(--glow-spread) var(--glow-color);
    padding: 16px 20px;
    margin: var(--bubble-vert-gap) 0;
    width: fit-content;
    max-width: 100%;
    word-break: break-word;
    line-height: 1.6;
}

.chat-bubble.user {
    white-space: pre-wrap;
}

.chat-bubble.bot {
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
}

.chat-bubble.bot.loading-message {
    width: fit-content;
}

.chat-bubble.bot > *:last-child {
    margin-bottom: 5px;
}

.chat-bubble.bot p {
    margin: 0 0 0.9em 0;
}

.chat-bubble.bot p:last-child {
    margin-bottom: 0;
}

.chat-bubble.bot h1,
.chat-bubble.bot h2,
.chat-bubble.bot h3,
.chat-bubble.bot h4,
.chat-bubble.bot h5,
.chat-bubble.bot h6 {
    margin: 1.0em 0 0.6em 0;
    line-height: 1.25;
    font-weight: 600;
}

.chat-bubble.bot h1 { font-size: 1.6em; }
.chat-bubble.bot h2 { font-size: 1.4em; }
.chat-bubble.bot h3 { font-size: 1.2em; }
.chat-bubble.bot h4 { font-size: 1.1em; }
.chat-bubble.bot h5 { font-size: 1.05em; }
.chat-bubble.bot h6 { font-size: 1.0em; color: #6b7280; }

.chat-bubble.bot blockquote {
    margin: 0.9em 0;
    padding: 0.25em 0 0.25em 1em;
    border-left: 4px solid #e5e7eb;
    color: #374151;
}

.chat-bubble.bot hr {
    margin: 1.2em 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

.chat-bubble.bot a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-bubble.bot img {
    max-width: 100%;
    height: auto;
}

.chat-bubble.bot table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.9em 0;
    display: block;
    overflow-x: auto;
}

.chat-bubble.bot th,
.chat-bubble.bot td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    vertical-align: top;
}

.chat-bubble.bot thead th {
    background: #f8fafc;
    font-weight: 600;
}

.chat-bubble.bot ul,
.chat-bubble.bot ol {
    padding-left: 1.6em;
    margin: 0 0 0.9em 0;
}

.chat-bubble.bot li {
    margin: 0.2em 0;
}

.chat-bubble.bot li > p {
    margin: 0.3em 0;
}

.chat-bubble.bot input[type="checkbox"] {
    margin-right: 0.5em;
    transform: translateY(1px);
}

.bot {
    align-self: flex-start;
    font-size: 1rem;
}

.user {
    align-self: flex-end;
}

.time-info {
    font-size: 0.9em;
    color: #aaa;
    margin: 4px 0;
    width: auto;
}

.chat-bubble pre {
    background: #f6f8fa;
    padding: 15px;
    border-radius: 8px;
    overflow: auto;
    margin: 0.9em 0;
}

.chat-bubble pre code {
    background: transparent;
    padding: 0;
}

.chat-bubble code {
    background: #f6f8fa;
    padding: 4px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.chat-bubble ul, .chat-bubble ol {
    padding-left: 2em;

}

#loading {
    display: none !important;
}

html::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 8px;
}

html::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 8px;
}

html:hover::-webkit-scrollbar-thumb {
    background: #b0b0b0;
}

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #f9fafb;
    --sidebar-border: #e5e7eb;
    --sidebar-text: #374151;
    --sidebar-hover: #e5e7eb;
    --sidebar-active-bg: #dbeafe;
    --sidebar-active-text: #1d4ed8;
}

#app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 900;
    transition: width 0.3s ease, left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    font-family: 'Microsoft YaHei UI', system-ui, sans-serif;
}

#app-sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    border-bottom: 1px solid var(--sidebar-border);
    column-gap: 8px;
}

.user-profile {
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    padding: 6px 10px 6px 4px;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 10px;
}

.user-details {
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s;
}

#app-sidebar.collapsed .user-details,
#app-sidebar.collapsed .sidebar-title-text,
#app-sidebar.collapsed .session-title,
#app-sidebar.collapsed .sidebar-footer-text,
#app-sidebar.collapsed .new-chat-text {
    display: none;
}

#app-sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

#app-sidebar.collapsed .user-profile {
    display: none;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.user-status {
    font-size: 11px;
    color: #6b7280;
}

.user-profile:hover {
    background: #e5e7eb;
}

.sidebar-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

#app-sidebar.collapsed .sidebar-toggle-btn {
    margin-left: 0;
}

.sidebar-toggle-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

#app-sidebar.collapsed .sidebar-content {
    padding: 16px 6px;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    white-space: nowrap;
}

.new-chat-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

#app-sidebar.collapsed .new-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    margin: 0 auto 20px auto;
}

.sidebar-section-title {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-left: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

#app-sidebar.collapsed .sidebar-section-title {
    display: none;
}

.session-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #4b5563;
    font-size: 13px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.session-item:hover {
    background: var(--sidebar-hover);
    color: #111827;
}

.session-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.session-icon {
    margin-right: 10px;
    flex-shrink: 0;
}

#app-sidebar.collapsed .session-item {
    justify-content: center;
    padding: 8px 0;
}

#app-sidebar.collapsed .session-icon {
    margin-right: 0;
}

.session-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.session-delete {
    opacity: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    padding: 2px;
    cursor: pointer;
    margin-left: 4px;
}

.session-edit {
    opacity: 0;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    padding: 2px;
    cursor: pointer;
    margin-left: 4px;
}

.session-item:hover .session-delete,
.session-item:hover .session-edit {
    opacity: 1;
}

.session-delete:hover {
    color: #ef4444;
}

.session-edit:hover {
    color: #2563eb;
}

#app-sidebar.collapsed .session-delete,
#app-sidebar.collapsed .session-edit {
    display: none;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
}

#app-sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sidebar-footer-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-footer-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

#app-sidebar.collapsed .sidebar-footer-btn {
    justify-content: center;
    padding: 8px;
    width: auto;
}

.sidebar-version {
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.6;
    white-space: nowrap;
}

#app-sidebar.collapsed .sidebar-version {
    display: none;
}

.sidebar-version a {
    color: #2563eb;
    text-decoration: none;
    margin: 0 4px;
    display: inline-block;
}

.sidebar-version a:hover {
    color: #1d4ed8;
}

.mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #ffffff;
    display: none;
    align-items: center;
    padding: 0 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    z-index: 950;
}

.mobile-topbar-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.mobile-topbar-btn {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.mobile-topbar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}

.mobile-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.mobile-user-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .user-info-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: var(--sidebar-width);
        right: 0;
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: calc(var(--new-top)) 0 calc(var(--form-bottom));
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.25s ease, transform 0.25s ease;
        pointer-events: none;
    }

    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .user-info-panel {
        max-width: 100vw;
        margin: 0;
        padding: calc(var(--new-top)) 12px calc(var(--form-bottom));
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
        pointer-events: none;
        visibility: hidden;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        overflow-y: auto;
    }
}

@media (max-width: 767.98px) {
    body {
        --current-sidebar-width: 0;
    }

    #chat-wrapper {
        margin-left: 0;
        padding-top: 72px;
    }

    #specialization-page {
        margin-left: 0;
        width: 100%;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    #app-sidebar {
        left: -100%;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
    }

    #app-sidebar.mobile-open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    /* 确保在手机端不会出现“缩略”宽度 */
    #app-sidebar,
    #app-sidebar.collapsed {
        width: 100%;
        max-width: 100%;
    }

    .mobile-topbar {
        display: flex;
    }

    .law-sidebar {
        right: -100%;
        width: 100%;
        max-width: 100%;
    }

    .law-sidebar.open {
        right: 0;
    }

    /* 聊天区域与输入框在手机端居中铺满 */
    #chat-history {
        width: 100%;
        max-width: 100%;
        padding: 0 16px;
    }

    #chat-history .chat-bubble:first-child {
        margin-top: 8px;
    }

    #chat-form {
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        transform: none;
        bottom: 56px;
        height: auto;
    }

    #user-input.form-control {
        left: 0;
        right: 0;
        transform: none;
        width: 100% !important;
        padding-left: 16px;
        padding-right: 40px;
    }

    #chat-controls-row {
        flex-wrap: nowrap;
        gap: 8px;
        align-items: flex-end;
    }

    .chat-left-controls {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        flex-direction: row;
        align-items: flex-start;
        row-gap: 6px;
    }

    .chat-right-controls {
        margin-left: auto;
    }

    #ai-warning {
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        padding: 0 16px;
        max-width: 100vw;
        text-align: center;
        white-space: normal;
        bottom: 38px;
    }

    body.engaged #chat-form {
        bottom: 60px;
    }
}

@media (max-width: 420px) {
    .chat-input-action-btn.upload-btn span,
    .lawyer-recommend-btn span,
    .memory-usage-text {
        display: inline;
    }

    .chat-input-action-btn.upload-btn,
    .lawyer-recommend-btn {
        padding: 4px 8px;
    }

    .memory-usage-bar {
        width: 30px;
    }

    .input-usage-bar {
        width: 30px;
    }

    .chat-input-action-btn.upload-btn span,
    .lawyer-recommend-btn span {
        font-size: 12px;
    }

    .memory-usage-text,
    .input-counter {
        font-size: 12px;
    }
}

.user-info-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0 20px;
    max-width: 600px;
    margin: 0 auto;
}

.user-info-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-top: 32px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
}

.user-info-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #2563eb;
    margin-right: 10px;
    border-radius: 2px;
}

.user-info-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(243, 244, 246, 0.6);
    font-size: 15px;
    transition: background-color 0.2s;
    border-radius: 8px;
}

.user-info-field:hover {
    background-color: rgba(249, 250, 251, 0.8);
}

.user-info-label {
    color: #4b5563;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.user-info-value {
    font-weight: 600;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 15px;
}

.user-info-recharge-btn {
    width: 100%;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.8);
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.user-info-recharge-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #2563eb;
    opacity: 0;
    transition: opacity 0.3s;
}

.user-info-recharge-btn:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.user-info-recharge-btn:hover::before {
    opacity: 1;
}

.user-info-recharge-btn:active {
    transform: translateY(0);
}

body.show-user-panel #chat-wrapper,
body.show-user-panel #chat-form {
    display: none;
}

body.show-user-panel #user-info-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

body.show-user-panel #hero-logo,
body.show-user-panel #ai-warning,
body.show-user-panel .reset-btn,
body.show-user-panel #top-mask,
body.show-user-panel #bottom-mask,
body.show-user-panel #loading {
    display: none;
}

#global-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(17, 24, 39, 0.9);
    color: #ffffff;
    font-size: 13px;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1100;
    white-space: nowrap;
}

@media (min-width: 768px) {
    #global-toast {
        left: calc((100vw + var(--current-sidebar-width)) / 2);
    }

}

#auth-modal-overlay,
#confirm-modal-overlay,
#agreement-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#agreement-modal.show {
    display: flex;
    z-index: 3000;
}

#agreement-modal .modal-window {
    background: #fff;
    width: 800px;
    max-width: 92vw;
    height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

#agreement-modal .modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

#agreement-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

#agreement-modal .close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 4px;
}

#agreement-modal .close-modal-btn:hover {
    color: #4b5563;
}

#agreement-modal .modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    text-align: left;
    overflow-x: hidden;
    word-break: break-word;
}

#agreement-modal .modal-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-top: 20px;
    margin-bottom: 12px;
}

#agreement-modal .modal-content p {
    margin-bottom: 12px;
}

#agreement-modal .modal-content ul,
#agreement-modal .modal-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

#agreement-modal .modal-content li {
    margin-bottom: 4px;
}

.auth-modal {
    width: 380px;
    max-width: 92vw;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    background: #ffffff;
}

.auth-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    flex: 1;
    text-align: center;
}

.auth-header-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    color: #9ca3af;
}

.auth-header-btn:hover {
    color: #4b5563;
}

.auth-modal-body {
    font-size: 14px;
    color: #111827;
    padding: 18px 20px 20px;
}

.auth-input-group {
    margin-bottom: 10px;
}

.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #4b5563;
    padding: 2px 4px;
}

.auth-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 14px;
    outline: none;
}

.auth-input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-row .auth-input {
    flex: 1;
    width: auto;
}

.auth-sms-btn {
    height: 38px;
    min-width: 120px;
    white-space: nowrap;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-sms-btn:disabled {
    border-color: #d1d5db;
    color: #9ca3af;
    background: #f9fafb;
    cursor: not-allowed;
}

.auth-sms-btn:not(:disabled):hover {
    background: #1d4ed8;
    color: #ffffff;
}

.auth-primary-btn {
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.auth-primary-btn:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}

.auth-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.auth-icon-btn:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}

.confirm-modal-footer {
    margin-top: 0;
    padding: 0 20px 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.confirm-modal-footer .auth-secondary-btn,
.confirm-modal-footer .auth-primary-btn {
    flex: 1;
    width: auto;
}

.auth-secondary-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
}

.auth-secondary-btn:hover {
    background: #f3f4f6;
}

.auth-agreement {
    position: relative;
    margin-top: 12px;
    padding-top: 12px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.auth-agreement::before {
    display: none;
}

.auth-agreement a {
    color: #2563eb;
    text-decoration: none;
    margin: 0 2px;
}

.auth-agreement a:hover {
    text-decoration: underline;
}

.auth-secondary-text {
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.auth-link {
    color: #2563eb;
    cursor: pointer;
}

.auth-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.auth-or-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 14px;
}

.auth-or-line {
    flex: 1;
    height: 2px;
    background: #dbe4f0;
}

.auth-or-text {
    padding: 0 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-wx-area {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-wx-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 10px;
}

.auth-wx-qr {
    width: 190px;
    height: 190px;
    background: transparent;
    border-radius: 12px;
    border: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wx-qr iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Law Sidebar Styles */
.law-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: white;
    box-shadow: none;
    z-index: 2000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
}
#lawyer-sidebar {
    z-index: 2100;
}
.law-sidebar.open {
    right: 0;
}
.law-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align to top to handle multi-line title */
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 12px; /* Space between title area and close button */
}
.law-sidebar-header > div:first-child {
    flex: 1;
    min-width: 0; /* Enable flex item shrinking */
    margin-right: 8px;
}
.law-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    /* Remove truncation to allow wrapping if needed, or keep ellipsis but ensure width constraint */
    /* overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; */
    word-break: break-word; /* Allow long words to break */
    line-height: 1.4;
}
.law-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0; /* Prevent button from shrinking */
    margin-top: -4px; /* Slight adjustment for alignment */
}
.law-sidebar-close:hover {
    color: #111827;
    background: #f3f4f6;
}
.law-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}
.law-article {
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    transition: all 0.3s;
}
.law-article.highlight {
    background-color: #fffbeb;
    border-color: #fcd34d;
    box-shadow: 0 4px 6px -1px rgba(251, 191, 36, 0.1), 0 2px 4px -1px rgba(251, 191, 36, 0.06);
    transform: scale(1.02);
}
.law-link {
    color: #2563eb;
    cursor: pointer;
    font-weight: 500;
    padding: 0 2px;
    border-radius: 2px;
    transition: all 0.2s;
    text-decoration: none;
}
.law-link:hover {
    color: #1d4ed8;
    background: #eff6ff;
}
.law-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: #6b7280;
}
.law-error {
    text-align: center;
    color: #ef4444;
    padding: 20px;
    background: #fee2e2;
    border-radius: 8px;
    font-size: 14px;
}
.auth-input-wrapper {
    position: relative;
    width: 100%;
}

.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
}

.auth-input.with-icon {
    padding-left: 40px;
}

.lawyer-recommend-btn {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.lawyer-recommend-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.lawyer-recommend-btn:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.lawyer-recommend-btn .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(107, 114, 128, 0.3);
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.lawyer-list-container {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    margin: 8px 0;
    width: 100%;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.lawyer-list-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.lawyer-list-item:last-child {
    border-bottom: none;
}

.lawyer-list-item:hover {
    background: rgba(37, 99, 235, 0.04);
}

.lawyer-avatar-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.lawyer-avatar-sm {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.lawyer-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
    position: absolute;
    inset: 0;
}

.lawyer-main-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lawyer-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.lawyer-institution-sm {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 100px;
    max-width: 200px;
}

.lawyer-gender-sm {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    margin-left: auto;
}

.lawyer-gender {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.lawyer-gender-inline {
    font-size: 12px;
    color: #64748b;
    font-weight: normal;
    margin-left: 6px;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 8px;
}

.lawyer-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.lawyer-location-sm {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.lawyer-skills-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.lawyer-skills-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
    flex: 1;
}

.skill-tag-sm {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.skill-tag {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.lawyer-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lawyer-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lawyer-search-select {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    background: white;
    cursor: pointer;
}

.lawyer-search-input {
    flex: 2;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
}

.lawyer-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.lawyer-search-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lawyer-search-btn:hover {
    opacity: 0.9;
}

.lawyer-reset-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.lawyer-reset-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.lawyer-score-wrapper {
    position: relative;
    flex-shrink: 0;
}

.lawyer-total-score {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    cursor: pointer;
    padding: 4px 12px;
    background: #eff6ff;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.lawyer-total-score:hover {
    background: #2563eb;
    color: white;
}

.lawyer-score-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 6px;
}

.lawyer-score-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 6px solid transparent;
    border-top-color: #0f172a;
}

.lawyer-total-score:hover + .lawyer-score-tooltip {
    opacity: 1;
    visibility: visible;
}

.lawyer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lawyer-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.lawyer-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lawyer-modal-overlay.show .lawyer-modal {
    transform: scale(1);
}

.lawyer-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.lawyer-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.lawyer-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}

.lawyer-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lawyer-modal-body {
    padding: 24px;
}

.lawyer-modal-info-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px 16px;
    align-items: start;
}

.lawyer-modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #e2e8f0;
}

.lawyer-modal-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: 600;
}

.lawyer-modal-basic-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lawyer-modal-name {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.lawyer-modal-institution {
    font-size: 14px;
    color: #475569;
}

.lawyer-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.lawyer-modal-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.lawyer-modal-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lawyer-modal-detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.lawyer-modal-detail-row:last-child {
    border-bottom: none;
}

.lawyer-modal-detail-label {
    width: 120px;
    flex-shrink: 0;
    font-size: 13px;
    color: #64748b;
}

.lawyer-modal-detail-value {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
}

.lawyer-modal-cases {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lawyer-modal-case-item {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #2563eb;
}

.lawyer-modal-case-num {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.lawyer-modal-case-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.lawyer-modal-case-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lawyer-modal-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.lawyer-modal-error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
}

.lawyer-consult-btn {
    width: 100%;
    padding: 12px 20px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.lawyer-consult-btn:hover {
    background: #1d4ed8;
}

#consult-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    z-index: 2300;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

#consult-sidebar.open {
    right: 0;
}

.consult-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.consult-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.consult-sidebar-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

.consult-sidebar-close:hover {
    color: #111827;
}

.consult-notice {
    padding: 10px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border-bottom: 1px solid #f3f4f6;
}

.consult-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consult-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.consult-message.user {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.consult-message.lawyer {
    align-self: flex-start;
    background: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.consult-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: center;
}

.consult-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

.consult-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    resize: none;
}

.consult-input:focus {
    border-color: #2563eb;
}

.consult-send-btn {
    padding: 10px 20px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.consult-send-btn:hover {
    background: #1d4ed8;
}

.consult-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.consult-empty {
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
    font-size: 14px;
}

.history-consult-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.history-consult-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.history-consult-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
}

.history-consult-item:hover {
    background: #f9fafb;
}

.history-consult-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.history-consult-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6b7280;
    flex-shrink: 0;
    object-fit: cover;
}

.history-consult-item-info {
    flex: 1;
    min-width: 0;
}

.history-consult-item-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.history-consult-item-gender {
    font-size: 12px;
    color: #6b7280;
}

.history-consult-item-institution {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.history-consult-item-location {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.history-consult-item-sessions {
    font-size: 12px;
    color: #3b82f6;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-delete-btn {
    padding: 5px 12px;
    font-size: 12px;
    color: #fff;
    background: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.history-delete-btn:hover {
    background: #dc2626;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

.session-select-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s;
}

.session-select-item:hover {
    background: #f9fafb;
}

.session-select-item-title {
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.session-select-item-time {
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-delete-btn {
    padding: 5px 12px;
    font-size: 12px;
    color: #fff;
    background: #ef4444;
    border: none;
    border-radius: 6px;
}

/* =============================================================================
 * 交互式面板（文书生成 SSE 交互）样式
 * ============================================================================= */

/* 遮罩层 - 用于其他面板 */
.interactive-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 通用面板 */
.interactive-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: panelSlideUp 0.25s ease;
}

/* 专精模式右侧承载：去掉“文件智能分类”底部阴影视觉 */
#spec-interactive-host .classification-panel-container .interactive-panel {
    box-shadow: none !important;
}

@keyframes panelSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 要点确认面板容器 - 插入到聊天历史中 */
.keypoint-panel-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 0;
    animation: panelSlideUp 0.25s ease;
}

.keypoint-panel-container .interactive-panel {
    position: relative;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(33, 150, 243, 0.15);
}

.interactive-panel .panel-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.interactive-panel .panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.interactive-panel .panel-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

.interactive-panel .panel-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.interactive-panel .panel-message {
    color: #374151;
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.interactive-panel .panel-footer {
    padding: 12px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #f3f4f6;
}

.interactive-panel .panel-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 12px;
}

/* Propose 面板 */
.propose-panel {
    max-width: 440px;
}

.propose-panel .panel-body {
    text-align: center;
}

.panel-yes-btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
}

.panel-no-btn {
    padding: 10px 24px;
    font-size: 15px;
}

/* 文件分类面板 */
.classification-panel {
    max-width: 650px;
}

.classification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.classification-category {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafbfc;
}

.category-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.category-desc {
    font-size: 12px;
    color: #9ca3af;
}

.category-files {
    min-height: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
}

.category-files.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}

.file-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 16px;
    font-size: 13px;
    cursor: grab;
    user-select: none;
    transition: background 0.2s, transform 0.15s;
}

.file-tag:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

.file-tag.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* 要点确认面板 - 重新设计 */
.keypoint-panel-container .interactive-panel.keypoint-panel {
    max-width: 720px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(148, 163, 184, 0.1) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.keypoint-panel-container .interactive-panel.keypoint-panel .panel-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-radius: 0 !important;
    padding: 24px 28px 20px !important;
    border-bottom: none !important;
    margin: 0 !important;
}

.keypoint-panel-container .interactive-panel.keypoint-panel .panel-header h3 {
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    letter-spacing: -0.02em !important;
}

.keypoint-panel-container .interactive-panel.keypoint-panel .panel-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 13px !important;
    margin-top: 0 !important;
    display: block !important;
    font-weight: 400 !important;
}

.keypoint-panel-container .interactive-panel.keypoint-panel .panel-body {
    padding: 24px 28px !important;
    max-height: 480px !important;
    overflow-y: auto !important;
    flex: 1 !important;
    margin: 0 !important;
    background: #fafbfc !important;
}

.keypoint-panel-container .interactive-panel.keypoint-panel .panel-message {
    color: #64748b !important;
    font-size: 14px !important;
    margin: 0 0 20px 0 !important;
    line-height: 1.6 !important;
    padding: 14px 18px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

.keypoint-panel-container .keypoint-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
}

.keypoint-panel-container .keypoint-row {
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    background: #ffffff !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid #e2e8f0 !important;
}

.keypoint-panel-container .keypoint-row:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
}

.keypoint-panel-container .keypoint-row .keypoint-key {
    min-width: 110px !important;
    max-width: 110px !important;
    width: 110px !important;
    padding: 10px 14px !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #4f46e5 !important;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%) !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    flex: none !important;
    letter-spacing: 0.01em !important;
}

.keypoint-panel-container .keypoint-row .keypoint-key:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%) !important;
    transform: scale(1.02) !important;
}

.keypoint-panel-container .keypoint-row .keypoint-key:focus {
    outline: none !important;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

.keypoint-panel-container .keypoint-row .keypoint-value {
    flex: 1 !important;
    padding: 10px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #334155 !important;
    background: #ffffff !important;
    transition: all 0.2s !important;
    font-weight: 400 !important;
}

.keypoint-panel-container .keypoint-row .keypoint-value:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.keypoint-panel-container .keypoint-row .keypoint-delete-btn {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.keypoint-panel-container .keypoint-row .keypoint-delete-btn:hover {
    background: #dc2626 !important;
    color: #fff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3) !important;
}

/* 补充信息重新提取区域 */
.keypoint-panel-container .reextract-section {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    padding: 16px 18px !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

.keypoint-panel-container .reextract-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #6366f1 !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.keypoint-panel-container .reextract-input {
    flex: 1 !important;
    padding: 10px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: #334155 !important;
    background: #f8fafc !important;
    transition: all 0.2s !important;
}

.keypoint-panel-container .reextract-input:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    background: #ffffff !important;
}

.keypoint-panel-container .reextract-btn {
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.keypoint-panel-container .reextract-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
}

.keypoint-panel-container .reextract-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.keypoint-panel-container .footer-buttons {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

.keypoint-panel-container .panel-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 20px 28px 24px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    margin: 0 !important;
}

.keypoint-panel-container .footer-right {
    display: flex !important;
    gap: 10px !important;
}

.keypoint-panel-container .keypoint-add-btn {
    padding: 10px 20px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.keypoint-panel-container .keypoint-add-btn:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

.keypoint-panel-container .panel-confirm-btn {
    padding: 12px 32px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    letter-spacing: 0.01em !important;
}

.keypoint-panel-container .panel-confirm-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45) !important;
}

.keypoint-panel-container .panel-confirm-btn:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.keypoint-panel-container .empty-keypoints {
    padding: 24px 20px !important;
    text-align: center !important;
    color: #94a3b8 !important;
    font-size: 14px !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    border: 1px dashed #cbd5e1 !important;
}

.keypoint-panel-container .panel-skip-btn {
    padding: 10px 20px !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    margin: 0 !important;
}

.keypoint-panel-container .panel-skip-btn:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

.session-delete-btn:hover {
    background: #dc2626;
    box-shadow: 0 2px 4px rgba(239,68,68,0.3);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

/* 删除确认模态框：默认隐藏，显示时由 .show 控制 */
#confirm-delete-modal {
    display: none;
}

#confirm-delete-modal.show {
    display: flex;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 300px;
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1f2937;
}

.modal-content p {
    margin: 0 0 24px 0;
    font-size: 15px;
    color: #6b7280;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

.modal-btn.cancel {
    background: #f3f4f6;
    color: #374151;
}

.modal-btn.confirm {
    background: #ef4444;
    color: #fff;
}

.modal-btn:hover {
    opacity: 0.9;
}

.consult-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.consult-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: consult-spin 0.8s linear infinite;
}

@keyframes consult-spin {
    to { transform: rotate(360deg); }
}

#history-consult-sidebar,
#session-select-sidebar {
    z-index: 2200;
}

/* User Info Panel Styling */
#user-info-panel .user-info-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 32px;
    max-width: 520px;
    margin: 40px auto;
    overflow: hidden;
}

#user-info-panel .user-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 24px;
}

#user-info-panel .user-avatar-wrap-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

#user-info-panel .user-avatar-lg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
    z-index: 10;
}

#user-info-panel #user-panel-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    position: relative;
    z-index: 5;
}

#user-info-panel .user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

#user-info-panel .recharge-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#user-info-panel .recharge-container .user-info-recharge-btn {
    width: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#user-info-panel .version-display {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.user-info-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 32px;
    max-width: 520px;
    margin: 40px auto;
    overflow: hidden;
}

.user-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 24px;
}

.user-avatar-wrap-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.user-avatar-lg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
    z-index: 10;
}

#user-panel-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    position: relative;
    z-index: 5;
}

.user-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-name-lg {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.user-phone-sub {
    font-size: 13px;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.vip-badge {
    display: inline-block;
    white-space: nowrap;
    padding: 4px 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.user-info-section {
    margin-bottom: 28px;
}

.user-info-title {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info-title::before {
    content: '';
    width: 2px;
    height: 14px;
    background: #2563eb;
    border-radius: 1px;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.user-info-card-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.user-info-card-item:hover {
    background: #ffffff;
    border-color: #e5e7eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.user-info-card-item.vip-item {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
}

.user-info-card-item.vip-item:hover {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.user-info-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.user-info-icon-wrap.blue {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #2563eb;
}

.user-info-icon-wrap.green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.user-info-icon-wrap.purple {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    color: #7c3aed;
}

.user-info-icon-wrap.orange {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #ea580c;
}

.user-info-icon-wrap.gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    color: #d97706;
}

.user-info-item-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.user-info-item-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.user-info-item-value.vip-value {
    color: #d97706;
}

.recharge-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recharge-container .user-info-recharge-btn {
    width: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.recharge-container .user-info-recharge-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2563eb;
    opacity: 0;
    transition: opacity 0.25s;
}

.recharge-container .user-info-recharge-btn:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
    transform: translateX(4px);
}

.recharge-container .user-info-recharge-btn:hover::before {
    opacity: 1;
}

.recharge-container .user-info-recharge-btn .price {
    color: #2563eb;
    font-weight: 700;
    font-size: 16px;
}

.version-display {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

.user-info-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    margin-top: 8px;
}

.footer-link {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #2563eb;
}

.footer-divider {
    color: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .user-info-card {
        margin: 20px 12px;
        padding: 20px;
        border-radius: 16px;
    }

    .user-info-header {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .user-avatar-wrap-lg {
        width: 35px;
        height: 35px;
    }

    #user-panel-avatar-placeholder {
        font-size: 18px;
    }

    .user-name-lg {
        font-size: 17px;
    }

    .user-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .user-info-card-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px;
    }

    .user-info-icon-wrap {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .user-info-item-label {
        flex: 1;
    }

    .user-info-item-value {
        font-size: 14px;
    }

    .recharge-container .user-info-recharge-btn {
        padding: 14px 16px;
        font-size: 14px;
    }

    #user-info-panel .user-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #user-info-panel .user-info-card-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px;
    }

    #user-info-panel .user-info-item-label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    #user-info-panel .user-info-item-value {
        margin-left: auto;
        text-align: right;
    }
}
