/* ============================================
   通用订阅组件样式
   可以在任何页面中复用
   ============================================ */

/* 组件容器 */
.subscription-widget {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.subscription-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 紧凑模式 */
.subscription-widget.compact {
    padding: 16px;
    border-radius: 8px;
}

/* 组件头部 */
.widget-header {
    margin-bottom: 16px;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

.widget-description {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* 表单组 */
.widget-form-group {
    margin-bottom: 12px;
}

/* 输入框样式 */
.widget-email-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.widget-email-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.widget-email-input::placeholder {
    color: #adb5bd;
}

/* 提交按钮 */
.widget-submit-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
}

.widget-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.widget-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.widget-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 提示文字 */
.widget-notice {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin: 12px 0 0 0;
}

/* 模块选择器 */
.widget-modules-group {
    margin-bottom: 12px;
}

.widget-modules-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.widget-modules-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.widget-modules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.widget-module-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.widget-module-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.widget-module-item input[type="checkbox"] {
    margin-top: 2px;
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.widget-module-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-module-item .module-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.widget-module-item .module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.widget-module-item .module-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.widget-module-item .module-frequency {
    font-size: 11px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    white-space: nowrap;
    font-weight: 500;
}

.widget-module-item .module-desc {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

.widget-module-item.module-all {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-color: #667eea;
}

.widget-module-item.module-all .module-name {
    color: #667eea;
}

/* 模块加载和错误状态 */
.modules-loading,
.modules-error {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #6c757d;
}

.modules-error {
    color: #dc3545;
}

/* 滚动条样式 */
.widget-modules-list::-webkit-scrollbar {
    width: 6px;
}

.widget-modules-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.widget-modules-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.widget-modules-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 成功状态 */
.subscription-widget-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #155724;
}

.success-icon svg {
    width: 32px;
    height: 32px;
}

.success-title {
    font-size: 16px;
    font-weight: 600;
    color: #155724;
    margin: 0 0 8px 0;
}

.success-text {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
}

/* 错误状态 */
.subscription-widget-error {
    text-align: center;
    padding: 20px 0;
}

.error-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: #f8d7da;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #721c24;
}

.error-icon svg {
    width: 32px;
    height: 32px;
}

.error-title {
    font-size: 16px;
    font-weight: 600;
    color: #721c24;
    margin: 0 0 8px 0;
}

.error-text {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.widget-retry-btn {
    padding: 8px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.widget-retry-btn:hover {
    background: #5a6268;
}

/* 紧凑模式的特殊样式 */
.subscription-widget.compact .widget-title {
    font-size: 14px;
}

.subscription-widget.compact .widget-description {
    font-size: 12px;
}

.subscription-widget.compact .widget-email-input {
    padding: 8px 12px;
    font-size: 13px;
}

.subscription-widget.compact .widget-submit-btn {
    padding: 10px 20px;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .subscription-widget {
        padding: 20px;
    }

    .widget-title {
        font-size: 15px;
    }

    .widget-description {
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscription-widget-success,
.subscription-widget-error {
    animation: fadeIn 0.3s ease;
}

/* 侧边栏样式适配 */
.sidebar-section .subscription-widget {
    border-radius: 8px;
    padding: 20px;
}

.sidebar-section .widget-title {
    font-size: 15px;
}

/* 在深色主题中的支持（可选） */
@media (prefers-color-scheme: dark) {
    /* 如果需要支持深色主题，可以在这里添加样式 */
}
