:root {
    --primary-glow: #8a2be2; /* 原版的神秘紫 */
    --bg-color: #050510;
    --glass-bg: rgba(15, 15, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --gold: #d4af37;
    --gold-hover: #f3c642;
    --text-primary: #e0e0ff;
    --text-secondary: rgba(255, 255, 255, 0.4);
    --danger: #ff4b4b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 核心：原版的 Canvas 星空 */
#starCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 毛玻璃通用样式 - 融合原版的阴影 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 40px rgba(138, 43, 226, 0.15);
    position: relative;
    z-index: 1;
}

.gold-text { color: var(--gold); }
.purple-text { color: #bfa0ff; }

/* ================= 汉堡包按钮 ================= */
.menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
}

.menu-btn:hover {
    color: var(--primary-glow);
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8);
}

/* ================= 左侧历史抽屉 ================= */
.sidebar {
    position: fixed;
    top: 0; left: -350px;
    width: 320px; height: 100vh;
    z-index: 200;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
    padding: 20px;
    border-right: 1px solid var(--glass-border);
    border-radius: 0 24px 24px 0;
}

.sidebar.open { left: 0; }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; color: var(--gold);
    letter-spacing: 2px;
}

.close-btn { cursor: pointer; font-size: 20px; color: var(--text-secondary); transition: 0.3s;}
.close-btn:hover { color: var(--primary-glow); }

.sidebar-user {
    background: rgba(0,0,0,0.4);
    padding: 20px; border-radius: 12px; margin-bottom: 25px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.sidebar-user p { margin-bottom: 10px; font-size: 14px; }
.points-display { font-size: 16px; font-weight: bold; }

.sidebar-actions { display: flex; gap: 10px; margin-top: 15px; }

.btn-small {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(138, 43, 226, 0.5);
    color: var(--text-primary);
    padding: 8px 0; border-radius: 20px;
    cursor: pointer; transition: 0.3s; font-size: 12px;
}
.btn-small:hover { 
    background: rgba(138, 43, 226, 0.2); 
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4); 
}

.history-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.history-section h3 {
    flex: 0 0 auto;
    font-size: 14px; color: var(--text-secondary);
    margin-bottom: 15px; border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}
.history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.history-item {
    padding: 12px; border-radius: 8px; margin-bottom: 10px;
    cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}
.history-item:hover {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.3);
}
.history-title { font-size: 14px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff;}
.history-date { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; }
.trash-btn { color: var(--danger); opacity: 0.5; transition: 0.2s; }
.trash-btn:hover { opacity: 1; }

/* ================= 主工作台 ================= */
.main-workspace {
    width: 100%; max-width: 800px; height: 100vh;
    padding: 20px; display: flex; flex-direction: column; justify-content: center;
}

.chat-container {
    height: 85vh; border-radius: 24px;
    display: flex; flex-direction: column; overflow: hidden;
}

.chat-header {
    text-align: center; padding: 25px 0;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
}

.chat-header h1 { 
    font-size: 28px; color: #fff; letter-spacing: 4px; font-weight: 300;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.chat-header .subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 5px; letter-spacing: 5px;}

.chat-history {
    flex: 1; padding: 30px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 20px;
}

.message { display: flex; gap: 15px; max-width: 90%; }
.ai-message { align-self: flex-start; }
.user-message { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: url('https://images.unsplash.com/photo-1534447677768-be436bb09401?ixlib=rb-4.0.3&auto=format&fit=crop&w=100&q=80') center/cover;
    border: 1px solid rgba(138, 43, 226, 0.8);
    display: flex; justify-content: center; align-items: center;
    color: #fff; flex-shrink: 0;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
    font-size: 12px; font-weight: bold; letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

.msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px; border-radius: 12px;
    line-height: 1.8; font-size: 15px;
    border-top-left-radius: 0;
}

.user-message .msg-bubble {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.4);
    border-top-left-radius: 12px;
    border-top-right-radius: 0;
}

.chat-input-area {
    padding: 20px; background: rgba(0,0,0,0.3);
    border-top: 1px solid var(--glass-border);
    display: flex; gap: 15px;
}

input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(138, 43, 226, 0.3);
    color: #fff; padding: 15px; border-radius: 20px;
    outline: none; font-size: 15px; transition: 0.3s;
}

input:focus { 
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

#questionInput { flex: 1; }

.send-btn {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(75, 0, 130, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; padding: 0 30px; border-radius: 30px;
    cursor: pointer; font-size: 16px; letter-spacing: 2px;
    transition: 0.3s; box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}
.send-btn:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(138, 43, 226, 0.6); }

/* ================= 弹窗 ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); z-index: 1000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(8px);
}
.modal-content {
    width: 90%; max-width: 700px; padding: 50px;
    border-radius: 24px; position: relative; text-align: center;
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(138, 43, 226, 0.1);
}
.modal-close {
    position: absolute; top: 25px; right: 25px;
    color: var(--text-secondary); cursor: pointer; font-size: 24px;
}
.modal-close:hover { color: #fff; }
.form-input { width: 100%; margin: 0; border-radius: 12px; }
.email-code-area {
    width: 100%;
    margin-bottom: 14px;
}
.email-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
    align-items: stretch;
}
.email-code-row .form-input {
    padding: 15px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(138,43,226,0.3);
    color: #fff;
}
.email-code-btn {
    border: 1px solid rgba(212, 175, 55, 0.36);
    border-radius: 12px;
    background: rgba(138, 43, 226, 0.24);
    color: #f1d582;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}
.email-code-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.email-code-hint {
    margin: 8px 0 0;
    color: rgba(255,255,255,0.52);
    font-size: 12px;
    text-align: left;
}
.checkbox-container { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; text-align: left; }
.checkbox-container label { font-size: 12px; color: var(--text-secondary); cursor: pointer; }

.btn-large {
    width: 100%; padding: 15px; border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px; font-size: 16px; letter-spacing: 2px;
    cursor: pointer; transition: 0.3s;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.8), rgba(75, 0, 130, 0.8));
    color: #fff; box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}
.btn-large:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(138, 43, 226, 0.6); }

/* ================= 充值弹窗 ================= */
.pricing-cards { display: flex; gap: 20px; margin: 35px 0; }
.price-card {
    flex: 1; background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; padding: 30px 10px; cursor: pointer; transition: 0.3s; position: relative;
}
.price-card:hover, .price-card.selected {
    border-color: rgba(138, 43, 226, 0.8);
    background: rgba(138, 43, 226, 0.1);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.4);
    transform: translateY(-5px);
}
.price-card h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 15px; letter-spacing: 1px; }
.price-card .points { font-size: 28px; font-weight: bold; color: white; margin-bottom: 10px; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.price-card .price { font-size: 18px; color: #bfa0ff; font-weight: bold; }
.badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #ff4b4b, #d4af37); color: white; font-size: 12px;
    padding: 4px 12px; border-radius: 12px; white-space: nowrap; font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
}
.qr-payment-area,
.payment-status-area {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px dashed rgba(212, 175, 55, 0.22);
}
.payment-status-content {
    width: min(100%, 430px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.payment-status-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(191, 160, 255, 0.28);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(24, 12, 42, 0.86), rgba(5, 3, 14, 0.92));
    box-shadow: inset 0 0 18px rgba(138, 43, 226, 0.08);
    text-align: left;
}
.payment-status-row i {
    flex: 0 0 auto;
    font-size: 26px;
    color: #d4af37;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.36);
}
.payment-status-row strong,
.payment-error-state strong,
.payment-success-state strong {
    display: block;
    color: #fff;
    font-size: 15px;
    line-height: 1.45;
}
.payment-status-row span,
.payment-error-state span,
.payment-success-state span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
    line-height: 1.55;
}
.payment-go-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 30px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    box-shadow: 0 0 24px rgba(138, 43, 226, 0.42);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.payment-go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 34px rgba(138, 43, 226, 0.62);
}
.payment-status-note {
    margin: 0;
    color: #bfa0ff;
    font-size: 12px;
    line-height: 1.6;
}
.payment-error-state,
.payment-success-state {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    background: rgba(5, 3, 14, 0.88);
    border: 1px solid rgba(191, 160, 255, 0.24);
    text-align: center;
}
.payment-error-state i,
.payment-success-state i {
    display: block;
    margin-bottom: 9px;
    font-size: 34px;
}
.payment-error-state i { color: #ff5b5b; }
.payment-success-state i { color: #4cd964; }
.qr-placeholder { display: none; }

/* ================= 分享海报弹窗 ================= */
.share-modal { max-width: 400px; }

/* ================= 分享海报高贵神秘设计 ================= */
.poster-preview {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.share-poster {
    width: 280px;
    height: 420px;
    background: url('bg_poster.png') no-repeat center center;
    background-size: cover;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(138,43,226,0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.poster-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(10,5,20,0.1) 0%, rgba(10,5,20,0.9) 100%);
    z-index: 1;
}

.share-poster .poster-content {
    position: relative;
    z-index: 2;
    padding: 25px 20px;
    text-align: left;
}

.poster-title {
    color: #d4af37;
    font-size: 20px;
    margin-bottom: 5px;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.poster-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.qr-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(191, 160, 255, 0.3);
    backdrop-filter: blur(5px);
}

.qr-box {
    width: 90px;
    height: 90px;
    background: white;
    padding: 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.qr-text p {
    margin: 0;
    font-size: 12px;
    color: #ccc;
    line-height: 1.4;
}

.qr-text .highlight {
    color: #bfa0ff;
    font-weight: bold;
    font-size: 14px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(138, 43, 226, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(138, 43, 226, 0.5); }

/* 极窄屏 (iPhone SE 1代 等 ≤400px) 侧边栏宽度保护 [问题6修复] */
@media (max-width: 400px) {
    .sidebar {
        width: 90vw !important;
        left: -92vw !important;
    }
    .sidebar.open {
        left: 0 !important;
    }
}

/* 方案 C 密码必填校验样式 */
.form-input.input-error {
    border-color: #ff5b5b !important;
    box-shadow: 0 0 10px rgba(255, 91, 91, 0.4) !important;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.shake-anim {
    animation: shake 0.4s ease-in-out;
}

/* 提问秘籍弹窗专属精致样式 */
.guide-scroll-container h3 {
    color: #d4af37;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 500;
    border-left: 3px solid #d4af37;
    padding-left: 10px;
}
.guide-scroll-container p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 15px;
    line-height: 1.6;
}
.guide-scroll-container ul {
    padding-left: 20px;
    margin-bottom: 15px;
}
.guide-scroll-container li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
}
.guide-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}
.guide-box.success {
    border-left: 4px solid #28a745;
    background: rgba(40, 167, 69, 0.05);
}
.guide-box.error {
    border-left: 4px solid #dc3545;
    background: rgba(220, 53, 69, 0.05);
}
.guide-box-title {
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.guide-box.success .guide-box-title {
    color: #4ade80;
}
.guide-box.error .guide-box-title {
    color: #f87171;
}

/* ================= 前台移动端自适应优化 ================= */
@media (max-width: 768px) {
    /* 1. 充值卡片自适应 2×2 网格布局 */
    .pricing-cards {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin: 20px 0 !important;
    }
    .price-card {
        padding: 15px 5px !important;
        border-radius: 10px !important;
    }
    .price-card h3 {
        font-size: 13px !important;
        margin-bottom: 5px !important;
    }
    .price-card .price {
        font-size: 15px !important;
    }
    .price-card .badge {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }

    /* 2. 主操作面板与大输入框加高自适应 */
    .main-workspace {
        padding: 10px !important;
    }
    #mainPanel {
        padding: 20px 15px !important;
        max-height: calc(100vh - 20px) !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .title {
        font-size: 22px !important;
        margin-bottom: 20px !important;
    }
    #questionInput {
        height: 250px !important;
        font-size: 14px !important;
        padding: 12px !important;
        border-radius: 10px !important;
    }
    #questionInput:focus {
        border-color: #d4af37 !important;
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.4) !important;
    }
    #birthYearInput, #divinationTimeInput {
        font-size: 14px !important;
        padding: 12px !important;
        border-radius: 10px !important;
        margin-top: 10px !important;
    }
    #divinationTimeInput {
        text-align: left !important;
    }
    #divinationTimeInput::placeholder {
        font-size: 13px !important;
    }

    /* 3. 分享海报缩放 */
    .share-poster {
        width: 240px !important;
        height: 360px !important;
    }

    /* 4. 聊天气泡横向最大拉伸与可读性优化 */
    .message {
        max-width: 95% !important;
    }
    .msg-bubble {
        padding: 10px 15px !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    /* 5. 弹窗关闭按钮放大与触控区优化 */
    .modal-close {
        top: 15px !important;
        right: 15px !important;
        font-size: 28px !important;
        padding: 8px !important;
        color: rgba(255, 255, 255, 0.85) !important;
    }

    /* 5b. 移动端弹窗背景支持滚动与顶部对齐，防内容切除 */
    .modal-overlay {
        overflow-y: auto !important;
        align-items: flex-start !important;
        padding: 20px 10px !important;
    }
    
    /* 6. 协议复选框物理大小与排版间距优化 */
    .checkbox-container {
        gap: 12px !important;
        margin-top: 15px !important;
    }
    .checkbox-container input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin-top: 2px !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
    }
    .checkbox-container label {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    /* 7. 天机明细账列表自适应最大高度 */
    #pointLogContainer {
        max-height: 45vh !important;
    }

    /* ====== 问题1修复：resultBox 高度固定为 70vh，确保内部 chatHistory 能正常上下滚动 ====== */
    #resultBox {
        height: 70vh !important;
    }

    /* ====== 问题4修复：充值弹窗内容区超高时内部可滚动 ====== */
    #rechargeModal .modal-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    /* ====== 问题5修复：后台统计卡片手机端纵向空间压缩 ====== */
    .stat-box {
        padding: 12px 15px !important;
    }
    .stat-box p {
        font-size: 28px !important;
        margin: 6px 0 0 0 !important;
    }
    .stat-box h3 {
        font-size: 13px !important;
    }

    /* ====== 问题8修复：奇门指引弹窗手机端字号微调 ====== */
    .guide-scroll-container h3 {
        font-size: 15px !important;
    }
    .guide-scroll-container p {
        font-size: 13px !important;
    }
    .guide-scroll-container li {
        font-size: 13px !important;
    }
}

/* ================= 天机推演聊天界面精修：桌面 + 手机 ================= */
.main-workspace.is-result-mode #mainPanel,
#mainPanel.is-result-mode {
    max-width: min(960px, calc(100vw - 48px)) !important;
    padding-left: clamp(24px, 4vw, 50px) !important;
    padding-right: clamp(24px, 4vw, 50px) !important;
}

#resultBox.chat-result-panel {
    height: min(78vh, 760px) !important;
    min-height: 600px;
    overflow: hidden;
}

#resultBox .chat-header {
    padding: 20px 0 18px !important;
    flex: 0 0 auto;
}

#resultBox .chat-header h1 {
    margin: 0;
    font-size: 26px !important;
    line-height: 1.25;
    letter-spacing: 8px !important;
}

.chat-subtitle {
    margin: 8px 0 0;
    color: rgba(191, 160, 255, 0.66);
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 2px;
}

#chatHistory {
    min-height: 0;
    box-sizing: border-box;
    padding: 28px 0 46px !important;
    gap: 18px !important;
    scroll-behavior: smooth;
    scroll-padding-bottom: 46px;
    overscroll-behavior: contain;
}

#chatHistory .message {
    align-items: flex-start;
    max-width: 72%;
}

#chatHistory .ai-message {
    max-width: 64%;
}

#chatHistory .user-message {
    max-width: 68%;
}

#chatHistory .msg-avatar {
    width: 44px;
    height: 44px;
    font-size: 12px;
}

#chatHistory .msg-bubble {
    padding: 16px 22px;
    font-size: 17px;
    line-height: 1.72;
    color: rgba(255,255,255,0.92);
    word-break: break-word;
    overflow-wrap: anywhere;
}

#chatHistory .user-message .msg-bubble {
    background: rgba(117, 39, 185, 0.38);
    border-color: rgba(191, 119, 255, 0.42);
    box-shadow: 0 12px 28px rgba(80, 18, 135, 0.22);
}

.status-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.waiting-hint {
    display: block;
    margin-top: 8px;
    color: rgba(212, 175, 55, 0.78);
    font-size: 13px;
    line-height: 1.5;
}

#resultBox .chat-input-area {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    margin-top: 12px !important;
    padding: 18px 24px 0 !important;
    gap: 14px !important;
    align-items: flex-end;
}

#followUpInput {
    min-width: 0;
    height: 54px;
    min-height: 54px;
    max-height: 112px;
    padding: 14px 20px;
    border-radius: 22px;
    border: 1px solid rgba(171, 64, 255, 0.72);
    background: rgba(5, 3, 13, 0.78);
    color: rgba(255, 255, 255, 0.94);
    font-size: 16px;
    line-height: 1.45;
    resize: none;
    overflow-y: hidden;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    box-shadow: inset 0 0 14px rgba(117, 39, 185, 0.18), 0 0 12px rgba(117, 39, 185, 0.18);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#followUpInput::placeholder {
    color: rgba(255, 255, 255, 0.46);
}

#followUpInput:focus {
    border-color: rgba(212, 175, 55, 0.72);
    background: rgba(7, 4, 18, 0.88);
    box-shadow: inset 0 0 14px rgba(117, 39, 185, 0.2), 0 0 16px rgba(212, 175, 55, 0.18);
}

#followUpInput.followup-scroll {
    overflow-y: auto;
}

#resultBox .send-btn {
    flex: 0 0 auto;
    min-width: 108px;
    height: 54px;
    padding: 0 24px !important;
    border-radius: 22px !important;
    font-size: 17px;
    box-shadow: 0 0 18px rgba(138, 43, 226, 0.34);
}

@media (max-width: 768px) {
    #resultBox.chat-result-panel {
        height: calc(100vh - 56px) !important;
        min-height: 0;
    }

    #resultBox .chat-header {
        padding: 12px 0 14px !important;
    }

    #resultBox .chat-header button {
        font-size: 13px !important;
        top: 2px !important;
    }

    #resultBox .chat-header h1 {
        font-size: 20px !important;
        letter-spacing: 5px !important;
        padding: 0 70px;
    }

    .chat-subtitle {
        font-size: 12px;
        letter-spacing: 1px;
        margin-top: 6px;
    }

    #chatHistory {
        padding: 18px 0 48px !important;
        gap: 14px !important;
        scroll-padding-bottom: 48px;
    }

    #chatHistory .message {
        gap: 10px;
        max-width: 94% !important;
    }

    #chatHistory .ai-message {
        max-width: 94% !important;
    }

    #chatHistory .user-message {
        max-width: 86% !important;
    }

    #chatHistory .msg-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 10px !important;
    }

    #chatHistory .msg-bubble {
        padding: 12px 14px !important;
        font-size: 15px !important;
        line-height: 1.68 !important;
        border-radius: 12px;
    }

    .waiting-hint {
        font-size: 12px;
        margin-top: 6px;
    }

    #resultBox .chat-input-area {
        margin-top: 8px !important;
        padding: 12px 0 0 !important;
        gap: 10px !important;
        align-items: flex-end !important;
    }

    #followUpInput {
        height: 52px !important;
        min-height: 52px !important;
        max-height: 96px !important;
        padding: 12px 14px !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
        border-radius: 18px !important;
        overflow-y: hidden;
    }

    #followUpInput.followup-scroll {
        overflow-y: auto;
    }

    #resultBox .send-btn {
        flex: 0 0 78px;
        min-width: 78px;
        width: 78px;
        height: 52px;
        padding: 0 12px !important;
        border-radius: 18px !important;
        font-size: 15px;
        letter-spacing: 1px;
    }
}

@media (max-width: 420px) {
    #resultBox .chat-header h1 {
        font-size: 18px !important;
        letter-spacing: 4px !important;
        padding: 0 58px;
    }

    .chat-subtitle {
        display: none;
    }

    #resultBox .chat-input-area {
        flex-direction: row;
        align-items: flex-end !important;
    }

    #resultBox .send-btn {
        width: 78px;
        min-width: 78px;
        flex-basis: 78px;
    }
}

/* ================= 精致版本地头像：奇门 + 用户 ================= */
#chatHistory .msg-avatar {
    position: relative;
    overflow: visible;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: transparent;
    border: 1px solid rgba(230, 190, 110, 0.78);
    box-shadow:
        0 0 0 1px rgba(138, 43, 226, 0.45),
        0 0 16px rgba(138, 43, 226, 0.62),
        0 0 26px rgba(212, 175, 55, 0.24);
}

#chatHistory .msg-avatar::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.34), rgba(138,43,226,0.18) 46%, transparent 72%);
    z-index: -1;
}

#chatHistory .msg-avatar::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    pointer-events: none;
}

#chatHistory .ai-avatar {
    background-image: url('assets/qimen-avatar-20260708.png');
}

#chatHistory .user-avatar {
    background-image: url('assets/user-avatar-20260708.png');
}

#chatHistory .msg-avatar i {
    display: none;
}

/* ================= 长回答阅读框优化 ================= */
#chatHistory {
    overflow-x: hidden !important;
}

#chatHistory .answer-message {
    width: calc(100% - 8px) !important;
    max-width: calc(100% - 8px) !important;
}

#chatHistory .answer-message .answer-bubble {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 20px 30px;
    font-size: 17px;
    line-height: 1.85;
    background: linear-gradient(135deg, rgba(255,255,255,0.065), rgba(138,43,226,0.055));
    border: 1px solid rgba(138, 43, 226, 0.28);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

#chatHistory .answer-message .answer-bubble h3 {
    line-height: 1.45;
    margin: 10px 0 12px;
}

.qimen-chart-snapshot {
    width: 100%;
    margin-bottom: 18px;
}

.qimen-chart-section {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(138, 43, 226, 0.26);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(10, 7, 22, 0.82), rgba(29, 11, 50, 0.54));
    box-shadow: inset 0 0 20px rgba(138, 43, 226, 0.08);
}

.qimen-chart-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #d4af37;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.qimen-chart-heading i {
    color: #bfa0ff;
}

.qimen-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.qimen-meta-item {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.qimen-meta-item span {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    line-height: 1.35;
}

.qimen-meta-item strong {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.qimen-meta-item:last-child {
    grid-column: 1 / -1;
}

.qimen-visual-grid {
    width: min(100%, 360px) !important;
    max-width: 360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.qimen-palace-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    min-height: 92px;
    padding: 7px;
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.42);
    background: rgba(20, 5, 38, 0.74);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.qimen-palace-card.is-highlight {
    border-color: rgba(212, 175, 55, 0.9);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.22), inset 0 0 16px rgba(212, 175, 55, 0.08);
}

.qimen-palace-card.is-kong {
    background: linear-gradient(135deg, rgba(20, 5, 38, 0.78), rgba(5, 5, 16, 0.92));
}

.qimen-palace-card.is-center {
    align-items: center;
    justify-content: center;
}

.qimen-palace-top,
.qimen-palace-bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
}

.qimen-palace-top span,
.qimen-palace-bottom span {
    color: rgba(255, 255, 255, 0.92);
    font-size: 10px;
    line-height: 1.18;
    font-weight: 700;
}

.qimen-palace-top small,
.qimen-palace-bottom small {
    min-width: 0;
    color: rgba(191, 160, 255, 0.82);
    font-size: 9px;
    line-height: 1.16;
    text-align: right;
    overflow-wrap: anywhere;
}

.qimen-palace-bottom .qimen-palace-spirit {
    color: rgba(212, 175, 55, 0.92);
    font-weight: 700;
    white-space: nowrap;
}

.qimen-palace-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    color: #fff;
    text-align: center;
}

.qimen-palace-core strong,
.qimen-palace-core b {
    color: #fff;
    font-size: 16px;
    line-height: 1.1;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.qimen-palace-core span {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 14px;
    line-height: 1.1;
    font-weight: 700;
}

.qimen-palace-card.is-center .qimen-palace-core b {
    color: #d4af37;
}

.qimen-palace-flags {
    position: absolute;
    right: 7px;
    bottom: 24px;
    display: flex;
    gap: 4px;
}

.qimen-palace-flags em {
    font-style: normal;
    color: #ff6f6f;
    font-size: 8px;
    line-height: 1;
    font-weight: 700;
}

.qimen-answer-text {
    width: 100%;
}

@media (max-width: 768px) {
    .main-workspace.is-result-mode #mainPanel,
    #mainPanel.is-result-mode {
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #chatHistory .answer-message {
        width: 100% !important;
        max-width: 100% !important;
    }

    #chatHistory .answer-message .answer-bubble {
        padding: 14px 16px !important;
        font-size: 15px !important;
        line-height: 1.75 !important;
    }

    .qimen-chart-section {
        padding: 10px;
        margin-bottom: 12px;
    }

    .qimen-meta-grid {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .qimen-visual-grid {
        width: min(100%, 270px) !important;
        max-width: 270px;
        gap: 4px;
    }

    .qimen-palace-card {
        min-height: 82px;
        padding: 5px;
        border-radius: 7px;
    }

    .qimen-palace-top span,
    .qimen-palace-bottom span {
        font-size: 9px;
        line-height: 1.14;
    }

    .qimen-palace-top small,
    .qimen-palace-bottom small {
        font-size: 8px;
        line-height: 1.12;
    }

    .qimen-palace-core strong,
    .qimen-palace-core b {
        font-size: 15px;
    }

    .qimen-palace-core span {
        font-size: 13px;
    }

    .qimen-palace-flags {
        right: 5px;
        bottom: 20px;
    }

    .qimen-palace-flags em {
        font-size: 8px;
    }
}

/* ================= 分享弹窗精修：桌面 + 手机 ================= */
.share-modal {
    width: min(92vw, 430px);
    max-width: 430px;
    padding: 34px 32px 30px;
    border-radius: 18px;
}

.share-modal .modal-close {
    top: 18px;
    right: 20px;
    font-size: 25px;
    color: rgba(255,255,255,0.52);
}

.share-title {
    margin: 4px 28px 6px;
    font-size: 28px;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 1px;
}

.share-subtitle {
    margin: 0 auto 18px;
    max-width: 340px;
    color: rgba(255,255,255,0.86);
    text-align: center;
    font-size: 15px;
    line-height: 1.55;
}

.share-subtitle strong {
    color: #d4af37;
    font-size: 17px;
    white-space: nowrap;
}

.share-modal .poster-preview {
    margin-top: 16px;
}

.share-modal .share-poster {
    width: 292px;
    height: 438px;
    border-radius: 13px;
    border-color: rgba(212, 175, 55, 0.46);
    box-shadow: 0 16px 38px rgba(0,0,0,0.72), inset 0 0 24px rgba(138,43,226,0.24);
}

.share-modal .poster-title {
    font-size: 21px;
}

.share-modal .qr-container {
    border-color: rgba(191,160,255,0.42);
}

.share-modal .qr-text .highlight {
    color: #d4af37;
    font-size: 15px;
    text-shadow: 0 0 10px rgba(212,175,55,0.28);
}

.share-tip {
    margin: 16px auto 8px;
    max-width: 340px;
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(212,175,55,0.88);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(212,175,55,0.16);
}

.share-tip i {
    margin-right: 5px;
}

.share-actions {
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

.share-action-btn {
    flex: 1;
    min-width: 0;
    padding: 13px 0 !important;
    font-size: 15px !important;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .share-modal {
        width: min(94vw, 430px) !important;
        max-height: calc(100vh - 34px) !important;
        overflow-y: auto !important;
        padding: 28px 20px 24px !important;
        border-radius: 16px !important;
    }

    .share-modal .modal-close {
        top: 12px !important;
        right: 14px !important;
        font-size: 24px !important;
    }

    .share-title {
        margin: 4px 30px 6px !important;
        font-size: 25px !important;
    }

    .share-subtitle {
        max-width: 310px;
        font-size: 14px;
        margin-bottom: 14px;
    }

    .share-modal .share-poster {
        width: min(78vw, 292px) !important;
        height: auto !important;
        aspect-ratio: 2 / 3 !important;
    }

    .share-modal .poster-content {
        padding: 22px 18px !important;
    }

    .share-modal .qr-container {
        gap: 10px;
        padding: 9px;
    }

    .share-modal .qr-box {
        width: 82px;
        height: 82px;
    }

    .share-tip {
        max-width: 310px;
        margin-top: 14px;
        font-size: 12.5px;
    }

    .share-actions {
        gap: 10px;
        margin-top: 16px;
    }

    .share-action-btn {
        padding: 12px 0 !important;
        font-size: 14px !important;
    }
}

@media (max-width: 390px) {
    .share-modal {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .share-actions {
        flex-direction: column;
    }

    .share-action-btn {
        width: 100%;
    }
}

/* ================= 分享海报星盘新版：桌面 + 手机 ================= */
.share-poster {
    background-image: url('bg_poster_v6_20260709.jpg');
    background-position: center center;
}

.share-poster .poster-overlay {
    background: linear-gradient(
        to bottom,
        rgba(6, 3, 16, 0.02) 0%,
        rgba(8, 4, 18, 0.12) 45%,
        rgba(8, 4, 18, 0.78) 76%,
        rgba(5, 2, 12, 0.95) 100%
    );
}

.share-modal .share-poster {
    background-size: cover;
    background-position: center center;
}

.share-modal .poster-content {
    padding: 0 24px 25px !important;
}

.share-modal .poster-title {
    color: #f1cf68;
    font-size: 22px;
    line-height: 1.16;
    letter-spacing: 2.6px;
    margin-bottom: 7px;
    font-weight: 800;
    text-align: center;
    text-shadow:
        0 0 14px rgba(212, 175, 55, 0.42),
        0 3px 8px rgba(0, 0, 0, 0.82);
}

.share-modal .poster-subtitle {
    color: rgba(255, 255, 255, 0.86);
    font-size: 11.8px;
    line-height: 1.5;
    margin-bottom: 17px;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.82);
}

.share-modal .qr-container {
    gap: 14px;
    padding: 11px;
    background: rgba(4, 2, 11, 0.68);
    border-color: rgba(191, 160, 255, 0.48);
    box-shadow: inset 0 0 16px rgba(138, 43, 226, 0.14);
}

@media (max-width: 768px) {
    .share-modal .poster-content {
        padding: 0 20px 21px !important;
    }

    .share-modal .poster-title {
        font-size: clamp(19px, 5.2vw, 22px);
        letter-spacing: 2px;
        margin-bottom: 7px;
    }

    .share-modal .poster-subtitle {
        font-size: clamp(11.5px, 3.2vw, 12.5px);
        margin-bottom: 15px;
    }

    .share-modal .qr-container {
        gap: 10px;
        padding: 9px;
    }
}

@media (max-width: 390px) {
    .share-modal .poster-content {
        padding: 0 18px 19px !important;
    }

    .share-modal .poster-title {
        letter-spacing: 2px;
    }
}

/* ================= 分享海报 v5 最终质感匹配 ================= */
.share-modal .share-poster {
    background-size: cover;
    background-position: center center;
}

.share-modal .poster-title {
    font-family: STSong, SimSun, KaiTi, "Noto Serif SC", serif;
    color: #f2c85d;
    font-size: 24px;
    letter-spacing: 3px;
    font-weight: 800;
    margin-bottom: 7px;
    text-shadow:
        0 0 10px rgba(255, 217, 112, 0.34),
        0 2px 5px rgba(0, 0, 0, 0.92);
}

.share-modal .poster-subtitle {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    margin-bottom: 17px;
}

.share-modal .qr-container {
    background: rgba(5, 2, 12, 0.66);
    border-color: rgba(181, 126, 255, 0.5);
    box-shadow:
        inset 0 0 18px rgba(138, 43, 226, 0.16),
        0 0 12px rgba(138, 43, 226, 0.1);
}

@media (max-width: 768px) {
    .share-modal .poster-title {
        font-size: clamp(22px, 6.1vw, 24px);
        letter-spacing: 2.4px;
    }
}

/* ================= 分享海报 v7：100% 交付排版收束 ================= */
.share-title {
    font-size: 26px;
    margin-bottom: 5px;
}

.share-subtitle {
    font-size: 14.5px;
    margin-bottom: 16px;
}

.share-modal .poster-preview {
    margin-top: 14px;
}

.share-modal .poster-content {
    padding: 0 24px 30px !important;
}

.share-modal .poster-title {
    font-size: 22.5px;
    letter-spacing: 2.5px;
    margin-bottom: 8px;
    color: #f0c65a;
    text-shadow:
        0 0 9px rgba(255, 218, 116, 0.32),
        0 2px 5px rgba(0, 0, 0, 0.94);
}

.share-modal .poster-subtitle {
    font-size: 11.8px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.82);
}

.share-modal .qr-container {
    background: rgba(5, 2, 12, 0.58);
    border-color: rgba(181, 126, 255, 0.44);
    box-shadow:
        inset 0 0 15px rgba(138, 43, 226, 0.12),
        0 0 10px rgba(138, 43, 226, 0.08);
}

.share-tip {
    margin-top: 14px;
}

@media (max-width: 768px) {
    .share-title {
        font-size: 24px !important;
        margin-bottom: 5px !important;
    }

    .share-subtitle {
        font-size: 13.5px !important;
        margin-bottom: 13px !important;
    }

    .share-modal .poster-preview {
        margin-top: 13px !important;
    }

    .share-modal .poster-content {
        padding: 0 20px 25px !important;
    }

    .share-modal .poster-title {
        font-size: clamp(20.5px, 5.5vw, 22px) !important;
        letter-spacing: 2.1px !important;
        margin-bottom: 7px !important;
    }

    .share-modal .poster-subtitle {
        font-size: clamp(11px, 3vw, 11.8px) !important;
        margin-bottom: 15px !important;
    }
}

@media (max-width: 390px) {
    .share-modal .poster-content {
        padding: 0 19px 24px !important;
    }
}

/* ================= 充值支付跳转区：手机端适配 ================= */
@media (max-width: 768px) {
    #rechargeModal,
    #rechargeModal * {
        box-sizing: border-box !important;
    }
    #rechargeModal {
        overflow-x: hidden !important;
    }
    #rechargeModal .modal-content {
        width: calc(100vw - 20px) !important;
        max-width: 430px !important;
        max-height: calc(100vh - 32px) !important;
        padding: 34px 18px 24px !important;
        overflow-y: auto !important;
    }
    #rechargeModal .modal-content h2 {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }
    #rechargeModal .modal-content > p {
        font-size: 14px !important;
        line-height: 1.65 !important;
    }

    #rechargeModal .pricing-cards,
    #rechargeModal .payment-status-area,
    #rechargeModal .payment-status-content,
    #rechargeModal .payment-status-row,
    #rechargeModal .payment-go-btn {
        max-width: 100% !important;
    }
    #rechargeModal .price-card,
    #rechargeModal .payment-status-row,
    #rechargeModal .payment-go-btn {
        overflow-wrap: anywhere !important;
    }
    #rechargeModal .pricing-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        margin: 22px 0 18px !important;
    }
    #rechargeModal .price-card {
        min-width: 0 !important;
        min-height: 154px !important;
        padding: 20px 9px 16px !important;
        border-radius: 14px !important;
    }
    #rechargeModal .price-card h3 {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    #rechargeModal .price-card .price {
        font-size: 20px !important;
        line-height: 1.2 !important;
    }
    #rechargeModal .price-card .desc {
        font-size: 12px !important;
        line-height: 1.45 !important;
    }
    .payment-status-area {
        margin-top: 18px !important;
        padding-top: 18px !important;
    }
    .payment-status-content {
        width: 100% !important;
        gap: 12px !important;
    }
    .payment-status-row {
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 14px !important;
        gap: 12px !important;
    }
    .payment-status-row i {
        font-size: 24px !important;
        margin-top: 1px !important;
    }
    .payment-go-btn {
        width: 100% !important;
        min-height: 46px !important;
        padding: 0 18px !important;
        font-size: 15px !important;
    }
    .payment-status-note {
        max-width: 92% !important;
    }
}

@media (max-width: 390px) {
    #rechargeModal .pricing-cards {
        grid-template-columns: 1fr !important;
    }
    #rechargeModal .price-card {
        min-height: 128px !important;
    }
}

/* ================= 未完成推演恢复入口 ================= */
.active-job-entry {
    width: min(100%, 600px);
    margin: 0 auto 24px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.42);
    background: linear-gradient(135deg, rgba(32, 18, 50, 0.9), rgba(12, 8, 26, 0.92));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.10), inset 0 0 18px rgba(138, 43, 226, 0.08);
    text-align: left;
}
.active-job-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.72);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.18);
    font-size: 15px;
    font-weight: 700;
    flex: 0 0 auto;
}
.active-job-copy strong,
.active-job-recovery-banner strong {
    display: block;
    font-size: 15px;
    color: #fff;
    margin-bottom: 3px;
}
.active-job-copy span,
.active-job-recovery-banner span {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.68);
}
.active-job-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    box-shadow: 0 0 16px rgba(138, 43, 226, 0.28);
    white-space: nowrap;
    cursor: pointer;
}
.pending-intake-entry {
    width: min(100%, 600px);
    margin: -10px auto 24px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border-radius: 15px;
    border: 1px solid rgba(190, 132, 255, 0.46);
    background: linear-gradient(135deg, rgba(28, 18, 54, 0.92), rgba(10, 7, 24, 0.94));
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.14), inset 0 0 18px rgba(212, 175, 55, 0.06);
    text-align: left;
}
.pending-intake-mark {
    color: #d8b4ff;
    border-color: rgba(190, 132, 255, 0.72);
    box-shadow: 0 0 14px rgba(138, 43, 226, 0.28);
}
.pending-intake-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}
.pending-intake-cancel-btn,
.pending-intake-inline-cancel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 9px 14px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    cursor: pointer;
}
.pending-intake-inline-cancel {
    margin-left: auto;
}
.pending-intake-recovery-banner {
    border-color: rgba(190, 132, 255, 0.46);
}
.pending-intake-recovery-copy {
    min-width: 0;
}
.active-job-recovery-banner {
    width: min(100%, 860px);
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.42);
    background: linear-gradient(135deg, rgba(32, 18, 50, 0.9), rgba(12, 8, 26, 0.92));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.10), inset 0 0 18px rgba(138, 43, 226, 0.08);
    align-self: center;
}

@media (max-width: 768px) {
    .active-job-entry {
        grid-template-columns: auto 1fr;
        gap: 11px;
        padding: 13px;
        margin: 0 auto 20px;
    }
    .active-job-btn {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 40px;
    }
    .pending-intake-entry {
        grid-template-columns: auto 1fr;
        gap: 11px;
        padding: 13px;
        margin: -8px auto 20px;
    }
    .pending-intake-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .pending-intake-actions .active-job-btn,
    .pending-intake-cancel-btn {
        grid-column: auto;
        width: 100%;
        min-height: 40px;
    }
    .active-job-recovery-banner {
        align-items: flex-start;
        padding: 13px;
    }
    .pending-intake-recovery-banner {
        flex-wrap: wrap;
    }
    .pending-intake-inline-cancel {
        width: 100%;
        margin-left: 47px;
        min-height: 38px;
    }
}

/* ================= 分享海报二维码居中修复 ================= */
.share-modal .qr-container {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.share-modal .qr-box {
    width: 94px;
    height: 94px;
    padding: 7px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.share-modal .qr-box canvas,
.share-modal .qr-box img {
    width: 80px !important;
    height: 80px !important;
    display: block;
    margin: auto;
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .share-modal .qr-container {
        justify-content: center;
    }

    .share-modal .qr-box {
        width: 94px !important;
        height: 94px !important;
        padding: 7px !important;
    }
}

@media (max-width: 390px) {
    .share-modal .qr-box {
        width: 90px !important;
        height: 90px !important;
        padding: 5px !important;
    }
}

/* ================= 手机端分享得点：自动生成真实图片 ================= */
.generated-share-preview {
    margin-top: 14px;
}

.generated-share-image-shell {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background: rgba(0, 0, 0, 0.36);
    box-shadow: inset 0 0 18px rgba(138, 43, 226, 0.12);
}

.generated-share-image {
    display: block;
    width: min(78vw, 292px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 13px;
    border: 1px solid rgba(212, 175, 55, 0.52);
    -webkit-touch-callout: default;
    user-select: auto;
}

.share-modal.share-image-ready .poster-preview {
    display: none;
}

.share-modal.share-image-loading .share-tip {
    color: rgba(212, 175, 55, 0.86);
}

@media (min-width: 769px) {
    .generated-share-image {
        width: 292px;
    }
}

/* ================= 分享得点：桌面/手机按钮兼容 ================= */
.share-actions-mobile {
    display: none;
}

.share-actions-desktop {
    display: flex;
}

@media (max-width: 768px) {
    .share-actions-mobile {
        display: flex;
    }

    .share-actions-desktop {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .share-actions-mobile {
        display: none !important;
    }

    .share-actions-desktop {
        display: flex !important;
    }
}

/* ================= 登录/表单自动填充底色修复 ================= */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
    border: 1px solid rgba(138, 43, 226, 0.3) !important;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5) inset !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5) inset !important;
    transition: background-color 9999s ease-out 0s !important;
}

#authModal input:-webkit-autofill,
#authModal input:-webkit-autofill:hover,
#authModal input:-webkit-autofill:focus,
#authModal input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5) inset !important;
    -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5) inset !important;
}

@media (max-width: 390px) {
    .email-code-row {
        grid-template-columns: 1fr;
    }
    .email-code-btn {
        min-height: 44px;
    }
}

