/* =============================================
   逆糖大学 访问控制 - 管理端 + 前端样式
   主色: #28544d
   版本: 1.1.0 - 全站总开关 + 分类开关
   ============================================= */

/* ---------- 管理后台 - 设置页面 ---------- */
.ntdx-wrap {
    max-width: 900px;
    margin: 20px auto;
}
.ntdx-page-title {
    font-size: 24px;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #28544d;
}
.ntdx-card {
    background: #FFFFFF;
    border: 1px solid #E6ECEA;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ntdx-card-title {
    font-size: 18px;
    color: #28544d;
    margin: 0 0 5px 0;
    padding: 0;
}
.ntdx-card-desc {
    color: #374151;
    font-size: 14px;
    margin: 0 0 20px 0;
}
.ntdx-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.ntdx-table th {
    background: #F5F7F7;
    color: #111827;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #E6ECEA;
    font-size: 13px;
}
.ntdx-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E6ECEA;
    vertical-align: middle;
}
.ntdx-table tr:hover {
    background: #F5F7F7;
}
.ntdx-input {
    padding: 8px 12px;
    border: 1px solid #E6ECEA;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.2s;
}
.ntdx-input:focus {
    outline: none;
    border-color: #28544d;
    box-shadow: 0 0 0 2px rgba(40,84,77,0.15);
}
.ntdx-btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: #28544d;
    color: #F9FAFB !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.ntdx-btn-primary:hover {
    background: #1f3f3a;
}
.ntdx-btn-success {
    display: inline-block;
    padding: 10px 24px;
    background: #1F7A5A;
    color: #F9FAFB !important;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.ntdx-btn-success:hover {
    background: #186a4d;
}
.ntdx-btn-danger {
    display: inline-block;
    padding: 5px 14px;
    background: #B91C1C;
    color: #F9FAFB !important;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.ntdx-btn-danger:hover {
    background: #991b1b;
}
.ntdx-help p {
    color: #374151;
    font-size: 14px;
    line-height: 1.8;
    margin: 2px 0;
}

/* ---------- 管理后台 - 文章/页面侧边栏 ---------- */
.ntdx-meta-box {
    padding: 5px 0;
}
.ntdx-meta-hint {
    color: #374151;
    font-size: 12px;
    margin: 0 0 12px 0;
    line-height: 1.6;
}
.ntdx-checkbox-label {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 3px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.ntdx-checkbox-label:hover {
    background: #F5F7F7;
}
.ntdx-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #28544d;
    width: 16px;
    height: 16px;
}
.ntdx-checkbox-text {
    font-size: 13px;
    color: #111827;
}
.ntdx-meta-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}
.ntdx-meta-status-restricted {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}
.ntdx-meta-status-public {
    background: #F0FDF4;
    color: #1F7A5A;
    border: 1px solid #BBF7D0;
}

/* ---------- 管理后台 - 用户编辑页面 ---------- */
.ntdx-user-section {
    margin: 30px 0;
    padding: 25px;
    background: #FFFFFF;
    border: 1px solid #E6ECEA;
    border-radius: 8px;
}
.ntdx-section-title {
    font-size: 20px;
    color: #28544d;
    margin: 0 0 5px 0;
}
.ntdx-section-desc {
    color: #374151;
    font-size: 14px;
    margin: 0 0 15px 0;
}
.ntdx-user-checkbox {
    display: inline-block;
    margin: 4px 8px 4px 0;
    cursor: pointer;
}
.ntdx-user-checkbox input[type="checkbox"] {
    display: none;
}
.ntdx-tag {
    display: inline-block;
    padding: 6px 16px;
    border: 2px solid #E6ECEA;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    background: #F5F7F7;
    transition: all 0.2s;
    user-select: none;
}
.ntdx-user-checkbox input[type="checkbox"]:checked + .ntdx-tag,
.ntdx-tag-active {
    background: #28544d;
    color: #F9FAFB;
    border-color: #28544d;
}
.ntdx-tag:hover {
    border-color: #28544d;
}
.ntdx-user-summary {
    margin-top: 12px;
    font-size: 13px;
    color: #1F7A5A;
}

/* ---------- 管理后台 - 用户列表标签 ---------- */
.ntdx-list-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #28544d;
    color: #F9FAFB;
    border-radius: 12px;
    font-size: 11px;
    margin: 1px 2px;
    white-space: nowrap;
}

/* ---------- 前台 - 受限提示页面 ---------- */
.ntdx-restricted-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
    background: #F5F7F7;
}
.ntdx-restricted-card {
    background: #FFFFFF;
    border: 1px solid #E6ECEA;
    border-radius: 12px;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ntdx-restricted-icon {
    font-size: 60px;
    margin-bottom: 20px;
}
.ntdx-restricted-title {
    font-size: 24px;
    color: #111827;
    margin: 0 0 15px 0;
}
.ntdx-restricted-text {
    font-size: 15px;
    color: #374151;
    line-height: 1.7;
    margin: 0 0 10px 0;
}
.ntdx-restricted-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}
.ntdx-restricted-tag {
    display: inline-block;
    padding: 6px 18px;
    background: #F5F7F7;
    border: 1px solid #E6ECEA;
    border-radius: 20px;
    font-size: 13px;
    color: #28544d;
    font-weight: 600;
}
.ntdx-restricted-btn {
    display: inline-block;
    margin-top: 25px;
    padding: 12px 36px;
    background: #28544d;
    color: #F9FAFB !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.ntdx-restricted-btn:hover {
    background: #1f3f3a;
    color: #F9FAFB !important;
}

/* ---------- 启用/关闭 状态徽章 ---------- */
.ntdx-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.ntdx-status-on {
    background: #F0FDF4;
    color: #1F7A5A;
    border: 1px solid #BBF7D0;
}
.ntdx-status-off {
    background: #FFF7ED;
    color: #B45309;
    border: 1px solid #FED7AA;
}

/* ---------- 操作按钮组 ---------- */
.ntdx-action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ---------- 启用按钮 ---------- */
.ntdx-btn-enable {
    display: inline-block;
    padding: 5px 14px;
    background: #1F7A5A;
    color: #F9FAFB !important;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.ntdx-btn-enable:hover {
    background: #186a4d;
    color: #F9FAFB !important;
}

/* ---------- 关闭/警告按钮 ---------- */
.ntdx-btn-warning {
    display: inline-block;
    padding: 5px 14px;
    background: #B45309;
    color: #F9FAFB !important;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.ntdx-btn-warning:hover {
    background: #92400E;
    color: #F9FAFB !important;
}

/* ---------- 已关闭行样式 ---------- */
.ntdx-row-disabled {
    opacity: 0.6;
    background: #FAFAFA;
}
.ntdx-row-disabled:hover {
    opacity: 0.8;
}

/* =============================================
   全站总开关样式
   ============================================= */

.ntdx-global-switch-card {
    margin-bottom: 20px;
    border-width: 2px;
    transition: all 0.3s;
}
.ntdx-global-switch-card.ntdx-global-on {
    border-color: #BBF7D0;
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
}
.ntdx-global-switch-card.ntdx-global-off {
    border-color: #FECACA;
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 100%);
}

.ntdx-global-switch-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.ntdx-global-switch-info {
    flex: 1;
}

.ntdx-global-switch-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ntdx-global-status-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.ntdx-global-status-on {
    background: #F0FDF4;
    color: #1F7A5A;
    border: 2px solid #BBF7D0;
}
.ntdx-global-status-off {
    background: #FEF2F2;
    color: #B91C1C;
    border: 2px solid #FECACA;
}

.ntdx-btn-global-on {
    display: inline-block;
    padding: 10px 24px;
    background: #1F7A5A;
    color: #F9FAFB !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.ntdx-btn-global-on:hover {
    background: #186a4d;
    color: #F9FAFB !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(31,122,90,0.3);
}

.ntdx-btn-global-off {
    display: inline-block;
    padding: 10px 24px;
    background: #B91C1C;
    color: #F9FAFB !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.ntdx-btn-global-off:hover {
    background: #991b1b;
    color: #F9FAFB !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(185,28,28,0.3);
}

@media (max-width: 768px) {
    .ntdx-global-switch-inner {
        flex-direction: column;
        text-align: center;
    }
    .ntdx-global-switch-action {
        flex-direction: row;
        justify-content: center;
    }
}