/* 页面整体 */
body {
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #f4f6f9;
    background-image: url("https://blog.logicyang.top/images/bg.png");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    background-position: 50% 50%;
    margin: 0;
    padding: 0;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
    z-index: 0;
}

/* 汉堡菜单按钮 */
.sidebar-toggle-btn {
    position: fixed;
    left: 12px;
    top: 12px;
    width: 44px;
    height: 44px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    color: #2c3e50;
    font-size: 20px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 2002;
    padding: 0;
}

body.sidebar-open .sidebar-toggle-btn {
    left: 292px;
}

.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: #9fb0c7;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* 侧栏背景遮罩 */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 1999;
}

.sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* 偏左布局容器 - 恢复为居中单列 */
.container {
    width: 80%;
    margin: 50px auto;
    position: relative;
    z-index: 1;
}

.blog-tool-header {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    border: 1px solid #dde6f2;
    border-radius: 0;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2001;
    overflow-y: auto;
    border-right: 1px solid #dde6f2;
}

.blog-tool-header.is-open {
    left: 0;
}

.blog-brand {
    text-decoration: none;
}

.blog-profile-card {
    display: flex;
    justify-content: center;
}

.blog-profile-avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.blog-brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.blog-brand-subtitle {
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.blog-tool-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.blog-contact-list {
    display: flex;
    gap: 10px;
    align-items: center;
}

.blog-contact-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #334155;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #d6dfeb;
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.blog-contact-icon:hover {
    background: #f4f8fc;
    border-color: #9fb0c7;
    color: #1e3a5f;
    transform: translateY(-1px);
}

.blog-contact-icon-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.blog-tool-tag {
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf2fb;
    color: #355070;
    font-size: 12px;
    font-weight: 700;
}

.blog-back-link {
    text-decoration: none;
    color: #2c3e50;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
}

.blog-back-link:hover {
    background: #f4f8fc;
    border-color: #9fb0c7;
}

.layout-main {
    min-width: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* 标题 */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1b2736;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* 表格样式 */
.ban-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

/* 表头 */
.ban-table thead {
    background-color: #34495e;
    color: white;
}

.ban-table th,
.ban-table td {
    padding: 14px 18px;
    text-align: left;
}

/* 行分隔线 */
.ban-table tbody tr {
    border-bottom: 1px solid #eee;
}

/* 悬浮效果 */
.ban-table tbody tr:hover {
    background-color: #f2f8ff;
    transition: 0.2s ease;
}

/* 奇偶行颜色 */
.ban-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* 表头文字 */
.ban-table th {
    font-weight: 600;
}

/* 顶部查询框 */
.filter-box {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.upload-box {
    border: 1px solid #dce7f3;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(249, 252, 255, 0.68) 100%);
}

.upload-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.upload-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 16px;
}

.editor-toolbar {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 30px;
}

.editor-toolbar .filter-box {
    margin-bottom: 0;
}

.editor-filter-box {
    flex: 1 1 auto;
}

.editor-toolbar > .filter-box {
    margin-bottom: 0;
}

.editor-toolbar .auth-box,
.editor-toolbar .editor-filter-box {
    align-self: stretch;
}

/* 横向排列 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

/* 每个控件 */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    margin-bottom: 6px;
    color: #555;
}

.auth-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}

/* 下拉框 */
select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 120px;
    font-size: 14px;
}

input[type="file"] {
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 220px;
    font-size: 14px;
    background: #fff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-field {
    min-width: 0;
    flex: 1 1 220px;
}

.upload-field-file {
    flex: 2 1 320px;
}

.upload-file-input,
.upload-select {
    width: 100%;
}

.upload-file-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #b9c9db;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.upload-file-shell:hover {
    border-color: #8ea6c0;
    background: #f4f8fc;
}

.upload-file-shell:focus-within {
    border-color: #5b7ca7;
    box-shadow: 0 0 0 4px rgba(91, 124, 167, 0.12);
}

.upload-file-input {
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.upload-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid #c7d2e0;
    background: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-file-button:hover {
    background: #f4f8fc;
    border-color: #8ea6c0;
    transform: translateY(-1px);
}

.upload-file-button:active {
    transform: translateY(0);
}

.upload-file-name {
    color: #475569;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
}

.upload-select {
    min-width: 220px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid #c7d2e0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-select:focus {
    outline: none;
    border-color: #5b7ca7;
    box-shadow: 0 0 0 4px rgba(91, 124, 167, 0.12);
}

.upload-action {
    margin-left: auto;
    justify-content: flex-end;
}

input[type="number"],
input[type="text"] {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    min-width: 120px;
    font-size: 14px;
}

textarea.notes-textarea {
    min-width: 260px;
    width: 100%;
    min-height: 86px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #c7d2e0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
}

textarea.notes-textarea:focus {
    outline: none;
    border-color: #5b7ca7;
    box-shadow: 0 0 0 4px rgba(91, 124, 167, 0.12);
}

textarea.notes-textarea-compact {
    min-width: 220px;
    min-height: 72px;
}

input[type="date"] {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #c7d2e0;
    min-width: 180px;
    font-size: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: #5b7ca7;
    box-shadow: 0 0 0 4px rgba(91, 124, 167, 0.12);
}

.auth-password {
    min-width: 260px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid #c7d2e0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(15, 23, 42, 0.05);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-password::placeholder {
    color: #9aa4b2;
}

.auth-password:hover {
    border-color: #9fb0c7;
}

.auth-password:focus {
    outline: none;
    border-color: #5b7ca7;
    box-shadow: 0 0 0 4px rgba(91, 124, 167, 0.14), 0 8px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* 按钮 */
.btn-primary {
    padding: 9px 18px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-primary:hover {
    background-color: #1a252f;
}

.btn-secondary {
    padding: 9px 18px;
    background-color: #edf2f7;
    color: #2c3e50;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-secondary:hover {
    background-color: #dfe7ef;
}

.editor-summary {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    color: #334155;
}

.query-summary {
    margin: -16px 0 20px;
    color: #64748b;
    font-size: 13px;
    padding-left: 2px;
}

.banlist-nav-box {
    margin-bottom: 24px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.banlist-nav-title {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.banlist-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.banlist-manage-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: start;
}

.banlist-create-side {
    min-width: 200px;
    padding-left: 16px;
    border-left: 1px dashed #cbd5e0;
}

.banlist-nav-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e0;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    transition: 0.2s ease;
}

.banlist-nav-item:hover {
    background: #eaf2fb;
    border-color: #9fb0c7;
}

.banlist-nav-item.active {
    background: #2c3e50;
    border-color: #2c3e50;
    color: #fff;
}

.upload-date-input {
    min-width: 220px;
    width: 100%;
}

.banlist-manage-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.banlist-action-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.danger-action {
    border-color: #fca5a5;
    background: #fff1f2;
}

.btn-danger {
    padding: 10px 18px;
    background: #b91c1c;
    color: #fff;
    border: 1px solid #991b1b;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-danger:hover {
    background: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(153, 27, 27, 0.25);
}

.btn-danger:active {
    transform: translateY(0);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 16px;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #dbe4f0;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.28);
    padding: 18px;
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.modal-card .form-row {
    gap: 12px;
}

.modal-card .upload-field,
.modal-card .upload-field-file {
    flex: 1 1 100%;
    min-width: 0;
}

.modal-card .upload-date-input,
.modal-card input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.editor-table td,
.editor-table th {
    vertical-align: middle;
}

.auth-box {
    border: 1px solid #dbe4f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    flex: 0 0 340px;
}

.auth-box .auth-status,
.auth-box .auth-form {
    height: 100%;
}

.auth-box .auth-form .form-row {
    align-items: flex-end;
}

.auth-status {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.auth-form {
    width: 100%;
}

.auth-hint-wrap {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.auth-hint-mark {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #1f2937;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    cursor: help;
    user-select: none;
    outline: none;
}

.auth-hint-mark::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: 220px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}

.auth-hint-mark:hover::after,
.auth-hint-mark:focus::after {
    opacity: 1;
    transform: translateY(0);
}

.auth-hint,
.auth-hint-inline {
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 960px) {
    .container {
        width: 92%;
        margin: 24px auto;
    }

    .blog-tool-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-actions {
        justify-content: flex-end;
    }

    .editor-toolbar {
        flex-direction: column;
    }

    .banlist-manage-grid {
        grid-template-columns: 1fr;
    }

    .banlist-create-side {
        border-left: none;
        border-top: 1px dashed #cbd5e0;
        padding-left: 0;
        padding-top: 12px;
    }

    .auth-hint-mark::after {
        right: auto;
        left: 0;
    }

    .auth-box {
        flex: 1 1 auto;
        width: 100%;
    }
}

.status-select {
    min-width: 140px;
}

.status-section {
    margin-bottom: 28px;
}

.status-section-title {
    margin: 0 0 12px;
    font-size: 20px;
    color: #1f2937;
}

.change-muted {
    color: #64748b;
    font-size: 13px;
}

.empty-row {
    text-align: center;
    color: #94a3b8;
    padding: 18px 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.danger-button {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.danger-button:hover {
    background-color: #fecaca;
}

.flash-box {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: 380px;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.flash-item {
    background: rgba(30, 41, 59, 0.94);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 11px 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(5px);
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 页面标题 */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1b2736;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* 公共标签样式 */
.status-tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    display: inline-block;
}

.change-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.change-tight {
    background: #fee2e2;
    color: #991b1b;
}

.change-loose {
    background: #dcfce7;
    color: #166534;
}

.change-none {
    background: #e2e8f0;
    color: #334155;
}

.card-link {
    color: #1f4f7a;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.card-link:hover {
    color: #163a5a;
    border-bottom-color: #163a5a;
}

.card-image-link {
    display: inline-block;
    line-height: 0;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.card-image-link:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.card-image-link img {
    display: block;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    background: #fff;
}

.lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    font-size: 24px;
    line-height: 36px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.lightbox-caption {
    color: #e2e8f0;
    font-size: 14px;
    text-align: center;
}

/* 禁止 */
.status-banned {
    background-color: #e74c3c;
}

/* 限制 */
.status-limited {
    background-color: #f39c12;
}

/* 准限制 */
.status-semi {
    background-color: #f1c40f;
    color: #333;   /* 黄色背景改深色字更清晰 */
}

/* 无限制 */
.status-unlimited {
    background-color: #2ecc71;
}