/* 全局 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body.nd-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: #f4f7fb;
    color: #111827;
}

a {
    color: inherit;
    text-decoration: none;
}

/* 顶部导航 */
.nd-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.nd-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nd-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.nd-logo-icon {
    font-size: 18px;
}

.nd-logo-img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(148,163,184,0.4);
}

.nd-logo-text {
    color: #111827;
}

.nd-admin-link {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.nd-admin-link:hover {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 10px 22px rgba(79,70,229,0.35);
    transform: translateY(-1px);
}

/* 前台主页 */
.nd-main {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px 40px;
}

.nd-search-card {
    background: #e0edff;
    background: linear-gradient(135deg, #e0edff, #f5efff);
    border-radius: 20px;
    padding: 26px 22px 22px;
    text-align: left;
    box-shadow: 0 18px 45px rgba(148,163,184,0.35);
}

.nd-search-card h1 {
    margin: 0 0 4px;
    font-size: 22px;
    color: #111827;
}

.nd-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280;
}

.nd-search-form {
    display: flex;
    gap: 8px;
}

.nd-search-form input[type="text"] {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.nd-search-form input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.25);
}

.nd-search-form button {
    border-radius: 999px;
    border: none;
    padding: 9px 18px;
    font-size: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(79,70,229,0.4);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.nd-search-form button:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(79,70,229,0.55);
}

.nd-list-card {
    margin-top: 22px;
    background: #fff;
    border-radius: 16px;
    padding: 18px 16px 10px;
    box-shadow: 0 10px 28px rgba(148,163,184,0.28);
}

.nd-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.nd-list-header h2 {
    font-size: 16px;
    margin: 0;
}

.nd-empty {
    padding: 20px 8px 22px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

.nd-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nd-link-item {
    padding: 10px 4px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.nd-link-item:last-child {
    border-bottom: none;
}

.nd-link-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.nd-link-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.nd-link-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.nd-link-btn {
    padding: 4px 10px;
    border-radius: 999px;
    background: #10b981;
    color: #ecfdf5;
    font-size: 12px;
}

.nd-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
}

.nd-views {
    color: #9ca3af;
}

.nd-footer {
    text-align: center;
    padding: 16px 12px 24px;
    font-size: 12px;
    color: #9ca3af;
}

/* 管理后台 - 登录页 */
.nd-admin-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.nd-admin-login .nd-admin-card {
    width: 320px;
    background: rgba(255,255,255,0.98);
    border-radius: 16px;
    padding: 24px 22px 20px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.5);
}

.nd-admin-card h1 {
    margin: 0 0 6px;
    font-size: 18px;
    text-align: center;
}

.nd-admin-card .nd-subtitle {
    text-align: center;
    margin-bottom: 14px;
}

.field {
    margin-bottom: 10px;
}

.field label {
    display: block;
    font-size: 13px;
    color: #374151;
    margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99,102,241,0.25);
}

.btn {
    display: block;
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 9px 0;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.nd-msg {
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 10px;
}

.nd-msg-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.nd-msg-success {
    background: #ecfdf5;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* 管理后台 - 布局（强制清除任何注入的背景图） */
body.nd-admin-layout {
    background: #f3f4f6 !important;
    background-image: none !important;
}

.nd-admin-layout {
    margin: 0;
    min-height: 100vh;
    display: flex;
    background: #f3f4f6 !important;
    background-image: none !important;
}

.nd-admin-layout::before,
.nd-admin-layout::after {
    display: none !important;
}

.nd-admin-sidebar {
    width: 210px;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
}

.nd-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 18px;
}

.nd-admin-sidebar nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.nd-admin-sidebar nav a.active,
.nd-admin-sidebar nav a:hover {
    background: #1f2937;
}

.nd-sidebar-bottom {
    margin-top: auto;
    font-size: 12px;
    color: #9ca3af;
}

.nd-sidebar-bottom a {
    display: inline-block;
    margin-top: 6px;
    color: #f97373;
}

.nd-admin-main {
    flex: 1;
    padding: 16px 18px 24px;
    background: #f3f4f6 !important;
    background-image: none !important;
}

.nd-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.nd-admin-header h1 {
    margin: 0;
    font-size: 18px;
}

.nd-btn-primary,
.nd-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 13px;
}

.nd-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.nd-btn-secondary {
    border: 1px solid #d1d5db;
    color: #4b5563;
    background: #fff;
}

.nd-admin-filters {
    margin-bottom: 10px;
}

.nd-admin-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nd-admin-search-form input[type="text"] {
    flex: 1;
    min-width: 180px;
}

.nd-admin-search-form select {
    min-width: 120px;
}

.nd-admin-search-form button {
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #fff;
    font-size: 13px;
}

.nd-admin-table-wrap {
    background: #fff;
    border-radius: 14px;
    padding: 10px 10px 6px;
    box-shadow: 0 12px 30px rgba(148,163,184,0.35);
}

.nd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.nd-table th,
.nd-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}

.nd-table th {
    color: #6b7280;
    font-weight: 500;
    background: #f9fafb;
}

.nd-table tbody tr:hover {
    background: #f9fafb;
}

.nd-td-title-main {
    font-weight: 500;
    margin-bottom: 2px;
}

.nd-td-url {
    font-size: 11px;
    color: #9ca3af;
}

.nd-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.nd-badge-green {
    background: #ecfdf5;
    color: #15803d;
}

.nd-badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

.nd-link-action {
    font-size: 12px;
    margin-right: 6px;
    color: #2563eb;
}

.nd-link-action.nd-danger {
    color: #dc2626;
}

.nd-admin-form-wrap {
    background: #fff !important;
    background-image: none !important;
    border-radius: 14px;
    padding: 14px 14px 10px;
    box-shadow: 0 12px 30px rgba(148,163,184,0.35);
}

.nd-admin-form textarea {
    min-height: 80px;
}

.nd-form-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .nd-admin-layout {
        flex-direction: column;
    }

    .nd-admin-sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .nd-admin-sidebar nav {
        display: flex;
        gap: 6px;
    }

    .nd-sidebar-bottom {
        margin-left: auto;
        text-align: right;
    }
}

