.article-form-container {
    max-width: 1200px;
    margin: 0 auto;
}

.article-form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #F0F1F5;
    overflow: hidden;
}

.form-section {
    padding: 0px 32px;
    border-bottom: 1px solid #F2F3F5;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.section-badge {
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #FF7D00 0%, #F53F3F 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1D2129;
}

.section-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1D2129;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label i {
    color: #FF7D00;
    font-size: 14px;
}

.form-label.required::after {
    content: '*';
    color: #F53F3F;
    margin-left: 4px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E5E6EB;
    border-radius: 8px;
    font-size: 14px;
    color: #1D2129;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: white;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E5E6EB;
    border-radius: 8px;
    font-size: 14px;
    color: #1D2129;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386909C' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-clip: padding-box;
    background-origin: padding-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #FF7D00;
    box-shadow: 0 0 0 3px rgba(255, 125, 0, 0.08);
}

.form-select:focus {
    outline: none;
    border-color: #FF7D00;
    box-shadow: 0 0 0 3px rgba(255, 125, 0, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FF7D00' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.form-select option {
    padding: 8px 12px;
    background-color: white;
    background-image: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 分类 / 状态 / 发布时间 排在同一行：分类与状态窄，发布时间靠右占剩余宽度 */
.form-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.form-row-meta .form-group--narrow {
    margin-bottom: 0;
}

.form-row-meta .form-group--time {
    flex: 1 1 0;
    min-width: 300px;
    margin-bottom: 0;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.form-row-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.char-count {
    color: #86909C;
    font-size: 12px;
    margin-top: 4px;
    text-align: right;
}

.error-message {
    color: #F53F3F;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    display: none;
}

.error-message.show {
    display: flex;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 1.5px solid #E5E6EB;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #4E5969;
    background: white;
}

.tag-item:hover {
    border-color: #FF7D00;
}

.tag-item.selected {
    background: #FFF7E6;
    border-color: #FF7D00;
    color: #D46B08;
    font-weight: 600;
}

.tag-item.selected .tag-check {
    display: inline !important;
}

.tag-item input[type="checkbox"] {
    display: none;
}

.switch-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #F7F8FA;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.switch-card:hover {
    background: #F2F3F5;
}

.switch-card input[type="checkbox"] {
    display: none;
}

.switch-toggle {
    position: relative;
    width: 44px;
    height: 22px;
    background: #D9D9D9;
    border-radius: 11px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.switch-toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.switch-card.active .switch-toggle {
    background: #FF7D00;
}

.switch-card.active .switch-toggle::after {
    left: 24px;
}

.switch-label {
    flex: 1;
}

.switch-title {
    font-weight: 500;
    color: #1D2129;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.switch-title i {
    font-size: 13px;
}

.switch-desc {
    color: #86909C;
    font-size: 12px;
    margin-top: 3px;
}

.form-section .radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    flex-direction: row !important;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 14px;
    border: 1.5px solid #E5E6EB;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    flex-shrink: 1;
}

.radio-option:hover {
    border-color: #FF7D00;
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #FF7D00;
}

.radio-option.active {
    background: #FFF7E6;
    border-color: #FF7D00;
}

.radio-label {
    display: flex;
    flex-direction: column;
}

.radio-title {
    font-weight: 500;
    color: #1D2129;
    font-size: 14px;
}

.radio-desc {
    color: #86909C;
    font-size: 12px;
    margin-top: 2px;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker {
    width: 40px;
    height: 38px;
    padding: 2px;
    border: 1.5px solid #E5E6EB;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-picker:focus {
    outline: none;
    border-color: #FF7D00;
}

.btn-row {
    padding: 24px 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    background: #F7F8FA;
}

.btn {
    padding: 10px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #FF7D00 0%, #F53F3F 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 125, 0, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 125, 0, 0.35);
}

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

.btn-secondary {
    background: white;
    color: #4E5969;
    border: 1px solid #E5E6EB;
}

.btn-secondary:hover {
    background: #F7F8FA;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.time-input-group input[type="text"].time-input {
    width: 65px !important;
    padding: 8px 6px;
    border: 1.5px solid #E5E6EB;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.time-input-group input[type="text"].time-input:focus {
    outline: none;
    border-color: #FF7D00;
}

.time-separator {
    color: #86909C;
    font-size: 14px;
    font-weight: 500;
}

.info-text {
    color: #86909C;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-text i {
    font-size: 12px;
}

.select-wrapper {
    display: flex;
    gap: 10px;
}

.select-wrapper .form-select {
    flex: 1;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 12px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    background: #F7F8FA;
    border-bottom: 1px solid #E5E6EB;
}

.modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1D2129;
}

.modal-desc {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #86909C;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #E5E6EB;
}

.modal-footer .btn {
    flex: 1;
    justify-content: center;
    padding: 10px;
}

.status-bar {
    padding: 12px 24px;
    border-top: 1px solid #E5E6EB;
    background: #F6FFED;
    font-size: 12px;
    color: #52C41A;
    text-align: center;
    display: none;
}

.status-bar.show {
    display: block;
}

.editor-container {
    border: 1.5px solid #E5E6EB;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.editor-container:hover {
    border-color: #D9D9D9;
}

.editor-tabs {
    display: flex;
    gap: 8px;
}

.editor-tab {
    padding: 8px 16px;
    font-size: 13px;
    color: #4E5969;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-tab:hover {
    background: #F2F3F5;
}

.editor-tab.active {
    background: #FFF7E6;
    color: #D46B08;
    font-weight: 500;
}

.section-desc {
    margin: 0 0 20px 0;
    color: #86909C;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .article-form-container {
        padding: 12px;
    }

    .form-section {
        padding: 20px 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-row-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row-meta .form-group--narrow,
    .form-row-meta .form-group--time {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }

    .form-section .radio-group {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }

    .radio-option {
        min-width: auto;
    }

    .select-wrapper {
        flex-direction: column;
    }

    .time-input-group {
        gap: 4px;
    }

    .time-input {
        width: 55px;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-box {
        width: 95%;
    }

    /* 区块标题允许换行，避免与「TinyMCE/UEditor」切换按钮互相挤压 */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
    }

    .section-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    /* 标题字号收紧 */
    .article-form-container h2 {
        font-size: 18px !important;
    }

    /* 文章表单卡片在圆角屏下更贴合、更紧凑 */
    .article-form-card {
        border-radius: 10px;
    }

    .btn-row {
        padding: 16px;
    }

    /* 时间输入组横向可滚动，防止小屏被裁切（年月日时分共 5 组） */
    .time-input-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .time-input-group input[type="text"].time-input {
        width: 50px !important;
    }

    /* 编辑器区域收紧圆角，移动端更顺手 */
    .editor-container {
        border-radius: 6px;
    }
}

/* 极小屏：进一步压缩编辑器与间距，保证单手可操作 */
@media (max-width: 480px) {
    .form-section {
        padding: 16px 12px;
    }

    .article-form-container {
        padding: 8px;
    }

    .time-input-group input[type="text"].time-input {
        width: 46px !important;
    }

    .switch-card {
        padding: 12px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 15px;
    }

    .tag-item {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 编辑器字号下拉框宽度调小（覆盖字号项 title 的各种大小写写法） */
.tox .tox-tbtn--select[title="字号"],
.tox .tox-tbtn--select[title="Font Sizes"],
.tox .tox-tbtn--select[title="Font sizes"],
.tox .tox-tbtn--select[title="Font size"] {
    width: 65px !important;
    min-width: 65px !important;
}

.tox .tox-tbtn--select[title="字号"] .tox-listbox,
.tox .tox-tbtn--select[title="Font Sizes"] .tox-listbox,
.tox .tox-tbtn--select[title="Font sizes"] .tox-listbox,
.tox .tox-tbtn--select[title="Font size"] .tox-listbox,
.tox .tox-tbtn--select[title="字号"] .tox-listboxfield,
.tox .tox-tbtn--select[title="Font Sizes"] .tox-listboxfield,
.tox .tox-tbtn--select[title="Font sizes"] .tox-listboxfield,
.tox .tox-tbtn--select[title="Font size"] .tox-listboxfield,
.tox .tox-tbtn--select[title="字号"] select,
.tox .tox-tbtn--select[title="Font Sizes"] select,
.tox .tox-tbtn--select[title="Font sizes"] select,
.tox .tox-tbtn--select[title="Font size"] select {
    width: 65px !important;
    max-width: 65px !important;
}

/* 编辑器字体（fontfamily）下拉框宽度调小，与字号框一致（覆盖各种大小写写法） */
.tox .tox-tbtn--select[title="字体"],
.tox .tox-tbtn--select[title="Font"],
.tox .tox-tbtn--select[title="Fonts"] {
    width: 65px !important;
    min-width: 65px !important;
}

.tox .tox-tbtn--select[title="字体"] .tox-listbox,
.tox .tox-tbtn--select[title="Font"] .tox-listbox,
.tox .tox-tbtn--select[title="Fonts"] .tox-listbox,
.tox .tox-tbtn--select[title="字体"] .tox-listboxfield,
.tox .tox-tbtn--select[title="Font"] .tox-listboxfield,
.tox .tox-tbtn--select[title="Fonts"] .tox-listboxfield,
.tox .tox-tbtn--select[title="字体"] select,
.tox .tox-tbtn--select[title="Font"] select,
.tox .tox-tbtn--select[title="Fonts"] select {
    width: 65px !important;
    max-width: 65px !important;
}