/**
 * 用户投稿页面样式
 * @package Developer_Starter
 */

/* 投稿页面容器 */
.submit-post-page {
    padding: 60px 0;
    min-height: 70vh;
}

.submit-post-page .container {
    max-width: 900px;
}

/* 功能禁用/登录提示 */
.submit-post-disabled,
.submit-post-login-required {
    text-align: center;
    padding: 80px 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.submit-post-disabled .disabled-icon,
.submit-post-login-required .login-icon {
    margin-bottom: 24px;
    color: var(--color-gray-400);
}

.submit-post-disabled h2,
.submit-post-login-required h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-gray-800);
}

.submit-post-disabled p,
.submit-post-login-required p {
    color: var(--color-gray-500);
    margin-bottom: 24px;
    font-size: 1rem;
}

.submit-post-disabled .btn-primary,
.submit-post-login-required .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.submit-post-disabled .btn-primary:hover,
.submit-post-login-required .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* 投稿表单容器 */
.submit-post-form-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* 表单头部 */
.form-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-gray-100);
}

.form-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 8px;
}

.form-title svg {
    color: var(--color-primary);
}

.form-desc {
    color: var(--color-gray-500);
    font-size: 0.95rem;
}

/* 表单组 */
.submit-post-form .form-group {
    margin-bottom: 24px;
}

.submit-post-form label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.submit-post-form .required {
    color: #ef4444;
}

.submit-post-form .label-hint {
    font-weight: 400;
    color: var(--color-gray-400);
    font-size: 0.85rem;
}

/* 输入框 */
.submit-post-form input[type="text"],
.submit-post-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-gray-200);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.submit-post-form input[type="text"]:focus,
.submit-post-form select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.submit-post-form input::placeholder {
    color: var(--color-gray-400);
}

/* 字数统计 */
.char-count {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--color-gray-400);
    margin-top: 6px;
}

/* 编辑器包装 */
.editor-wrapper {
    border-radius: 10px;
    overflow: hidden;
}

.editor-wrapper .wp-editor-container {
    border: 2px solid var(--color-gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.editor-wrapper .mce-panel {
    border-color: var(--color-gray-200) !important;
}

.editor-wrapper .mce-toolbar-grp {
    background: var(--color-gray-50) !important;
    border-bottom: 1px solid var(--color-gray-200) !important;
}

.editor-wrapper .quicktags-toolbar {
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
    padding: 8px;
}

.editor-wrapper .wp-switch-editor {
    background: var(--color-gray-100);
    border-color: var(--color-gray-200);
}

.editor-wrapper .html-active .switch-html,
.editor-wrapper .tmce-active .switch-tmce {
    background: #fff;
}

/* 标签预览 */
.tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 提交按钮 */
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-gray-100);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-submit .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 提交消息 */
.submit-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 500;
}

.submit-message.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.submit-message.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* 响应式 */
@media (max-width: 768px) {
    .submit-post-page {
        padding: 30px 0;
    }
    
    .submit-post-form-wrapper {
        padding: 24px;
        border-radius: 12px;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .submit-post-disabled,
    .submit-post-login-required {
        padding: 50px 24px;
    }
    
    .btn-submit {
        width: 100%;
        padding: 14px 30px;
    }
}

/* ===== 暗黑模式 ===== */
html.dark-mode .submit-post-disabled,
html.dark-mode .submit-post-login-required,
html.dark-mode .submit-post-form-wrapper {
    background: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

html.dark-mode .submit-post-disabled h2,
html.dark-mode .submit-post-login-required h2,
html.dark-mode .form-title {
    color: #f1f5f9;
}

html.dark-mode .submit-post-disabled p,
html.dark-mode .submit-post-login-required p,
html.dark-mode .form-desc {
    color: #94a3b8;
}

html.dark-mode .form-header {
    border-bottom-color: #334155;
}

html.dark-mode .submit-post-form label {
    color: #e2e8f0;
}

html.dark-mode .submit-post-form .label-hint {
    color: #64748b;
}

html.dark-mode .submit-post-form input[type="text"],
html.dark-mode .submit-post-form select {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

html.dark-mode .submit-post-form input::placeholder {
    color: #64748b;
}

html.dark-mode .submit-post-form input[type="text"]:focus,
html.dark-mode .submit-post-form select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

html.dark-mode .char-count {
    color: #64748b;
}

html.dark-mode .editor-wrapper .wp-editor-container {
    border-color: #334155;
}

html.dark-mode .editor-wrapper .mce-panel {
    border-color: #334155 !important;
    background: #0f172a !important;
}

html.dark-mode .editor-wrapper .mce-toolbar-grp,
html.dark-mode .editor-wrapper .quicktags-toolbar {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

html.dark-mode .editor-wrapper .mce-btn button {
    color: #e2e8f0 !important;
}

html.dark-mode .editor-wrapper iframe {
    background: #0f172a;
}

html.dark-mode .editor-wrapper .wp-switch-editor {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html.dark-mode .editor-wrapper .html-active .switch-html,
html.dark-mode .editor-wrapper .tmce-active .switch-tmce {
    background: #1e293b;
}

html.dark-mode .tag-item {
    background: rgba(37, 99, 235, 0.2);
}

html.dark-mode .form-actions {
    border-top-color: #334155;
}

html.dark-mode .submit-message.success {
    background: rgba(4, 120, 87, 0.2);
    color: #34d399;
    border-color: rgba(4, 120, 87, 0.3);
}

html.dark-mode .submit-message.error {
    background: rgba(185, 28, 28, 0.2);
    color: #f87171;
    border-color: rgba(185, 28, 28, 0.3);
}
