/* ===== 简川综合漫研社 · 官网公共样式 =====
 *
 * 放在这里的是「四个页面都需要」的修正，避免每页各写一份。
 */

/* ---------- 1. 修复渐变失效 ----------
 * 页面里用了 Tailwind 的 from-primary / to-secondary，
 * 但 primary / secondary 只在 :root 里定义成了普通 CSS 变量，
 * Tailwind（CDN 版）不认识它们，所以 .bg-gradient-to-r 拿不到色标 ——
 * 结果是白底 + text-white，标题几乎看不见。
 * 这里直接补上真正的渐变。 */
.from-primary.to-secondary,
.bg-gradient-to-r.from-primary.to-secondary {
    background-image: linear-gradient(to right, #3b82f6, #ec4899);
}

/* 带透明度的写法（社娘征稿页头部用的 /90） */
.from-primary\/90.to-secondary\/90,
.bg-gradient-to-r.from-primary\/90.to-secondary\/90 {
    background-image: linear-gradient(to right, rgba(59, 130, 246, .9), rgba(236, 72, 153, .9));
}

/* ---------- 2. 移动端菜单默认隐藏 ----------
 * 原本这条写在 @media (max-width:768px) 里面，
 * 桌面端没有匹配规则，菜单会一直显示在页面上。 */
.mobile-menu {
    display: none;
}
.mobile-menu.active {
    display: flex;
}

/* ---------- 3. 导航里的主导航项在窄屏下不要换行挤成一团 ---------- */
@media (max-width: 900px) {
    .nav-link {
        white-space: nowrap;
    }
}

/* ================= 可视化编辑（只有管理员会看到） ================= */

/* 编辑入口按钮：左下角，避开右下角的社娘聊天挂件 */
#jc-edit-launcher {
    position: fixed; left: 18px; bottom: 22px; z-index: 9998;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 11px 18px; border: none; border-radius: 99px;
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    color: #fff; font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; box-shadow: 0 8px 22px rgba(99, 102, 241, .35);
    transition: transform .16s, box-shadow .16s;
    touch-action: manipulation;
}
#jc-edit-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(99, 102, 241, .45); }
#jc-edit-launcher.on { background: linear-gradient(135deg, #f472b6, #ec4899); }

/* 编辑模式顶部提示条 */
#jc-edit-bar {
    position: fixed; left: 0; top: 0; width: 100%; z-index: 9997;
    display: none; align-items: center; gap: 10px;
    padding: 9px 18px; font-size: 13.5px; color: #fff;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    box-shadow: 0 3px 14px rgba(99, 102, 241, .3);
}
#jc-edit-bar.on { display: flex; }
#jc-edit-bar .dot {
    width: 8px; height: 8px; border-radius: 50%; background: #86efac;
    box-shadow: 0 0 0 0 rgba(134, 239, 172, .7);
    animation: jc-pulse 1.8s infinite;
}
@keyframes jc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(134, 239, 172, .7); }
    70%  { box-shadow: 0 0 0 9px rgba(134, 239, 172, 0); }
    100% { box-shadow: 0 0 0 0 rgba(134, 239, 172, 0); }
}
#jc-edit-bar .spacer { flex: 1; }
#jc-edit-bar .count { opacity: .85; font-size: 12.5px; }
#jc-edit-bar button {
    border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .14);
    color: #fff; padding: 5px 14px; border-radius: 99px;
    font-size: 13px; font-family: inherit; cursor: pointer;
}
#jc-edit-bar button:hover { background: rgba(255, 255, 255, .28); }

/* 编辑模式下：元素高亮 + 禁止误点链接 */
body.jc-editing { cursor: crosshair; }
body.jc-editing a, body.jc-editing button { cursor: crosshair !important; }
#jc-hover {
    position: absolute; z-index: 9990; display: none;
    border: 2px dashed #a855f7; border-radius: 5px;
    background: rgba(168, 85, 247, .09);
    pointer-events: none; transition: all .07s linear;
}

/* 编辑面板 */
#jc-edit-panel {
    position: absolute; z-index: 9999; width: 370px; max-width: calc(100vw - 24px);
    background: #fff; border: 1px solid #e6e2f0; border-radius: 15px;
    box-shadow: 0 18px 48px rgba(60, 40, 100, .22);
    display: none; overflow: hidden;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
}
#jc-edit-panel.on { display: block; animation: jc-pop .16s ease-out; }
@keyframes jc-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

#jc-edit-panel .jc-head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; background: #faf8fd; border-bottom: 1px solid #eee9f6;
}
#jc-edit-panel .jc-tag {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px; color: #7c3aed; background: #f3e8ff;
    padding: 2px 8px; border-radius: 6px;
}
#jc-edit-panel .jc-x {
    margin-left: auto; border: none; background: none; cursor: pointer;
    font-size: 15px; color: #9ca3af; padding: 2px 6px; border-radius: 6px;
}
#jc-edit-panel .jc-x:hover { background: #f3f0f9; color: #6b7280; }

#jc-edit-panel .jc-body { padding: 14px; }
#jc-edit-panel .jc-field { margin-bottom: 12px; }
#jc-edit-panel .jc-field:last-child { margin-bottom: 0; }
#jc-edit-panel label {
    display: block; font-size: 12px; color: #6b7280; margin-bottom: 6px;
}
#jc-edit-panel textarea,
#jc-edit-panel input[type="text"] {
    width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
    line-height: 1.6; color: #1f2937;
    border: 1px solid #e6e2f0; border-radius: 10px; background: #fdfcfe;
    resize: vertical;
}
#jc-edit-panel textarea:focus,
#jc-edit-panel input[type="text"]:focus {
    outline: none; border-color: #a78bfa; background: #fff;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, .16);
}
#jc-edit-panel .jc-img-btn {
    width: 100%; padding: 10px; border-radius: 10px; cursor: pointer;
    border: 1.5px dashed #c4b5fd; background: #faf8ff; color: #7c3aed;
    font-size: 13.5px; font-family: inherit;
}
#jc-edit-panel .jc-img-btn:hover { background: #f3eeff; }
#jc-edit-panel .jc-img-hint { font-size: 12px; color: #9ca3af; margin-top: 6px; word-break: break-all; }

#jc-edit-panel .jc-msg { font-size: 12.5px; min-height: 17px; }
#jc-edit-panel .jc-msg.ok { color: #16a34a; }
#jc-edit-panel .jc-msg.err { color: #dc2626; }

#jc-edit-panel .jc-foot {
    display: flex; gap: 8px; padding: 12px 14px;
    background: #faf8fd; border-top: 1px solid #eee9f6;
}
#jc-edit-panel .jc-btn {
    flex: 1; padding: 9px 12px; border-radius: 9px; cursor: pointer;
    font-size: 13.5px; font-family: inherit;
    border: 1px solid #e6e2f0; background: #fff; color: #4b5563;
    transition: all .15s;
}
#jc-edit-panel .jc-btn:hover { background: #f7f4fc; }
#jc-edit-panel .jc-btn.primary {
    border-color: transparent; color: #fff; font-weight: 600;
    background: linear-gradient(135deg, #a78bfa, #6366f1);
}
#jc-edit-panel .jc-btn.primary:hover { filter: brightness(1.06); }

@media (max-width: 640px) {
    #jc-edit-launcher { left: 12px; bottom: 14px; padding: 10px 14px; font-size: 13px; }
    #jc-edit-launcher .txt { display: none; }
    #jc-edit-bar { font-size: 12.5px; padding: 8px 12px; }
    #jc-edit-bar .count { display: none; }
    #jc-edit-panel { width: auto; left: 12px !important; right: 12px; }
}

