/* ============================================================
   批注系统样式 (index.html 交互层)
   依赖 annotations.js。卡片 .ann-card 可作为 flex 项插在两个手机画框之间。
   ============================================================ */

/* ---- 批注卡片 ---- */
.ann-card {
    --ann-bg: #FFD25A;
    --ann-fg: #2a2310;
    position: relative;               /* 占位式：在右侧轨道内按文档流排布，不再 absolute 浮动 */
    width: 220px;
    flex: 0 0 auto;
    padding: 16px 14px 18px;
    background: var(--ann-bg);
    color: var(--ann-fg);
    font-size: 14px;
    line-height: 1.5;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.40);
}
/* 右侧占位轨道：批注在此纵向堆叠，撑开画框右侧布局（无批注时由 JS 不创建，布局即不变） */
.ann-rail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 8px;
}
.ann-card.ann-dragging { cursor: grabbing; z-index: 30; user-select: none; }
.ann-card .ann-title {
    cursor: text;
    font-size: 15px; font-weight: 700; margin-bottom: 8px;
    outline: none; border-radius: 4px; padding: 1px 2px;
}
.ann-card .ann-text {
    cursor: text;
    white-space: pre-wrap; word-break: break-word;
    outline: none; border-radius: 4px; padding: 1px 2px;
}
.ann-card .ann-title:focus,
.ann-card .ann-text:focus { background: rgba(0,0,0,0.08); }
.ann-card .ann-hint {
    margin-top: 6px; font-size: 12px; color: rgba(42,35,16,0.55);
}
/* 悬浮工具：删除 / 换色 */
.ann-card .ann-tools {
    position: absolute; top: 6px; right: 6px;
    display: flex; gap: 4px;
    opacity: 0; transition: opacity .15s;
}
.ann-card:hover .ann-tools { opacity: 1; }
.ann-card .ann-tools button {
    width: 22px; height: 22px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(20,20,26,0.85); color: #fff;
    border: none; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1;
}
.ann-card .ann-tools button:hover { background: #14141a; }
.ann-card .ann-tools button.del:hover { background: #e23b3b; }

/* ---- 右键菜单 ---- */
.ann-ctx {
    position: fixed; z-index: 9999;
    min-width: 168px;
    padding: 6px;
    background: #1c1c22; color: #fff;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.55);
    font-size: 13px;
}
.ann-ctx button {
    display: flex; width: 100%; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: none; border: none; color: #d6d6db;
    border-radius: 6px; cursor: pointer; text-align: left; font: inherit;
}
.ann-ctx button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ann-ctx button.danger:hover { background: rgba(226,59,59,0.18); color: #ff8e8e; }
.ann-ctx hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 4px 0; }
.ann-ctx .ann-ctx-ico { width: 16px; text-align: center; opacity: .9; }

/* ---- 顶部工具栏 ---- */
.ann-bar {
    position: fixed; top: 16px; right: 16px; z-index: 9998;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    background: rgba(20,20,26,0.92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: #cfcfd6; font-size: 12px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.45);
}
.ann-bar .ann-dot { width: 8px; height: 8px; border-radius: 50%; background: #888; flex: 0 0 auto; }
.ann-bar .ann-dot.on { background: #3ad29f; }
.ann-bar .ann-dot.off { background: #e2a93b; }
.ann-bar button {
    background: none; border: 1px solid rgba(255,255,255,0.16);
    color: #d6d6db; padding: 5px 12px; border-radius: 999px;
    cursor: pointer; font-size: 12px;
}
.ann-bar button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ann-bar .ann-status { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 插入占位（插入瞬间的提示动画，可选） */
.ann-card.ann-new { animation: annPop .18s ease; }
@keyframes annPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
