/* 前端订阅表单样式 */
.bw-newsletter-wrapper {
    max-width: 500px;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.bw-newsletter-title {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.bw-newsletter-fields {
    margin-bottom: 20px;
}

.bw-newsletter-field {
    margin-bottom: 15px;
}

.bw-newsletter-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.bw-newsletter-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.bw-newsletter-input[readonly] {
    background-color: #f5f5f5;
    color: #666;
}

.bw-newsletter-post-types {
    margin-top: 15px;
}

.bw-newsletter-label {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #333;
}

.bw-newsletter-checkbox {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
}

.bw-newsletter-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.bw-newsletter-checkbox span {
    color: #555;
}

.bw-newsletter-submit {
    text-align: center;
}

.bw-newsletter-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    min-width: 120px;
}

.bw-newsletter-button:hover {
    background: #005a87;
}

.bw-newsletter-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bw-newsletter-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.bw-newsletter-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bw-newsletter-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 模态框样式 */
.bw-newsletter-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bw-newsletter-modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bw-newsletter-modal-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.bw-newsletter-modal-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.bw-newsletter-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.bw-newsletter-modal-close:hover {
    color: #333;
}

.bw-newsletter-modal-body {
    padding: 0 20px 20px 20px;
}

.confirm-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.confirm-info p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.confirm-info strong {
    color: #333;
}

.bw-newsletter-modal-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bw-newsletter-modal-footer .button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ddd;
    text-decoration: none;
    display: inline-block;
}

.bw-newsletter-modal-footer .button-secondary {
    background: #f7f7f7;
    color: #333;
}

.bw-newsletter-modal-footer .button-secondary:hover {
    background: #e7e7e7;
}

.bw-newsletter-modal-footer .button-primary {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.bw-newsletter-modal-footer .button-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

/* 响应式设计 */
@media (max-width: 580px) {
    .bw-newsletter-wrapper {
        margin: 10px 0;
        padding: 15px;
    }

    .bw-newsletter-input {
        padding: 10px;
    }

    .bw-newsletter-button {
        width: 100%;
        padding: 12px;
    }

    .bw-newsletter-modal-content {
        width: 95%;
        margin: 10px;
    }

    .bw-newsletter-modal-footer {
        flex-direction: column;
    }

    .bw-newsletter-modal-footer .button {
        width: 100%;
        text-align: center;
    }
}

/* 加载动画 */
.button-loading {
    display: inline-block;
}

.button-loading:after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 表单验证样式 */
.bw-newsletter-field.error .bw-newsletter-input {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.bw-newsletter-field.success .bw-newsletter-input {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1) !important;
}

.bw-newsletter-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.bw-newsletter-form {
    transition: opacity 0.3s ease;
}

.bw-newsletter-message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .bw-newsletter-wrapper {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }

    .bw-newsletter-title {
        color: #fff;
    }

    .bw-newsletter-input {
        background: #333;
        border-color: #555;
        color: #fff;
    }

    .bw-newsletter-input[readonly] {
        background-color: #444;
        color: #ccc;
    }

    .bw-newsletter-input:focus {
        border-color: #0073aa;
    }

    .bw-newsletter-label {
        color: #fff;
    }

    .bw-newsletter-checkbox span {
        color: #ccc;
    }

    .bw-newsletter-modal-content {
        background-color: #2c2c2c;
        color: #fff;
    }

    .bw-newsletter-modal-header {
        border-bottom-color: #444;
    }

    .bw-newsletter-modal-header h4 {
        color: #fff;
    }

    .bw-newsletter-modal-close {
        color: #ccc;
    }

    .bw-newsletter-modal-close:hover {
        color: #fff;
    }

    .confirm-info {
        background: #333;
        border-left-color: #0073aa;
    }

    .confirm-info p {
        color: #ccc;
    }

    .confirm-info strong {
        color: #fff;
    }

    .bw-newsletter-modal-footer .button-secondary {
        background: #444;
        color: #fff;
        border-color: #555;
    }

    .bw-newsletter-modal-footer .button-secondary:hover {
        background: #555;
    }
}