:root {
    /* 侧边栏宽度 */
    --sidebar-width: 320px;
    /* 顶部导航高度 */
    --header-height: 64px;
    /* 二级导航高度 */
    --navbar-height: 48px;
    /* 全局背景色 */
    --bg: #f5f6f7;
    /* 面板背景色 */
    --panel-bg: #ffffff;
    /* 警示/静默颜色 */
    --muted: #226E93;
    /* 品牌主题色（橙色） */
    --accent: #226E93;
    /* 边框颜色 */
    --border-color: #e5e7ea;
}

/* 顶部二级导航栏：存放各种盒型分类 */
.navbar {
    display: flex;
    flex-wrap: wrap; /* 允许在小屏幕下换行 */
    gap: 8px;
    padding: 12px 16px;
    /*background: #f5f7fa;*/
    background: #fff;
    /*border-bottom: 1px solid #e1e5eb;*/
    overflow-x: auto; /* 超出时允许水平滚动 */
    -webkit-overflow-scrolling: touch; /* 优化移动端滚动体验 */
    margin-top: 70px;
}

/* 导航栏滚动条美化 */
.navbar::-webkit-scrollbar { height: 4px; }
.navbar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* 导航链接样式 */
.navbar .link {
    white-space: nowrap; /* 禁止文字换行 */
    padding: 8px 12px;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.navbar .link:hover { background: #f0f0f0; }
.navbar .link.selected { background: var(--accent); color: white; }

/* 主体内容布局 */
.main {
    position: relative;
    background-color: #fff;
    display: flex;
    flex: 1;
    gap: 20px;
    padding: 18px;
    box-sizing: border-box;
    overflow: hidden;
    /* 动态计算高度：全屏减去头部和导航栏高度 */
    height: calc(100vh - var(--header-height) - var(--navbar-height) - 36px);
}

html,body{
    height:100%;
    margin:0;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: var(--bg);
    color:#222;
}
.app{
    display:flex;
    flex-direction:column;
    height:100vh;
}

/* 顶部 Logo 栏 */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.logo{
    display:flex;
    align-items:center;
    gap:12px;
    font-weight:600;
    color:#333;
}

/* Logo 图标渐变效果 */
.logo .icon{
    width:36px;
    height:36px;
    background:linear-gradient(135deg,#ff8c42,#ff5b7a);
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-weight:700;
    box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.header-right{
    margin-left:25px;
    display:flex;
    gap:8px;
    align-items:center;
}

/* 公众号区域样式 */
.official-account-div {
    display: flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    right: 22px;
}
.official-account-div img {
    width: 60px;
    height: 60px;
    padding: 4px;
}
.official-account-title { text-align: right; line-height: 1.5; }
.official-account-title div:first-child { font-size: 13px; font-weight: 600; color: #333; }
.official-account-title div:last-child { font-size: 11px; color: #8b95a0; }


/* PDF 预览核心区域 */
.canvas-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
/* PDF 渲染画布容器 */
.canvas{
    width:100%;
    max-width:1100px;
    height:75vh;
    background:linear-gradient(#fff,#fff);
    border:1px solid #e5e7ea;
    box-shadow:0 2px 8px rgba(0,0,0,0.03);
    position:relative;
    overflow:hidden;
}
/* PDF viewer container */
.pdf-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 右侧参数配置侧边栏 */
.sidebar {
    height: 95%;
    width: var(--sidebar-width);
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 内容过多时可滚动 */
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
.panel-section{
    margin-bottom:16px;
}
.panel-section h3{
    margin:0 0 8px 0;
    font-size:13px;color:#666;
}

/* 表单行样式 */
.form-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin:8px 0;
}
.form-row label{color:#444;font-size:13px;flex:0 0 110px;}
.form-row input{
    flex: 0 0 60%; /* 固定为父容器的 60%（注意父容器布局） */
    width: 60%;
    box-sizing: border-box;
    padding: 6px 8px;
    border:1px solid #e1e6ea;
    border-radius:4px;
    background:#fafafa;
    font-size:13px;
}
.form-row select{
      flex: 0 0 60%; /* 固定为父容器的 60%（注意父容器布局） */
      width: 60%;
      box-sizing: border-box;
      padding: 5px 8px;
      border:1px solid #e1e6ea;
      border-radius:4px;
      background:#fafafa;
      font-size:13px;
  }
.checkbox-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin:8px 0;
    color:#666;
}
.pro-badge{
    background:#f3f5f7;color:#b45ef7;padding:2px 6px;border-radius:12px;font-size:12px;margin-left:6px;
}

/* 调整actions的位置 */
.sidebar .actions {
    margin-top: auto; /* 关键属性 - 将按钮推到底部 */
    padding-top: 12px;
    position: sticky;
    bottom: 0;
    z-index: 2;
}
.btn{
    border:0;padding:10px 14px;border-radius:6px;font-weight:600;cursor:pointer;
    box-shadow:0 1px 2px rgba(0,0,0,0.04);
}
.actions.url a.btn.primary {
    text-decoration: none;
    font-size: 12px;
}
.btn.primary{background:var(--accent);color:#fff;}
.btn.ghost{background:#fff;border:1px solid #e6e6e6;color:#333;}

/* footer small controls in canvas */
.canvas .bottom-controls{
    position:absolute;right:20px;bottom:14px;display:flex;gap:8px;align-items:center;
}
.muted{
    color:var(--muted);
    font-size:12px;
    font-weight:bold;
    /*border: 1px var(--muted) solid;*/
    border-radius: 5px;
    padding: 10px;
    background-color: #ebeff3;
    /*background-color: #fde2e2;*/
    /* 垂直居中方案 */
    display: flex;
    align-items: center;
}

/* small responsive tweaks */
/* 响应式调整 */
@media (max-width: 768px) {
    .navbar {
        padding: 8px 12px;
        gap: 6px;
    }
    .navbar .link {
        padding: 6px 10px;
        font-size: 13px;
    }
}

.canvas-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pdf-viewer-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0; /* 移除之前的 500px 限制，防止撑开页面 */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    overflow: hidden;
}

/* 修改 PDF 预览容器相关样式 */
.pdf-canvas-container {
    /*width: 100%;*/
    height: 100%;
    overflow: hidden; /* 关键：强制隐藏内部滚动条 */
    padding: 10px;    /* 留出一点边距防止贴边 */
    box-sizing: border-box;
    display: flex;    /* 使用 flex 让 Canvas 居中 */
    align-items: center;
    justify-content: center;
}

#pdf-render {
    /* 移除 max-width: 100%，由 JS 精确控制宽高 */
    background-color: white;
    transform: translateZ(0);
    /* 缩放动画设为 linear 或较短时间，避免渲染时的视觉延迟感 */
    transition: width 0.05s linear, height 0.05s linear;
    will-change: width, height;
}

/* 加载动画 */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* PDF 悬浮控制条（缩放） */
.pdf-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.pdf-controls button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pdf-controls button:hover {
    background-color: #f0f0f0;
}

#scale-value, #page-info {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}
.hidden{
    display: none;
}
.think-annotate{
    font-size: 12px;
    padding-left: 118px;
    color: red;
}
.base-annotate{
    padding-left: 67px;
    font-size: 12px;
    color: red;
}

.tooltip-trigger {
    position: relative; /* 为提示文本提供定位参考 */
    display: inline-block;
    cursor: pointer;
    vertical-align: middle; /* 使问号与文字对齐 */
    /* 确保父级容器没有 overflow: hidden; */
}

.tooltip-icon {
    font-weight: bold;
    color: #fff; /* 问号颜色改为白色 */
    font-size: 12px; /* 调整问号大小 */
    width: 18px; /* 设置圆形背景的宽度 */
    height: 18px; /* 设置圆形背景的高度 */
    background-color: #333; /* 黑色圆形背景 */
    border-radius: 50%; /* 使背景变为圆形 */
    display: inline-flex; /* 使用 flexbox 居中问号 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    margin-left: 5px; /* 问号与文字的间距 */
}

/* 提示语工具气泡 (Tooltip) */
.tooltip-text {
    visibility: hidden; /* 默认隐藏提示文本 */
    width: auto; /* 宽度自适应内容 */
    min-width: 100px; /* 确保最小宽度，防止内容过少时太窄 */
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px; /* 增加左右内边距，让文字不顶边 */
    position: absolute;
    z-index: 1000; /* 提高 z-index 值，确保在其他元素之上 */
    bottom: calc(100% + 8px); /* 放置在问号上方，增加一点间距，防止紧贴 */
    transform: translateX(-50%); /* 使用 transform 居中，比 margin-left 更灵活 */
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease; /* 添加 visibility 过渡 */
    white-space: nowrap; /* 防止文本换行 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* 添加阴影，增加立体感 */
}
.tooltip-trigger:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.show-on-load .tooltip-text{
    visibility: visible;
    opacity: 1;
}

/* 二维码悬浮 start */
.sidebar-qr {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.sidebar-qr img {
    /* 控制图片大小 */
    width: 120px;
    height: 140px;
    display: block;
}
.sidebar-douyin-qr {
    position: absolute;
    right: 393px;
    bottom: 95px;
    z-index: 9999;
    background-color: #fff;
    padding: 10px;
    height: 80%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.sidebar-douyin-qr img {
    /* 控制图片大小 */
    /*width: 120px;*/
    /*height: 550px;*/
    /*height: 60vh;*/
    height: 100%;
    display: block;
}
/* 二维码悬浮 end */


/* 优化错误消息样式 */
.error-message {
    /* 初始隐藏 */
    display: none;
    /* 使用 flex 垂直居中内部文字和图标 */
    flex-direction: column;
    align-items: center;
    justify-content: center;

    /* 视觉样式 */
    padding: 24px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    color: #c53030;
    font-size: 15px;
    line-height: 1.6;

    /* 确保在容器内自适应 */
    max-width: 80%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

/* 添加警告图标 */
.error-message::before {
    content: "!";
    width: 32px;
    height: 32px;
    background: #f56c6c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 12px;
}

/* 登录样式 start */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-content { background: #fff; padding: 25px 20px; border-radius: 8px; width: 320px; text-align: center; position: relative; }
.modal-header { font-weight: bold; margin-bottom: 20px; display: flex; justify-content: space-between; }
.close-btn { cursor: pointer; color: #999; font-size: 18px }
.form-group { margin-bottom: 15px; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.verify-code-wrap { display: flex; gap: 10px; }
#send-code-btn { white-space: nowrap; padding: 0 10px; background: #ff5b7a; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.submit-btn { width: 100%; padding: 10px; background: #ff5b7a; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; }
.tips { color: #8b95a0; font-size: 12px; margin-top: 10px; }
.wechat-qrcode-loading{height: 180px;}
.loading-text{
    padding-top: 70px
}
.retrieve-again-qrcode{cursor: pointer;color: #3498db}
/* 登录样式 end */

/* 弹窗容器 start */
/* 基础容器（同上） */
.custom-alert {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s, top 0.3s;
}

/* 成功状态 */
.alert-success {
    border-left: 5px solid #07c160; /* 微信绿 */
}
.alert-success .alert-icon { color: #07c160; }

/* 错误状态 */
.alert-error {
    border-left: 5px solid #fa5151; /* 微信错误红 */
    animation: shake 0.4s ease-in-out; /* 增加抖动效果 */
}
.alert-error .alert-icon { color: #fa5151; }

/* 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(-55%); }
    75% { transform: translateX(-45%); }
}

/* 图标和文字 */
.alert-icon { margin-right: 12px; font-weight: bold; font-size: 18px; }
.alert-message { color: #333; font-size: 14px; }
.alert-hidden { opacity: 0; top: -50px; }
/* 弹窗容器 end */
@media (max-width: 1300px) {
    .sidebar-qr img {/
        width: 100px;
        height: 120px;
        display: block;
    }
    .sidebar-douyin-qr{
        height: 60%;
    }
    .sidebar-douyin-qr img {
        /* 控制图片大小 */
        /*width: 120px;*/
        height: 100%;
        /*display: block;*/
    }
}
@media (max-width: 1080px) {
    .sidebar-qr img {
        width: 80px;
        height: 100px;
        display: block;
    }
}
/* 针对手机端（屏幕宽度小于 768px）的样式调整 */
@media (max-width: 768px) {
    .main {
        flex-direction: column; /* 核心修改：由左右排列改为上下排列 */
        height: auto;           /* 允许高度根据内容自动撑开 */
        overflow-y: auto;       /* 允许主体区域纵向滚动 */
        padding: 10px;          /* 缩小边距适应手机屏 */
    }

    .canvas-wrap {
        width: 100%;            /* 预览区宽度占满 */
        height: 300px;          /* 固定手机端预览区高度，防止太长 */
        flex: none;             /* 禁用 flex 伸缩 */
    }

    #container {
        width: 100%;            /* 参数区宽度占满 */
        flex: none;             /* 禁用 flex 伸缩 */
    }

    /* 如果 sidebar 内部有固定宽度，也需要调整 */
    .sidebar {
        width: 100%;
        box-sizing: border-box;
        height: auto;           /* 参数区高度随内容变化 */
        overflow-y: visible;    /* 靠外层 .main 滚动，此处可设为可见 */
    }
    .sidebar-qr{
        display: none;
    }
    .sidebar-douyin-qr{
        display: none;
    }
}
@media (max-width: 768px) {
    /* 1. 压缩导航栏，使其更紧凑 */
    .navbar {
        margin-top: 80px; /* 减小顶部间距 */
        padding: 3px 5px; /* 减小内边距 */
        gap: 4px; /* 减小按钮间距 */
        display: flex;
        flex-wrap: nowrap; /* 强制不换行，实现横向滑动 */
        overflow-x: auto; /* 开启横向滚动 */
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #eee;
        background: #fafafa;
    }

    /* 2. 缩小导航链接尺寸 */
    .navbar .link {
        font-size: 12px; /* 减小字体 */
        border-radius: 4px;
        flex: 0 0 auto; /* 防止被压缩变形 */
    }

    /* 3. 隐藏手机端冗余的说明文字（可选） */
    .header-right .muted {
        display: none; /* 手机端空间有限，隐藏“使用说明”文字 */
    }

    /* 4. 这里的 .main 逻辑保持之前的上下排列 */
    .main {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        padding: 10px;
    }

    .canvas-wrap {
        width: 100%;
        height: 350px; /* 给预览区固定一个合适的高度 */
        flex: none;
    }

    #container {
        width: 100%;
        flex: none;
    }

    .sidebar {
        width: 100%;
        padding: 10px;
    }
}
