/* ====================================================================
   全新首页通知栏样式 - 现代化设计
   ==================================================================== */

/* 通知容器 - 顶部居中横幅 */
.notifications-container {
    position: fixed;
    top: 130px; /* 在导航栏下方，确保不遮挡功能栏 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 100%;
    max-width: 1400px;
    padding: 0 24px;
    pointer-events: none; /* 允许点击穿透 */
}

/* 默认隐藏首页通知容器 */
#notifications-container {
    display: none !important;
}

/* 当有 show 类时显示 */
#notifications-container.show {
    display: block !important;
}

/* 通知卡片 - 现代化横幅设计 */
.notification-item {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0 auto 16px;
    padding: 20px 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    animation: slideDownBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto; /* 恢复点击 */
    max-width: 900px;
    overflow: hidden;
}

/* 左侧彩色装饰条 */
.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 0 0 16px;
    transition: width 0.3s ease;
}

.notification-item:hover::before {
    width: 8px;
}

/* 不同类型的通知颜色 */
.notification-item.info::before {
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
}

.notification-item.success::before {
    background: linear-gradient(180deg, #43e97b 0%, #38f9d7 100%);
}

.notification-item.warning::before {
    background: linear-gradient(180deg, #fa709a 0%, #fee140 100%);
}

.notification-item.error::before {
    background: linear-gradient(180deg, #f093fb 0%, #f5576c 100%);
}

/* 通知头部 */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
}

/* 通知标题 */
.notification-title {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.2px;
}

/* 标题图标 */
.notification-title::before {
    content: '';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.notification-item.info .notification-title::before {
    content: '\f05a'; /* fa-info-circle */
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
}

.notification-item.success .notification-title::before {
    content: '\f058'; /* fa-check-circle */
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #388e3c;
}

.notification-item.warning .notification-title::before {
    content: '\f071'; /* fa-exclamation-triangle */
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #f57c00;
}

.notification-item.error .notification-title::before {
    content: '\f06a'; /* fa-exclamation-circle */
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #d32f2f;
}

.notification-item:hover .notification-title::before {
    transform: scale(1.1) rotate(5deg);
}

/* 关闭按钮 */
.notification-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg) scale(1.1);
}

.notification-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 通知内容 */
.notification-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 0 44px; /* 与标题图标对齐 */
    padding-right: 20px;
}

/* 通知时间 */
.notification-time {
    font-size: 12px;
    color: #999;
    margin: 10px 0 0 44px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-time::before {
    content: '\f017'; /* fa-clock */
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    opacity: 0.7;
}

/* 悬停效果 */
.notification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16),
                0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 通知动画 - 从顶部弹出 */
@keyframes slideDownBounce {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
        opacity: 1;
    }
    80% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 移除动画 - 向上滑出并淡出 */
@keyframes slideUpFadeOut {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
}

.notification-item.removing {
    animation: slideUpFadeOut 0.4s ease-out forwards;
}

/* 多个通知堆叠间距 */
.notification-item + .notification-item {
    margin-top: 12px;
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
    .notifications-container {
        top: 110px; /* 平板设备调整 */
        max-width: 90%;
        padding: 0 20px;
    }
    
    .notification-item {
        max-width: 100%;
        padding: 18px 20px;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 768px) {
    .notifications-container {
        top: 95px;
        max-width: 100%;
        padding: 0 12px;
    }
    
    .notification-item {
        border-radius: 12px;
        padding: 16px;
    }
    
    .notification-title {
        font-size: 15px;
    }
    
    .notification-title::before {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .notification-content {
        font-size: 13px;
        margin-left: 40px;
    }
    
    .notification-time {
        font-size: 11px;
        margin-left: 40px;
    }
    
    .notification-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .notifications-container {
        top: 85px;
        padding: 0 8px;
    }
    
    .notification-item {
        border-radius: 10px;
        padding: 14px 12px;
    }
    
    .notification-header {
        gap: 12px;
    }
    
    .notification-title {
        font-size: 14px;
        gap: 10px;
    }
    
    .notification-title::before {
        width: 26px;
        height: 26px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    .notification-content {
        font-size: 12px;
        margin-left: 36px;
        line-height: 1.5;
    }
    
    .notification-time {
        font-size: 10px;
        margin-left: 36px;
        margin-top: 8px;
    }
    
    .notification-close {
        width: 28px;
        height: 28px;
        font-size: 14px;
        padding: 6px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .notification-item {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                    0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .notification-title {
        color: #e2e8f0;
    }
    
    .notification-content {
        color: #cbd5e0;
    }
    
    .notification-time {
        color: #a0aec0;
    }
    
    .notification-close {
        background: rgba(255, 255, 255, 0.1);
        color: #cbd5e0;
    }
    
    .notification-close:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #e2e8f0;
    }
}

/* 首页内容编辑样式 */
.homepage-editor {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.editor-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.editor-content {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.features-editor {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.feature-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.feature-title-input {
    flex: 1;
    margin-right: 10px;
}

.feature-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.feature-remove:hover {
    background: #c82333;
}

.feature-icon-input {
    width: 100%;
    margin-bottom: 10px;
}

.feature-description-input {
    width: 100%;
    min-height: 60px;
}

.add-feature-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
}

.add-feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.save-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 通知管理样式 */
.notifications-editor {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item-admin {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.notification-item-admin:last-child {
    margin-bottom: 0;
}

.notification-type-select {
    width: 100px;
    margin-right: 10px;
}

.notification-status-select {
    width: 100px;
    margin-right: 10px;
}

.notification-sort-input {
    width: 80px;
    margin-right: 10px;
}

.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-update {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-update:hover {
    background: #0056b3;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-delete:hover {
    background: #c82333;
}

/* 同步状态显示 */
.sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.sync-status span {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 编辑器头部布局调整 */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.editor-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .notifications-container {
        position: static;
        max-width: none;
        margin: 10px;
    }
    
    .notification-item {
        margin-bottom: 10px;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .feature-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .feature-title-input {
        margin-right: 0;
    }
    
    .notification-actions {
        flex-direction: column;
    }
}

