/* ==========================================================================
   全站「方方正正」直角层（前台 + 后台共用）
   2026-11-27
   --------------------------------------------------------------------------
   目标：整站统一成方正的几何风格 —— 卡片、按钮、输入框、标签、分页、
   弹窗、下拉、表格、编辑器、附件面板、后台面板，圆角一律归零。
   深浅两套主题通用：本文件只改几何形状，不碰颜色。

   写法说明：
   - :not(#id):not(#id) 这个组合是"特异性抬升器"（永远匹配，因为页面里
     不存在这些 id），把选择器抬到 2 个 id 的级别。站点插件里有一堆
     `#header .jan-user-stat{...!important}`、`border-radius:12px!important`
     这类 1 个 id / 纯 class 的声明，普通覆盖压不住，只能靠它。
   - 只保留必须为圆的控件：单选框（和复选框区分）、加载转圈。
     头像、标签、开关、悬浮按钮全部一起方正，避免"一半圆一半方"。
   ========================================================================== */

html body :not(#mjj-square-guard):not(#mjj-square-guard2),
html body :not(#mjj-square-guard):not(#mjj-square-guard2) *,
html body :not(#mjj-square-guard):not(#mjj-square-guard2) *::before,
html body :not(#mjj-square-guard):not(#mjj-square-guard2) *::after {
    border-radius: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* 必须保持圆形：单选按钮、加载动画（方形的转圈会看着像卡死） */
html body :not(#mjj-square-guard):not(#mjj-square-guard2) input[type="radio"],
html body :not(#mjj-square-guard):not(#mjj-square-guard2) input[type="radio"].form-check-input,
html body :not(#mjj-square-guard):not(#mjj-square-guard2) .form-check-input[type="radio"],
html body :not(#mjj-square-guard):not(#mjj-square-guard2) .spinner-border,
html body :not(#mjj-square-guard):not(#mjj-square-guard2) .spinner-grow {
    border-radius: 50% !important;
}

/* 悬浮球：方形之后改用方形投影，避免残留圆形光晕 */
html body :not(#mjj-square-guard):not(#mjj-square-guard2) .mjj-scroll-btn {
    box-shadow: 0 6px 16px rgba(15, 23, 42, .18) !important;
}

html[data-theme="dark"] body :not(#mjj-square-guard):not(#mjj-square-guard2) .mjj-scroll-btn {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .46) !important;
}

/* --------------------------------------------------------------------------
   深色主按钮取色：后台与前台统一
   站点品牌色换成了青蓝 #1294d7（深色 #3aa0e0），白字压在上面只有 2.3 的
   对比度，按钮看着发飘。这里统一压到和前台右栏主按钮同一档（浅 #0f7fb8 /
   深 #1d6fb8），前后台观感一致，白字对比 4.4+/4.6+。
   -------------------------------------------------------------------------- */
html[data-theme="dark"] body :not(#mjj-square-guard):not(#mjj-square-guard2) .btn-primary {
    background-color: #1d6fb8 !important;
    background-image: none !important;
    border-color: #1d6fb8 !important;
    color: #fff !important;
}

html[data-theme="dark"] body :not(#mjj-square-guard):not(#mjj-square-guard2) .btn-primary:hover,
html[data-theme="dark"] body :not(#mjj-square-guard):not(#mjj-square-guard2) .btn-primary:focus-visible,
html[data-theme="dark"] body :not(#mjj-square-guard):not(#mjj-square-guard2) .btn-primary:active {
    background-color: #2580cc !important;
    background-image: none !important;
    border-color: #2580cc !important;
    color: #fff !important;
}
