/**
 * WordPress 风格的后台管理样式
 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #23282d;
    background: #f0f0f1;
}

/* 登录页面 */
.login-page {
    background: #f0f0f1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
    color: #23282d;
}

.login-box h2 {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: center;
    color: #646970;
}

/* 后台布局 */
#wpwrap {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
#wpcontent {
    flex: 1;
    margin-left: 160px;
    padding: 0;
}

#adminmenu {
    position: fixed;
    left: 0;
    top: 32px;
    bottom: 0;
    width: 160px;
    background: #23282d;
    overflow-y: auto;
    z-index: 1000;
}

#adminmenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#adminmenu .menu-item {
    border-bottom: 1px solid #32373c;
}

#adminmenu .menu-item-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #b4b9be;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 13px;
}

#adminmenu .menu-item-link:hover {
    background: #32373c;
    color: #fff;
}

#adminmenu .menu-item.current .menu-item-link {
    background: #2271b1;
    color: #fff;
    font-weight: 500;
}

#adminmenu .menu-icon {
    margin-right: 10px;
    font-size: 18px;
    width: 20px;
    min-width: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

#adminmenu .menu-icon::before {
    display: inline-block;
    line-height: 1;
    font-size: 18px;
}

#adminmenu .menu-title {
    flex: 1;
    font-weight: 400;
}

#adminmenu .menu-item.current .menu-title {
    font-weight: 500;
}

/* 子菜单 */
#adminmenu .submenu {
    display: none;
    background: #191e23;
    padding-left: 0;
}

#adminmenu .menu-item.current .submenu {
    display: block;
}

#adminmenu .submenu-item {
    border-bottom: none;
}

#adminmenu .submenu-item a {
    padding-left: 42px;
    font-size: 13px;
    color: #b4b9be;
    transition: all 0.15s ease;
    display: block;
}

#adminmenu .submenu-item a:hover {
    color: #fff;
    background: #2c3338;
}

#adminmenu .submenu-item.current a {
    color: #fff;
    background: #2271b1;
    font-weight: 500;
}

/* 顶部栏 */
#wpadminbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: #23282d;
    color: #b4b9be;
    z-index: 1001;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 13px;
}

#wpadminbar .adminbar-title {
    color: #fff;
    font-weight: 600;
}

#wpadminbar .adminbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

#wpadminbar a {
    color: #b4b9be;
    text-decoration: none;
}

#wpadminbar a:hover {
    color: #00a0d2;
}

/* 主内容区 */
.wrap {
    padding: 20px;
    background: #fff;
    margin: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wrap h1 {
    font-size: 23px;
    font-weight: 400;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

/* 表单样式 */
.form-table {
    width: 100%;
    border-collapse: collapse;
}

.form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
    text-align: left;
    font-weight: 600;
    vertical-align: top;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table input[type="url"],
.form-table input[type="date"],
.form-table input[type="password"],
.form-table textarea,
.form-table select {
    width: 100%;
    max-width: 500px;
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-table textarea {
    min-height: 100px;
    resize: vertical;
}

.form-table input:focus,
.form-table textarea:focus,
.form-table select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-table .description {
    margin-top: 5px;
    color: #646970;
    font-size: 13px;
}

/* 按钮 */
.button {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #2271b1;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}

.button:hover {
    background: #135e96;
    border-color: #135e96;
}

.button-primary {
    background: #2271b1;
    border-color: #2271b1;
}

.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.button-large {
    padding: 10px 20px;
    font-size: 14px;
}

.button-secondary {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #2c3338;
}

.button-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.button-danger {
    background: #d63638;
    border-color: #d63638;
}

.button-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* 通知消息 */
.notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.notice-success {
    border-left-color: #00a32a;
}

.notice-error {
    border-left-color: #d63638;
}

.notice-warning {
    border-left-color: #dba617;
}

.notice-info {
    border-left-color: #2271b1;
}

.notice p {
    margin: 0;
}

/* 表格 */
.wp-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 20px;
}

.wp-list-table thead th {
    background: #f6f7f7;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #c3c4c7;
}

.wp-list-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #c3c4c7;
}

.wp-list-table tbody tr:hover {
    background: #f6f7f7;
}

.wp-list-table .column-actions {
    width: 150px;
    text-align: right;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination .page-link {
    padding: 6px 12px;
    border: 1px solid #dcdcde;
    background: #fff;
    color: #2c3338;
    text-decoration: none;
    border-radius: 4px;
}

.pagination .page-link:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
}

.pagination .page-link.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.search-box input[type="search"] {
    flex: 1;
    max-width: 300px;
    padding: 6px 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #00a32a;
    color: #fff;
}

.badge-danger {
    background: #d63638;
    color: #fff;
}

.badge-secondary {
    background: #646970;
    color: #fff;
}

/* 响应式 */
@media screen and (max-width: 782px) {
    #adminmenu {
        width: 0;
        overflow: hidden;
    }
    
    #wpcontent {
        margin-left: 0;
    }
}

/* 菜单图标样式 */
.menu-icon {
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

#adminmenu .menu-item.current .menu-icon {
    opacity: 1;
}

#adminmenu .menu-item-link:hover .menu-icon {
    opacity: 1;
}

/* 图标样式 - 图标字符直接在 HTML 中，这里只设置样式 */
.menu-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

.menu-icon.icon-default {
    font-size: 10px;
    opacity: 0.6;
}

/* 子菜单样式优化 */
#adminmenu .submenu-item a {
    padding-left: 42px;
    font-size: 13px;
    color: #b4b9be;
    transition: all 0.15s ease;
}

#adminmenu .submenu-item a:hover {
    color: #fff;
    background: #2c3338;
}

#adminmenu .submenu-item.current a {
    color: #fff;
    background: #2271b1;
    font-weight: 500;
}

