/* ============================================================
 * admin.css — 管理后台专用样式（左侧导航 + 右侧内容）
 * ============================================================ */

/* 管理后台容器 */
.admin-container {
    width: 1100px;
    max-width: 100%;
    margin: 0 auto;
    padding: 76px 0 40px;
    min-height: 100vh;
    position: relative;
    z-index: 10;
    background: rgba(16, 14, 12, 0.96);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

/* 顶部标题栏 */
.admin-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(224, 192, 96, 0.04);
    border-bottom: 2px solid rgba(224, 192, 96, 0.15);
}

.admin-header-bar h1 {
    font-family: 'VT323', monospace;
    font-size: 1.68rem;
    color: #e0c060;
    margin: 0;
}

.admin-header-bar .admin-back {
    color: rgba(124, 252, 0, 0.7);
    text-decoration: none;
    font-family: 'VT323', monospace;
    font-size: 1.08rem;
    transition: color 0.15s;
}

.admin-header-bar .admin-back:hover {
    color: #7cfc00;
}

/* 两栏布局 */
.admin-body {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 140px);
}

/* 左侧导航 */
.admin-sidebar {
    width: 180px;
    flex-shrink: 0;
    padding: 16px 0;
    border-right: 1px solid rgba(224, 192, 96, 0.08);
}

.admin-nav-item {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    font-size: 1.14rem;
    color: rgba(184, 176, 160, 0.6);
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    user-select: none;
}

.admin-nav-item:hover {
    color: #e0d8c8;
    background: rgba(224, 192, 96, 0.04);
}

.admin-nav-item.active {
    color: #e0c060;
    border-left-color: #e0c060;
    background: rgba(224, 192, 96, 0.06);
}

.admin-nav-item:focus-visible,
.system-settings-tab:focus-visible,
.system-settings-actions button:focus-visible,
.system-setting-control input:focus-visible {
    outline: 2px solid #e0c060;
    outline-offset: 2px;
}

/* 右侧内容区 */
.admin-content {
    flex: 1;
    min-width: 0;
    padding: 20px 28px;
}

/* 管理区块 */
.forum-admin-section {
    background: rgba(22, 20, 17, 0.6);
    border: 1px solid rgba(224, 192, 96, 0.08);
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 20px;
}

.forum-admin-section:last-child {
    margin-bottom: 0;
}

.forum-admin-section-title {
    font-family: 'VT323', monospace;
    font-size: 1.38rem;
    color: #e0c060;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(224, 192, 96, 0.1);
}

/* 版区列表项 */
.forum-admin-board-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(224, 192, 96, 0.05);
    transition: background 0.1s;
}

.forum-admin-board-item:hover {
    background: rgba(224, 192, 96, 0.03);
}

.forum-admin-board-item:last-child {
    border-bottom: none;
}

.forum-admin-board-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.forum-admin-board-name {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #e0d8c8;
}

.forum-admin-board-meta {
    font-family: 'VT323', monospace;
    font-size: 0.98rem;
    color: rgba(138, 128, 112, 0.6);
}

.forum-admin-board-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 封禁表单 */
.forum-admin-ban-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.forum-user-picker {
    position: relative;
    width: min(100%, 320px);
    flex: 0 1 320px;
}

.forum-user-picker .forum-user-search-input {
    width: 100%;
}

.forum-user-search-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(224, 192, 96, 0.22);
    border-radius: 2px;
    background: #171510;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
}

.forum-user-search-results[hidden] {
    display: none;
}

.forum-user-search-state {
    padding: 11px 12px;
    color: rgba(184, 176, 160, 0.65);
    font-family: 'VT323', monospace;
    font-size: 1rem;
}

.forum-user-search-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid rgba(224, 192, 96, 0.07);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.forum-user-search-item:last-child {
    border-bottom: 0;
}

.forum-user-search-item:hover,
.forum-user-search-item:focus-visible {
    background: rgba(224, 192, 96, 0.08);
    outline: none;
}

.forum-user-search-item:focus-visible {
    box-shadow: inset 3px 0 #e0c060;
}

.forum-user-search-item img,
.forum-user-search-avatar-fallback {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(224, 192, 96, 0.2);
    border-radius: 50%;
    object-fit: cover;
}

.forum-user-search-avatar-fallback {
    align-items: center;
    justify-content: center;
    background: rgba(224, 192, 96, 0.08);
    color: #e0c060;
    font-family: 'VT323', monospace;
    font-size: 1.15rem;
}

.forum-user-search-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.forum-user-search-name,
.forum-user-search-meta,
.forum-user-search-status {
    overflow: hidden;
    font-family: 'VT323', monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-user-search-name {
    color: #e0d8c8;
    font-size: 1.05rem;
}

.forum-user-search-meta {
    color: rgba(184, 176, 160, 0.52);
    font-size: 0.9rem;
}

.forum-user-search-status {
    max-width: 96px;
    color: #c78a52;
    font-size: 0.84rem;
}

/* 分类管理 */
.forum-admin-category-controls {
    margin-bottom: 12px;
}

.forum-admin-category-add {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid rgba(224, 192, 96, 0.06);
}

/* 管理面板隐藏控制 */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* 响应式 */
@media (max-width: 768px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        display: flex;
        border-right: none;
        border-bottom: 1px solid rgba(224, 192, 96, 0.08);
        padding: 8px 0;
        overflow-x: auto;
    }
    .admin-nav-item {
        width: auto;
        flex: 0 0 auto;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 16px;
        white-space: nowrap;
    }
    .admin-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #e0c060;
    }
    .admin-content { padding: 16px; }
    .forum-user-picker { flex-basis: 100%; width: 100%; }
}


/* ============================================================
 * 邮件系统面板 - 子页 Tab 切换
 * ============================================================ */

.admin-mail-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid rgba(224, 192, 96, 0.15);
    margin-bottom: 16px;
}

.admin-mail-tab {
    padding: 8px 18px;
    font-family: 'VT323', monospace;
    font-size: 1.14rem;
    color: rgba(184, 176, 160, 0.6);
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    transition: all 0.15s;
    user-select: none;
}

.admin-mail-tab:hover {
    color: #e0d8c8;
    background: rgba(224, 192, 96, 0.04);
}

.admin-mail-tab.active {
    color: #e0c060;
    background: rgba(224, 192, 96, 0.08);
    border-color: rgba(224, 192, 96, 0.25);
    border-bottom: 2px solid rgba(224, 192, 96, 0.08);
    margin-bottom: -2px;
}

.admin-mail-subpanel {
    display: none;
}

.admin-mail-subpanel.active {
    display: block;
}

/* 邮件通知开关列表 */
.admin-mail-setting-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-mail-setting-item {
    display: grid;
    grid-template-columns: 20px 200px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(224, 192, 96, 0.03);
    border: 1px solid rgba(224, 192, 96, 0.08);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}

.admin-mail-setting-item:hover {
    background: rgba(224, 192, 96, 0.06);
}

.admin-mail-setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.admin-mail-setting-title {
    font-family: 'VT323', monospace;
    font-size: 1.14rem;
    color: #e0d8c8;
}

.admin-mail-setting-desc {
    font-family: 'VT323', monospace;
    font-size: 1.02rem;
    color: rgba(184, 176, 160, 0.55);
}

/* ============================================================
 * 系统设置面板
 * ============================================================ */

.system-settings-section {
    padding: 0;
    overflow: hidden;
}

.system-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid rgba(224, 192, 96, 0.1);
}

.system-settings-heading .forum-admin-section-title {
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.system-settings-intro,
.system-settings-restart-hint,
.system-settings-group-header p,
.system-setting-description,
.system-setting-default,
.system-settings-status {
    font-family: 'VT323', monospace;
}

.system-settings-intro {
    margin: 0;
    color: rgba(224, 216, 200, 0.72);
    font-size: 1.04rem;
    line-height: 1.5;
}

.system-settings-restart-hint {
    max-width: 270px;
    padding: 7px 10px;
    border: 1px solid rgba(224, 192, 96, 0.18);
    background: rgba(224, 192, 96, 0.05);
    color: rgba(224, 216, 200, 0.72);
    font-size: 0.98rem;
    line-height: 1.4;
}

.system-settings-layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    min-height: 520px;
}

.system-settings-tabs {
    padding: 14px 0;
    border-right: 1px solid rgba(224, 192, 96, 0.1);
    background: rgba(8, 7, 6, 0.25);
}

.system-settings-tab {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: rgba(224, 216, 200, 0.62);
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: color 0.18s, background-color 0.18s, border-color 0.18s;
}

.system-settings-tab:hover {
    color: #f0e8d8;
    background: rgba(224, 192, 96, 0.05);
}

.system-settings-tab.active {
    color: #e0c060;
    border-left-color: #e0c060;
    background: rgba(224, 192, 96, 0.08);
}

.system-settings-workspace {
    min-width: 0;
    padding: 20px;
}

.system-settings-group-header {
    min-height: 68px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(224, 192, 96, 0.1);
}

.system-settings-group-header h4 {
    margin: 0 0 6px;
    color: #e0c060;
    font-family: 'VT323', monospace;
    font-size: 1.34rem;
}

.system-settings-group-header p {
    margin: 0;
    color: rgba(224, 216, 200, 0.66);
    font-size: 1.02rem;
    line-height: 1.45;
}

.system-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
    gap: 22px;
    align-items: center;
    min-height: 88px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(224, 192, 96, 0.07);
}

.system-setting-label-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.system-setting-label {
    color: #eee6d6;
    font-family: 'VT323', monospace;
    font-size: 1.16rem;
}

.system-setting-description {
    max-width: 620px;
    margin: 5px 0 0;
    color: rgba(184, 176, 160, 0.66);
    font-size: 1rem;
    line-height: 1.45;
}

.system-setting-restart-badge {
    padding: 2px 7px;
    border: 1px solid rgba(224, 160, 32, 0.55);
    color: #e0a020;
    font-family: 'VT323', monospace;
    font-size: 0.92rem;
}

.system-setting-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.system-setting-number,
.system-setting-text {
    width: 150px;
    min-height: 42px;
}

.system-setting-checkbox {
    width: 22px;
    height: 22px;
    accent-color: #c8a840;
    cursor: pointer;
}

.system-setting-unit {
    min-width: 42px;
    color: rgba(224, 216, 200, 0.75);
    font-family: 'VT323', monospace;
    font-size: 1.04rem;
}

.system-setting-default {
    flex-basis: 100%;
    color: rgba(184, 176, 160, 0.52);
    font-size: 0.94rem;
    text-align: right;
}

.system-settings-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 18px;
}

.system-settings-actions button {
    min-height: 44px;
}

.system-settings-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.system-settings-status {
    min-height: 24px;
    color: rgba(224, 216, 200, 0.68);
    font-size: 1.02rem;
}

.system-settings-status.success {
    color: #8fd35f;
}

.system-settings-status.error {
    color: #ef7568;
}

@media (max-width: 900px) {
    .system-settings-heading {
        flex-direction: column;
    }

    .system-settings-restart-hint {
        max-width: none;
    }

    .system-settings-layout {
        display: block;
        min-height: 0;
    }

    .system-settings-tabs {
        display: flex;
        overflow-x: auto;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid rgba(224, 192, 96, 0.1);
    }

    .system-settings-tab {
        width: auto;
        flex: 0 0 auto;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
        white-space: nowrap;
    }

    .system-settings-tab.active {
        border-left-color: transparent;
        border-bottom-color: #e0c060;
    }
}

@media (max-width: 620px) {
    .system-settings-workspace,
    .system-settings-heading {
        padding: 16px;
    }

    .system-setting-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .system-setting-control {
        justify-content: flex-start;
    }

    .system-setting-default {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-nav-item,
    .system-settings-tab,
    .forum-admin-board-item,
    .admin-mail-tab,
    .admin-mail-setting-item {
        transition: none;
    }
}
