/* =========== 基础重置 =========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-50: #FFF7ED;
    --primary-100: #FFEDD5;
    --primary-200: #FED7AA;
    --primary-300: #FDBA74;
    --primary-400: #FB923C;
    --primary-500: #F97316;
    --primary-600: #EA580C;
    --primary-700: #C2410C;

    --accent-50: #EFF6FF;
    --accent-100: #DBEAFE;
    --accent-500: #3B82F6;
    --accent-600: #2563EB;
    --accent-700: #1D4ED8;

    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;

    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.16);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Noto Sans SC', 'Noto Sans HK', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(160deg, #FFF8F0 0%, #F0F4FF 50%, #FFF0F0 100%);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
}

/* =========== App容器 =========== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ========== 侧边栏样式 ========== */
.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--gray-200);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.sidebar-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
}

.sidebar-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-close-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.sidebar-item:active {
    transform: scale(0.98);
}

.sidebar-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

.sidebar-footer-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-footer-links .footer-link {
    color: var(--gray-500);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-footer-links .footer-link:hover {
    color: var(--primary-600);
}

.sidebar-footer-links .footer-divider {
    color: var(--gray-300);
    font-size: 13px;
}

.sidebar-footer-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer-info .icp {
    color: var(--gray-500);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-footer-info .icp:hover {
    color: var(--primary-600);
}

.sidebar-footer-info .copyright {
    color: var(--gray-400);
    font-size: 11px;
}

/* =========== 顶部品牌栏 =========== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    flex-shrink: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-app-btn {
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.download-app-btn:active {
    transform: scale(0.95);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-action {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-action:active {
    transform: scale(0.92);
}

.header-action svg {
    width: 20px;
    height: 20px;
}

/* =========== 聊天区域 =========== */
.chat-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.chat-area::-webkit-scrollbar {
    width: 4px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 4px;
}

/* =========== 消息样式 =========== */
.message {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(12px);
    animation: message-in 0.4s ease forwards;
}

@keyframes message-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI消息 */
.ai-message {
    align-items: flex-start;
}

.message-content {
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
    line-height: 1.4;
    font-size: 14.5px;
    color: var(--gray-800);
}

/* 用户消息 */
.user-message {
    align-items: flex-end;
    width: 100%;
}

/* 消息包装器 */
.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

/* 用户消息的特殊布局 - 复制按钮在橙色框左侧 */
.user-message .message-wrapper {
    justify-content: flex-end;
}

.user-message .message-wrapper .copy-btn {
    order: 1;
    margin: 0;
}

.user-message .message-wrapper .message-content {
    order: 2;
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: #fff;
    border-radius: var(--radius-lg) 6px var(--radius-lg) var(--radius-lg);
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.25);
    text-align: left;
    max-width: 85%;
    width: auto;
    line-height: 1.5;
}

/* 复制按钮样式 */
.copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: var(--gray-400);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.6;
}

.copy-btn:hover {
    background: var(--gray-100);
    opacity: 1;
    color: var(--gray-600);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.copy-btn.copy-success {
    color: var(--success);
}

.user-message .copy-btn {
    color: rgba(255, 255, 255, 0.8);
}

.user-message .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.ai-disclaimer {
    font-size: 10px;
    color: #9CA3AF;
    font-style: italic;
    margin-top: 4px;
    padding: 0 2px;
    line-height: 1.3;
}

/* 联系方式弹框打开时，隐藏页面底部的 AI 免责内容 */
body.lead-form-open .ai-disclaimer {
    display: none !important;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    opacity: 0;
    animation: message-in 0.3s ease forwards;
}

.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.typing-indicator .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); background: var(--gray-300); }
    30% { transform: translateY(-6px); background: var(--primary-400); }
}

/* =========== 流式输出样式 =========== */
.streaming-message .message-content {
    background: none;
    border: none;
    min-height: 20px;
    overflow: visible;
}

.streaming-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-800);
    white-space: pre-wrap;
    word-break: break-word;
    display: block;
    min-height: 20px;
}

.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--primary-500);
    margin-left: 2px;
    animation: cursor-blink 0.8s ease-in-out infinite;
    vertical-align: text-bottom;
    border-radius: 1px;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =========== 思考过程（流式阶段的极简行内样式） =========== */
.reasoning-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    font-size: 12px;
    margin: 2px 0 6px 0;
}
.reasoning-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-300);
    animation: pulse-dot 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

/* =========== 欢迎消息特殊样式 =========== */
.welcome-message {
    margin-bottom: 8px;
    align-self: stretch !important;  /* 在 .message (column flex) 中水平 stretch 到 100% */
    align-items: stretch !important;  /* 覆盖 .ai-message 的 flex-start */
    width: 100% !important;
    max-width: 100% !important;
}
.welcome-message .message-content {
    align-self: stretch !important;  /* 让 message-content 在 ai-message 容器内 stretch */
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
}
.welcome-card {
    width: 100% !important;  /* 撑满父容器（与显示区等宽） */
    max-width: 100% !important;
    min-width: 100% !important;  /* 强制最小宽度 = 父容器 */
    box-sizing: border-box !important;  /* padding 包含在 width 内 */
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: linear-gradient(135deg, #fff, var(--primary-50));
    border: 1px solid var(--primary-100);
    border-radius: 16px;
    padding: 16px 18px;
    margin-top: 6px;
}

.greeting {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.5;
}
.greeting strong {
    color: var(--primary-600);
}

.greeting-sub {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}
.greeting-sub strong {
    color: var(--primary-600);
    font-weight: 600;
}

.capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.capability-tag {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    font-weight: 500;
}

.quick-examples {
    border-top: 1px dashed var(--primary-200);
    padding-top: 14px;
}

.quick-examples-title {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 10px;
    font-weight: 500;
}

.quick-examples-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-example-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.quick-example-chip:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    color: var(--primary-700);
}
.quick-example-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-400);
    flex-shrink: 0;
}

/* =========== 快捷建议标签 =========== */
.suggestions {
    display: flex;
    gap: 8px;
    padding: 6px 16px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    scrollbar-width: none;
}

.suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
}

.suggestion-chip:active {
    transform: scale(0.95);
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.suggestion-chip svg {
    flex-shrink: 0;
}

/* =========== 底部输入栏 =========== */
.input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 14px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    flex-shrink: 0;
}



.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: var(--radius-2xl);
    padding: 4px 4px 4px 16px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.input-wrapper:focus-within {
    background: #fff;
    border-color: var(--primary-300);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    color: var(--gray-800);
    font-family: inherit;
    padding: 8px 0;
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.input-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.input-send:active {
    transform: scale(0.9);
}

.input-send:disabled {
    opacity: 0.4;
    box-shadow: none;
}

.input-send svg {
    width: 18px;
    height: 18px;
}

/* =========== 楼盘推荐卡片 =========== */
.property-card {
    background: linear-gradient(135deg, #fff, var(--gray-50));
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-top: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.property-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400), var(--primary-300));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.property-card:hover::before {
    opacity: 1;
}

.property-card:active {
    transform: translateY(-1px) scale(0.99);
}

.property-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.property-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.3;
    flex: 1;
}

.property-card-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
    color: var(--primary-700);
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--primary-200);
}

/* 价格展示区域 */
.property-card-price-section {
    background: linear-gradient(135deg, var(--primary-50), #fff);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--primary-100);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-600);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.property-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.property-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-700);
    padding: 6px 0;
}

.property-info-item .label {
    color: var(--gray-500);
    font-weight: 500;
    min-width: 60px;
}

/* 基本信息展示 */
.property-card-basic-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
}

.basic-info-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basic-info-content {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.6;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
}

.property-card-reason {
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--primary-50), #fff);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--primary-700);
    line-height: 1.6;
    border: 1px solid var(--primary-100);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.property-card-warning {
    padding: 8px 12px;
    background: #FEF3C7;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: #92400E;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* =========== 成本计算卡片 =========== */
.calc-card {
    background: linear-gradient(135deg, #fff, var(--gray-50));
    border-radius: var(--radius-lg);
    margin-top: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calc-card-header {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-card-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-600);
    background: #fff;
    padding: 4px 10px;
    border-radius: 20px;
}

.calc-card-body {
    padding: 10px 12px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row.highlight {
    background: linear-gradient(135deg, var(--primary-50), #fff);
    margin: 8px -16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.calc-row.warning {
    background: linear-gradient(135deg, #FEF2F2, #fff);
    margin: 8px -16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.calc-row.warning .calc-value {
    color: var(--error);
}

.calc-row.sub-item {
    padding-left: 20px;
    padding-right: 16px;
    font-size: 13px;
}

.calc-row.sub-item .calc-label {
    color: var(--gray-400);
}

.calc-row.sub-item .calc-value {
    font-size: 14px;
}

.calc-label {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.calc-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}

.calc-row.highlight .calc-value {
    color: var(--primary-600);
    font-size: 16px;
}

.calc-card-footer {
    padding: 10px 16px;
    background: #F9FAFB;
    border-top: 1px solid var(--gray-100);
    font-size: 12px;
}

.calc-note {
    color: var(--gray-600);
    font-size: 12px;
}

.calc-extra-notes {
    padding: 12px 16px;
    background: #FFFBEB;
    border-top: 1px solid #FDE68A;
}

.calc-note-item {
    font-size: 12px;
    color: #92400E;
    margin-bottom: 6px;
    line-height: 1.5;
}

.calc-note-item:last-child {
    margin-bottom: 0;
}

/* =========== 消息文本内容 =========== */
.text-content {
    font-size: 14.5px;
    line-height: 1.4;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.text-content br {
    display: block;
    content: "";
    margin: 4px 0;
}

/* 加粗文本 */
.text-bold {
    font-weight: 700;
    color: var(--gray-900);
}

/* 标题样式 */
.formatted-title {
    font-weight: 700;
    margin: 4px 0 1px 0;
}

.formatted-title.level-1 {
    font-size: 17px;
    color: var(--primary-700);
    border-bottom: 2px solid var(--primary-200);
    padding-bottom: 3px;
    margin-top: 6px;
}

.formatted-title.level-2 {
    font-size: 15px;
    color: var(--primary-600);
    border-left: 4px solid var(--primary-400);
    padding-left: 8px;
    margin-top: 5px;
}

.formatted-title.level-3 {
    font-size: 14px;
    color: var(--primary-500);
    margin-top: 4px;
}

/* 高亮标签 */
.highlight-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
    color: var(--primary-700);
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin: 0 1px;
}

.highlight-quote {
    display: inline-block;
    background: #FFF3E0;
    color: #E65100;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border-left: 2px solid #FF9800;
    margin: 0 1px;
}

/* 高亮数字 */
.highlight-number {
    color: var(--primary-600);
    font-weight: 600;
}

/* 列表样式 */
.formatted-list {
    margin: 3px 0;
    padding-left: 18px;
}

.ordered-list-item {
    margin: 0;
    padding-left: 2px;
}

.unordered-list-item {
    margin: 0;
    padding-left: 2px;
    list-style-type: '•  ';
}

/* =========== 对比表格 =========== */
.compare-container {
    margin-top: 8px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.compare-table th,
.compare-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.compare-table th {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    color: var(--primary-700);
    font-weight: 600;
    font-size: 13px;
}

.compare-table th:nth-child(2),
.compare-table th:nth-child(3) {
    text-align: center;
}

.compare-table td:first-child {
    font-weight: 500;
    color: var(--gray-600);
    width: 90px;
    background: var(--gray-50);
}

.compare-table td:nth-child(2),
.compare-table td:nth-child(3) {
    text-align: center;
}

.compare-table tr:last-child td {
    border-bottom: none;
}

.compare-table tr:hover td {
    background: var(--gray-50);
}

.compare-table tr:hover td:first-child {
    background: var(--gray-100);
}

.compare-table strong {
    color: var(--gray-700);
}

/* =========== 成本计算结果 =========== */
.calc-result {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 8px;
    border: 1px solid var(--gray-200);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-label {
    font-size: 14px;
    color: var(--gray-500);
}

.calc-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.calc-value.highlight {
    color: var(--primary-600);
    font-size: 18px;
}

.calc-note {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
}

/* =========== 留资引导卡片 =========== */
.lead-card {
    margin: 20px 0 12px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    animation: lead-card-in 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes lead-card-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead-card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #F97316, #F59E0B, #FCD34D);
    opacity: 0.1;
}

.lead-card-content {
    position: relative;
    padding: 24px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(249, 115, 22, 0.2);
    text-align: center;
}

.lead-card-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.lead-card-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.lead-card-content > p {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.lead-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

.lead-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}

.benefit-icon {
    font-size: 14px;
}

.lead-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
    font-family: inherit;
}

.lead-btn:active {
    transform: scale(0.97);
}

.lead-skip {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 14px;
    cursor: pointer;
    margin-top: 6px;
    font-family: inherit;
    transition: color 0.2s ease;
}

.lead-skip:active {
    color: var(--gray-500);
}

/* =========== 留资表单弹窗 =========== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.lead-form {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.overlay.active .lead-form {
    transform: translateY(0);
}

.lead-form-header {
    padding: 28px 24px 16px;
    text-align: center;
    position: relative;
}

.lead-form-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.lead-form-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.lead-form-header > p {
    font-size: 14px;
    color: var(--gray-500);
}

.lead-form-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lead-form-close:active {
    transform: scale(0.9);
    background: var(--gray-200);
}

form {
    padding: 0 24px 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.required {
    color: var(--error);
}

.form-group input {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    padding: 0 14px;
    font-size: 15px;
    color: var(--gray-800);
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-400);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-group .error-text {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

.submit-btn {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    margin-top: 4px;
}

.submit-btn:active {
    transform: scale(0.97);
}

.submit-btn svg {
    transition: transform 0.2s ease;
}

.submit-btn:active svg {
    transform: translateX(4px);
}

.form-disclaimer {
    font-size: 11px;
    color: var(--gray-400);
    text-align: center;
    padding: 0 24px 32px;
    line-height: 1.5;
}

/* =========== Toast提示 =========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: var(--gray-800);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
    pointer-events: none;
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* =========== 成功提交状态 =========== */
.success-state {
    padding: 40px 24px;
    text-align: center;
}

.success-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.success-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.success-state p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
}

/* =========== 响应式适配 =========== */
@media (min-width: 481px) {
    .app-container {
        border-radius: 0;
        box-shadow: var(--shadow-xl);
        border-left: 1px solid var(--gray-200);
        border-right: 1px solid var(--gray-200);
    }
}

/* 手机端通用优化 */
@media (max-width: 480px) {
    .app-header {
        padding: 12px 14px 10px;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
    }

    .brand-text h1 {
        font-size: 16px;
    }

    .chat-area {
        padding: 12px 12px 8px;
    }

    .welcome-card {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .greeting {
        font-size: 15px;
    }

    .greeting-sub {
        font-size: 13px;
    }

    .capability-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .quick-example-chip {
        padding: 8px 12px;
        font-size: 13px;
    }

    .message-content {
        padding: 12px 14px;
        max-width: 88%;
    }

    .suggestions {
        padding: 6px 12px 10px;
    }

    .input-bar {
        padding: 8px 10px 12px;
    }
}

@media (max-width: 374px) {
    .suggestion-chip {
        font-size: 12px;
        padding: 6px 12px;
    }

    .message-content {
        font-size: 14px;
        padding: 12px 14px;
    }

    .lead-card-content {
        padding: 20px 16px;
    }

    .welcome-card {
        padding: 10px 12px;
    }

    .greeting {
        font-size: 14px;
    }

    .greeting-sub {
        font-size: 12px;
    }
}

/* 安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .input-bar {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
}

/* ========== 悬浮联系方式入口圆点 ========== */
.float-contact-dot {
    position: fixed;
    /* 位置由 JS 动态设置（贴在 app-container 右边缘外） */
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F97316;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.float-contact-dot:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.6);
}

/* 移动端：屏幕窄时回到 app-container 内部紧贴右边 */
@media (max-width: 768px) {
    .float-contact-dot {
        width: 20px;
        height: 20px;
    }
}

.float-contact-dot .pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* =========== 消息中的AI动作按钮 =========== */
.ai-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-200);
    background: var(--primary-50);
    color: var(--primary-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 4px 4px 4px 0;
    font-family: inherit;
}

.ai-action-btn:active {
    transform: scale(0.96);
    background: var(--primary-100);
}

.ai-action-btn.primary {
    background: linear-gradient(135deg, #F97316, #F59E0B);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.ai-action-btn.primary:active {
    transform: scale(0.96);
}

/* =========== 展开/收起功能 =========== */
.text-wrapper {
    position: relative;
}

.text-wrapper.collapsed .text-content {
    max-height: 180px;
    overflow: hidden;
    position: relative;
}

.text-wrapper.collapsed .expand-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--primary-50));
    pointer-events: none;
}

.text-wrapper:not(.collapsed) .expand-overlay {
    display: none;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    padding: 6px 12px;
    border: 1px solid var(--primary-200);
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.expand-btn:hover {
    background: var(--primary-100);
    border-color: var(--primary-300);
}

.expand-btn:active {
    transform: scale(0.96);
}

.expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

/* =========== Cloudflare Turnstile 人机验证样式 =========== */
#captcha-challenge .message-content {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 16px;
}

#captcha-challenge p {
    color: #92400e;
    font-weight: 600;
    font-size: 14px;
}



#captcha-challenge button {
    background: #f97316;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
    display: block;
    width: 100%;
    text-align: center;
}

#captcha-challenge button:hover {
    background: #ea580c;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* =========== 登录/注册弹窗（极简） =========== */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    margin-left: auto;
}
.user-pill:hover { background: #f9fafb; border-color: #f97316; color: #f97316; }
.user-pill.is-logged-in { color: #f97316; border-color: #f97316; background: #fff7ed; }

.auth-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(2px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    overflow-y: auto;
    padding: 16px 0;
    animation: authFadeIn 0.18s ease;
}
@keyframes authFadeIn { from{opacity:0} to{opacity:1} }

.auth-modal {
    position: relative;
    width: min(92vw, 380px);
    background: #fff;
    border-radius: 20px;
    padding: 24px 22px 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    /* 不限制 max-height，让内容自然撑开；外层 overlay 可滚动 */
    animation: authSlideUp 0.22s cubic-bezier(.2,.7,.2,1);
}
@keyframes authSlideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }

.auth-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: #9ca3af; cursor: pointer; border-radius: 8px;
}
.auth-close:hover { background: #f3f4f6; color: #111827; }

.auth-title { font-size: 20px; font-weight: 700; color: #111827; text-align: center; }
.auth-sub   { font-size: 14px; color: #9ca3af; text-align: center; margin: 6px 0 4px; }
.auth-value { font-size: 13px; color: var(--primary-600); text-align: center; margin: 0 0 16px; font-weight: 500; }

.auth-pane { display: none; }
.auth-pane.active { display: block; }

/* 密码模式子 Tab */
.auth-password-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 4px;
}
.auth-password-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-password-tab.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* 密码子面板：默认隐藏，active 时显示。使用更高优先级避免被覆盖 */
.auth-pane-password .auth-password-subpane { display: none !important; }
.auth-pane-password .auth-password-subpane.active { display: block !important; }

/* 双按钮：默认隐藏，由 JS 根据当前模式显示 */
#auth-submit-login,
#auth-submit-register {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
    display: none;
}
#auth-submit-login.auth-visible { display: block; }
#auth-submit-register.auth-visible { display: block; }
#auth-submit-register.auth-enabled {
    background: var(--primary-500, #F97316);
    cursor: pointer;
}


.auth-field { margin-bottom: 12px; }
.auth-field:last-child { margin-bottom: 0; }
.auth-field input {
    width: 100%; padding: 13px 18px;
    border: 1px solid #e5e7eb; border-radius: 24px;
    font-size: 15px; color: #111827;
    background: #f9fafb; transition: all 0.15s;
    outline: none;
}
.auth-field input::placeholder { color: #c4c4c4; }
.auth-field input:focus { background: #fff; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }

.auth-row { display: flex; gap: 0; align-items: center; }
.auth-row input { flex: 1; border-radius: 24px 0 0 24px; border-right: none; }
.auth-row .auth-send-code {
    height: 48px; padding: 0 16px;
    border: 1px solid #e5e7eb; border-left: none;
    border-radius: 0 24px 24px 0;
    background: #f9fafb;
}
.auth-row .auth-send-code:focus,
.auth-row input:focus { box-shadow: none; border-color: #e5e7eb; background: #f9fafb; }

.auth-send-code {
    white-space: nowrap;
    background: transparent; border: none; color: var(--primary-500);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all 0.15s;
}
.auth-send-code:hover:not(:disabled) { color: var(--primary-600); }
.auth-send-code:disabled { color: #c4c4c4; cursor: not-allowed; }

.auth-mode-toggle { margin: 0; }
.auth-mini-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; cursor: pointer; }
.auth-mini-toggle input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary-500); flex-shrink: 0; margin: 0; }

.auth-consents a { color: var(--primary-500); text-decoration: none; }
.auth-consents a:hover { text-decoration: underline; }

.auth-submit {
    width: 100%; padding: 14px 0;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    color: #fff; font-size: 16px; font-weight: 600;
    border: none; border-radius: 24px; cursor: pointer;
    transition: all 0.18s;
}
.auth-submit:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-600), var(--primary-500)); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-tip { min-height: 16px; margin-top: 8px; text-align: center; font-size: 12px; }
.auth-tip.success { color: #059669; }
.auth-tip.error   { color: #dc2626; }
.auth-tip.info    { color: #6b7280; }

/* =========== 登录弹框内嵌的安全检测验证码（未登录时使用） =========== */
.auth-captcha-container {
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.auth-captcha-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    margin: 4px 0;
}
.auth-captcha-tip { color: #6b7280; }
.auth-captcha-tip.success { color: #059669; }
.auth-captcha-tip.error   { color: #dc2626; }
.auth-captcha-tip.info    { color: #6b7280; }
.auth-captcha-status.loading { color: #6b7280; }
.auth-captcha-status.success { color: #059669; }
.auth-captcha-status.error   { color: #dc2626; }

/* =========== 安全检测验证码弹框（独立于登录弹框，z-index 更高） =========== */
.captcha-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(3px);
    z-index: 11000; /* 高于登录弹框 */
    display: flex; align-items: center; justify-content: center;
    animation: authFadeIn 0.18s ease;
}
.captcha-modal {
    position: relative;
    width: min(92vw, 400px);
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    animation: authSlideUp 0.22s cubic-bezier(.2,.7,.2,1);
}
.captcha-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none;
    color: #9ca3af; cursor: pointer; border-radius: 8px;
}
.captcha-close:hover { background: #f3f4f6; color: #111827; }
.captcha-title { font-size: 20px; font-weight: 700; color: #111827; text-align: center; margin: 0 0 6px; }
.captcha-sub   { font-size: 14px; color: #6b7280; text-align: center; margin: 0 0 16px; }
#captcha-widget-container { min-height: 60px; display: flex; align-items: center; justify-content: center; margin: 8px 0; }
.captcha-tip { min-height: 18px; margin-top: 8px; text-align: center; font-size: 13px; }
.captcha-tip.error   { color: #dc2626; }
.captcha-tip.success { color: #059669; }
.captcha-tip.info    { color: #6b7280; }
.captcha-submit {
    width: 100%; margin-top: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: #fff; border: none; border-radius: 24px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all 0.15s;
}
.captcha-submit:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-600), var(--primary-500)); }
.captcha-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-footer {
    margin-top: 12px;
    text-align: center;
}
.auth-switch-link {
    font-size: 13px; color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-switch-link:hover { color: #6b7280; text-decoration: underline; }

/* 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.checkbox-group.error-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.checkbox-group.error-shake label {
    color: #ef4444 !important;
}

/* =========== Markdown 渲染新增样式 =========== */

/* 代码块样式 */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13.5px;
    line-height: 1.4;
}

.code-block code {
    display: block;
}

/* 行内代码样式 */
.inline-code {
    background: #f4f4f4;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

/* 引用块样式 */
.formatted-quote {
    border-left: 4px solid var(--primary-400);
    background: linear-gradient(90deg, var(--primary-50), transparent);
    padding: 6px 10px;
    margin: 5px 0;
    color: var(--gray-700);
    border-radius: 0 8px 8px 0;
}

/* 链接样式 */
.formatted-link {
    color: var(--primary-600);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.formatted-link:hover {
    color: var(--primary-700);
    border-bottom-color: var(--primary-400);
}

/* 分隔线样式 */
.formatted-hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
    margin: 12px 0;
}

/* 斜体样式 */
em {
    font-style: italic;
    color: var(--gray-700);
}

/* 删除线样式 */
del {
    text-decoration: line-through;
    color: var(--gray-500);
}

/* 四级及以下标题样式 */
.formatted-title.level-4 {
    font-size: 14px;
    color: var(--gray-700);
}

.formatted-title.level-5 {
    font-size: 13px;
    color: var(--gray-600);
}

.formatted-title.level-6 {
    font-size: 12px;
    color: var(--gray-500);
}

/* =========== iOS添加到桌面步骤 =========== */
.ios-steps-container {
    padding: 0 24px 32px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.ios-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-step-content {
    font-size: 16px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* iOS Safari 分享图标样式 */
.ios-share-icon {
    display: inline-block;
    width: 18px;
    height: 22px;
    position: relative;
    vertical-align: middle;
}

.ios-share-icon::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    width: 2px;
    height: 12px;
    background: var(--gray-700);
    transform: translateX(-50%);
}

.ios-share-icon::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid var(--gray-700);
    border-right: 2px solid var(--gray-700);
    transform: translateX(-50%) rotate(-45deg);
}

.ios-share-icon .box {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 14px;
    height: 10px;
    border: 2px solid var(--gray-700);
    border-radius: 2px;
    transform: translateX(-50%);
}
