/* ============================================================
   分享对话页 - 浅色简约风格
   配色与公共导航栏 (navbar.css) 保持一致
   ============================================================ */
:root {
    --s-bg: #f6f8fb;
    --s-surface: #ffffff;
    --s-surface-soft: #f8fafc;
    --s-line: #e5e9f0;
    --s-line-soft: #eef1f6;
    --s-text: #111827;
    --s-text-2: #374151;
    --s-muted: #6b7280;
    --s-primary: #2563eb;
    --s-primary-dark: #1d4ed8;
    --s-primary-soft: #eff4ff;
    --s-radius: 14px;
    --s-radius-sm: 10px;
    --s-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
    --s-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

[v-cloak] {
    display: none;
}

/* ---------- 页面骨架 ---------- */
.share-page {
    font-family: var(--s-font);
    min-height: 100vh;
    padding-top: 60px;
    background: var(--s-bg);
    color: var(--s-text);
}

.share-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

/* ---------- 头部 ---------- */
.share-header {
    margin-bottom: 16px;
    padding: 24px 26px;
    border: 1px solid var(--s-line);
    border-radius: var(--s-radius);
    background: var(--s-surface);
    box-shadow: var(--s-shadow);
}

.share-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 760;
    letter-spacing: -0.01em;
    color: var(--s-text);
}

.share-title i {
    color: var(--s-primary);
    font-size: 22px;
}

.share-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--s-muted);
    font-size: 13px;
}

.share-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- 内容区 ---------- */
.share-content {
    padding: 24px;
    border: 1px solid var(--s-line);
    border-radius: var(--s-radius);
    background: var(--s-surface);
    box-shadow: var(--s-shadow);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-item {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-item.user {
    flex-direction: row-reverse;
}

/* 头像 */
.message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.message-avatar.assistant {
    background: var(--s-primary-soft);
    color: var(--s-primary);
    border: 1px solid #d7e5ff;
}

.message-avatar.user {
    background: var(--s-primary);
    color: #fff;
}

.message-body {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    min-width: 0;
}

.message-item.assistant .message-body {
    max-width: calc(100% - 52px);
}

.message-content-wrapper {
    max-width: 100%;
}

/* 气泡 */
.message-bubble {
    position: relative;
    min-width: 0;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: var(--s-radius-sm);
    font-size: 15px;
    line-height: 1.65;
    word-wrap: break-word;
    font-family: var(--s-font);
}

.message-item.assistant .message-bubble {
    background: var(--s-surface);
    color: var(--s-text-2);
    border: 1px solid var(--s-line);
    border-top-left-radius: 4px;
}

.message-item.user .message-bubble {
    background: var(--s-primary-soft);
    color: #1e3a8a;
    border: 1px solid #d7e5ff;
    border-top-right-radius: 4px;
}

.message-bubble pre {
    margin: 10px 0;
    padding: 12px;
    max-width: 100%;
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 8px;
}

.message-bubble code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.message-bubble p {
    margin: 8px 0;
    line-height: 1.7;
}

.message-bubble p:first-child { margin-top: 0; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-bubble ul,
.message-bubble ol {
    margin: 10px 0;
    padding-left: 22px;
}

.message-bubble li {
    margin: 5px 0;
}

.message-bubble blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--s-primary);
    background: var(--s-primary-soft);
    border-radius: 0 8px 8px 0;
    color: var(--s-text-2);
}

.message-bubble table {
    display: block;
    width: 100%;
    margin: 10px 0;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.message-bubble th,
.message-bubble td {
    padding: 8px 12px;
    border: 1px solid var(--s-line);
    text-align: left;
    white-space: nowrap;
    min-width: 50px;
}

.message-bubble th {
    background: var(--s-surface-soft);
    font-weight: 600;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
    margin: 16px 0 10px;
    font-weight: 700;
    color: var(--s-text);
}

.message-bubble h1 {
    font-size: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--s-line);
}

.message-bubble h2 { font-size: 18px; }
.message-bubble h3 { font-size: 16px; }
.message-bubble h4 { font-size: 15px; }

.message-bubble a {
    color: var(--s-primary);
    text-decoration: none;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.message-bubble img {
    max-width: 100%;
    margin: 10px 0;
    border-radius: 8px;
}

/* 消息底部 */
.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.message-item.user .message-footer {
    justify-content: flex-end;
}

.message-time {
    font-size: 12px;
    color: var(--s-muted);
}

.model-badge,
.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.model-badge {
    background: var(--s-primary-soft);
    color: var(--s-primary);
    border: 1px solid #d7e5ff;
}

.feature-badge.deep-thinking {
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fde9cf;
}

.feature-badge.web-search {
    background: #ecfdf3;
    color: #15803d;
    border: 1px solid #cdf3dc;
}

.model-badge i,
.feature-badge i {
    font-size: 10px;
}

/* ---------- 错误状态 ---------- */
.error-container {
    padding: 56px 20px;
    text-align: center;
    border: 1px solid var(--s-line);
    border-radius: var(--s-radius);
    background: var(--s-surface);
    box-shadow: var(--s-shadow);
}

.error-icon {
    margin-bottom: 18px;
    font-size: 56px;
    color: #f59e0b;
}

.error-title {
    margin-bottom: 10px;
    font-size: 19px;
    font-weight: 700;
    color: var(--s-text);
}

.error-desc {
    margin-bottom: 22px;
    font-size: 14px;
    color: var(--s-muted);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--s-radius-sm);
    background: var(--s-primary);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 160ms ease;
}

.back-btn:hover {
    background: var(--s-primary-dark);
}

/* ---------- 页脚信息 ---------- */
.footer-info {
    padding: 28px 20px;
    text-align: center;
    color: var(--s-muted);
    font-size: 13px;
}

.footer-info a {
    color: var(--s-primary);
    text-decoration: none;
    font-weight: 600;
}

.ai-disclaimer-message {
    margin-top: 20px;
    padding: 14px 20px;
    text-align: center;
    color: var(--s-muted);
    font-size: 12px;
    border-top: 1px solid var(--s-line-soft);
}

/* ---------- 文件卡片 ---------- */
.message-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.message-file-item {
    display: flex;
    align-items: center;
}

.message-file-item.is-image {
    align-self: flex-start;
}

.message-image-preview {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--s-surface-soft);
}

.message-image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.message-image-preview:hover .message-image-thumb {
    transform: scale(1.05);
}

.message-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.3);
    color: #fff;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-image-preview:hover .message-image-overlay {
    opacity: 1;
}

.message-file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    padding: 10px 14px;
    border: 1px solid var(--s-line);
    border-radius: var(--s-radius-sm);
    background: var(--s-surface-soft);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.message-file-card:hover {
    border-color: #c7d7f5;
    background: var(--s-surface);
}

.message-file-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.message-file-card-icon.pdf { background: #ef4444; }
.message-file-card-icon.word { background: var(--s-primary); }
.message-file-card-icon.excel { background: #16a34a; }
.message-file-card-icon.ppt { background: #ea580c; }
.message-file-card-icon.image { background: #9333ea; }
.message-file-card-icon.text { background: #64748b; }

.message-file-card-info {
    flex: 1;
    min-width: 0;
    max-width: calc(280px - 48px - 14px - 36px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.message-file-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--s-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-file-card-type {
    font-size: 11px;
    color: var(--s-muted);
}

/* ---------- 图片预览弹窗 ---------- */
.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
}

.image-preview-content-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    padding: 20px;
}

.image-preview-content-wrapper > * {
    pointer-events: auto;
}

.image-preview-wrapper-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: calc(90vh - 80px);
}

.image-preview-wrapper-zoom .image-preview-large {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}

.image-preview-name {
    margin-top: 16px;
    max-width: 100%;
    color: #fff;
    font-size: 14px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-fade-enter-active,
.image-preview-fade-leave-active {
    transition: opacity 0.3s ease;
}

.image-preview-fade-enter,
.image-preview-fade-leave-to {
    opacity: 0;
}

.image-content-scale-enter-active {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-content-scale-leave-active {
    transition: all 0.2s ease;
}

.image-content-scale-enter,
.image-content-scale-leave-to {
    opacity: 0;
    transform: scale(0.8);
}

.image-info-fade-enter-active {
    transition: all 0.3s ease 0.1s;
}

.image-info-fade-leave-active {
    transition: all 0.2s ease;
}

.image-info-fade-enter,
.image-info-fade-leave-to {
    opacity: 0;
    transform: translateY(10px);
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.image-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.image-nav-prev { left: 20px; }
.image-nav-next { right: 20px; }

.image-nav-btn i {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.image-preview-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

/* ---------- 代码块 ---------- */
.code-block-wrapper {
    margin: 12px 0;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #30363d;
    border-radius: 8px;
    background: #0d1117;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    color: #7d8590;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-code-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #21262d;
    color: #c9d1d9;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.copy-code-btn:hover {
    background: #30363d;
    border-color: #8b949e;
}

.copy-code-btn.copied {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

.copy-code-btn i {
    font-size: 13px;
}

.code-block {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: #0d1117;
}

.code-block code {
    padding: 0;
    background: transparent;
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', monospace;
}

.message-bubble .hljs {
    background: transparent !important;
    padding: 0 !important;
}

.hljs {
    display: block;
    overflow-x: auto;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 13px;
    line-height: 1.5;
}

/* ---------- 思考过程 ---------- */
.thinking-section {
    margin-bottom: 8px;
    border: 1px solid #d7e5ff;
    border-radius: var(--s-radius-sm);
    background: var(--s-primary-soft);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.thinking-section:hover {
    border-color: #b9d0ff;
}

.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.thinking-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.thinking-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thinking-icon {
    color: var(--s-primary);
    font-size: 14px;
}

.thinking-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--s-primary-dark);
}

.thinking-duration {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--s-primary);
    font-size: 11px;
}

.thinking-toggle-icon {
    font-size: 12px;
    color: var(--s-primary);
    transition: transform 0.3s ease;
}

.thinking-section:not(.collapsed) .thinking-toggle-icon {
    transform: rotate(90deg);
}

.thinking-body {
    padding: 12px 14px 12px 18px;
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid #d7e5ff;
}

.thinking-body::-webkit-scrollbar {
    width: 4px;
}

.thinking-body::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.2);
    border-radius: 2px;
}

.thinking-body-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--s-muted);
}

.thinking-body-content p {
    margin: 0 0 6px 0;
}

.thinking-body-content p:last-child {
    margin-bottom: 0;
}

.thinking-section.collapsed .thinking-body {
    display: none;
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--s-primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease, background 0.2s ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--s-primary-dark);
    transform: translateY(-3px);
}

.back-to-top i {
    font-size: 20px;
    color: #fff;
}

/* ---------- 博客按钮 ---------- */
.navbar-btn-blog {
    color: var(--s-primary) !important;
    border-color: #d7e5ff;
    background: var(--s-primary-soft);
}

.navbar-btn-blog:hover {
    color: #fff !important;
    border-color: var(--s-primary);
    background: var(--s-primary);
}

.navbar-btn-blog:hover i {
    color: #fff;
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 768px) {
    .share-container {
        padding: 20px 14px 36px;
    }

    .share-header {
        padding: 18px 18px;
    }

    .share-title {
        font-size: 18px;
    }

    .share-meta {
        gap: 12px;
        font-size: 12px;
    }

    .share-content {
        padding: 16px;
    }

    .message-body {
        max-width: 90%;
    }

    .message-item.assistant .message-body {
        max-width: calc(100% - 48px);
    }

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

    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .message-image-preview {
        width: 150px;
        height: 150px;
    }

    .message-file-card {
        max-width: 100%;
    }

    .message-file-card-info {
        max-width: calc(100% - 40px - 14px - 28px);
    }

    .image-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .image-nav-prev { left: 10px; }
    .image-nav-next { right: 10px; }

    .error-container {
        padding: 40px 16px;
    }

    .error-icon {
        font-size: 46px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}
</content>
