:root{
    --sidebar-width: 320px;
    --header-height: 64px;
    --navbar-height: 48px;
    --bg: #f5f6f7;
    --panel-bg: #ffffff;
    --muted: #f56c6c;
    --accent: #ff7a00;
    --border-color: #e5e7ea;
}

/* 新增导航栏样式 */
.navbar {
    display: flex;
    flex-wrap: wrap; /* 关键属性：允许换行 */
    gap: 8px; /* 项目间距 */
    padding: 12px 16px;
    background: #f5f7fa;
    border-bottom: 1px solid #e1e5eb;
    overflow-x: auto; /* 水平滚动作为备用方案 */
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
}

.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布局 */
.main {
    /* 你原有的main样式保持不变 */
    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;
}
/* header */
.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 .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-title {
    font-size: 13px;
}
.official-account-div{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    right: 22px;
    text-align: right;
}


/* center canvas area */
.canvas-wrap {
    position: relative;  /* 添加这行，为pdf-controls提供定位上下文 */
    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;
}
.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样式 */
.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: #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: 500px; /* 设置最小高度 */
    #display: flex;
    #justify-content: center;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e0e0e0;
}

.pdf-canvas-container {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

#pdf-render {
    max-width: 100%;
    background-color: white;
}

.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-controls {
    position: absolute;  /* 从fixed改为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-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); /* 放置在问号上方，增加一点间距，防止紧贴 */
    /*left: 50%;*/
    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;
}