/**
 * 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;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
}

.login-box h1 {
    font-size: 24px;
    margin: 0 0 10px 0;
    text-align: center;
    color: #23282d;
    font-weight: 400;
}

.login-box h2 {
    font-size: 14px;
    font-weight: 400;
    margin: 0 0 30px 0;
    text-align: center;
    color: #646970;
}

/* 登录表单样式 */
.login-box form {
    margin: 0;
}

.login-box form p {
    margin: 0 0 20px 0;
}

.login-box form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
    font-size: 14px;
}

.login-box .regular-text {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    color: #2c3338;
    background: #fff;
    transition: border-color 0.15s ease;
}

.login-box .regular-text:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.login-box .regular-text::placeholder {
    color: #8c8f94;
}

.login-box .submit {
    margin: 25px 0 0 0;
    text-align: center;
}

.login-box .button {
    width: 100% !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: block !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.login-box input[type="submit"].button {
    width: 100% !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: block !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.login-box .notice {
    margin: 0 0 20px 0;
    padding: 12px;
    border-left: 4px solid;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.login-box .notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* 后台布局 */
#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: 14px !important;
    color: #d0d5d9 !important;
    transition: all 0.15s ease;
    display: block;
    font-weight: 400;
    text-decoration: none;
}

#adminmenu .submenu-item a:link,
#adminmenu .submenu-item a:visited {
    color: #d0d5d9 !important;
}

#adminmenu .submenu-item a:hover {
    color: #fff !important;
    background: #2c3338;
}

#adminmenu .submenu-item.current a,
#adminmenu .submenu-item.current a:link,
#adminmenu .submenu-item.current a:visited {
    color: #fff !important;
    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;
}

/* 子菜单样式优化 - 已合并到上方，删除重复定义 */

/* 视频预览模态框样式 */
.video-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.video-preview-content {
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 100001;
}

.video-preview-header {
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.video-preview-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #23282d;
}

.video-preview-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #646970;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.video-preview-close:hover {
    color: #23282d;
}

.video-preview-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.video-preview-loading,
.video-preview-error {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

.video-preview-error {
    color: #d63638;
}

.video-preview-container {
    display: flex;
    gap: 25px;
}

.video-preview-left {
    flex-shrink: 0;
    width: 250px;
}

.video-preview-poster {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-preview-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #646970;
    font-size: 14px;
}

.video-preview-right {
    flex: 1;
    min-width: 0;
}

.video-preview-section {
    margin-bottom: 25px;
}

.video-preview-section:last-child {
    margin-bottom: 0;
}

.video-preview-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #23282d;
}

.video-preview-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.video-preview-table {
    width: 100%;
    border-collapse: collapse;
}

.video-preview-table tr {
    border-bottom: 1px solid #f0f0f1;
}

.video-preview-table tr:last-child {
    border-bottom: none;
}

.video-preview-table td {
    padding: 10px 0;
    vertical-align: top;
}

.video-preview-table td.label {
    width: 100px;
    color: #646970;
    font-weight: 500;
    white-space: nowrap;
}

.video-preview-table td:not(.label) {
    color: #23282d;
}

.video-preview-url {
    word-break: break-all;
}

.video-preview-url a {
    color: #2271b1;
    text-decoration: none;
}

.video-preview-url a:hover {
    text-decoration: underline;
}

.video-preview-description {
    color: #23282d;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.video-preview-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-preview-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .video-preview-container {
        flex-direction: column;
    }
    
    .video-preview-left {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .video-preview-table td.label {
        width: 80px;
        font-size: 12px;
    }
}

/* 分类树状结构样式 */
.category-parent {
    background-color: #f9f9f9;
    font-weight: 600;
}

.category-subcategory {
    background-color: #fff;
}

.category-indicator {
    color: #8c8f94;
    margin-right: 5px;
    font-family: monospace;
}

.wp-list-table tbody tr.category-subcategory:hover {
    background-color: #f6f7f7;
}

.wp-list-table tbody tr.category-parent:hover {
    background-color: #f0f0f1;
}

/* 批量导入页面样式 */
.import-container {
    max-width: 1200px;
    margin: 0 auto;
}

.import-info-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.import-info-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.import-info-box h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.csv-example {
    background: #f6f7f7;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 10px 0;
}

.import-tips {
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.import-tips ul {
    margin: 10px 0 0 20px;
}

.import-tips li {
    margin: 5px 0;
}

.import-form-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.import-form-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.import-progress-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.import-progress-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.progress-bar-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: #2271b1;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #2271b1;
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.progress-stats p {
    margin: 5px 0;
}

.progress-log {
    max-height: 200px;
    overflow-y: auto;
    background: #f6f7f7;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

.log-entry:last-child {
    border-bottom: none;
}

.import-result-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.import-result-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.result-summary {
    padding: 15px;
    background: #f0f6fc;
    border-radius: 4px;
    margin-bottom: 15px;
}

.result-summary p {
    margin: 5px 0;
}

.result-errors {
    margin-top: 15px;
}

.result-errors h3 {
    margin-bottom: 10px;
    color: #d63638;
}

.result-errors ul {
    margin: 10px 0 0 20px;
    color: #d63638;
}

.result-errors li {
    margin: 5px 0;
}

/* 批量修改模态框样式 */
.batch-update-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-update-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.batch-update-content {
    position: relative;
    background: #fff;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100001;
}

.batch-update-header {
    padding: 20px;
    border-bottom: 1px solid #c3c4c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-update-header h2 {
    margin: 0;
    font-size: 18px;
}

.batch-update-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #50575e;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.batch-update-header .close-btn:hover {
    color: #d63638;
}

.batch-update-body {
    padding: 20px;
}

.batch-update-footer {
    padding: 15px 20px;
    border-top: 1px solid #c3c4c7;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

