/* 组件样式 */

/* 发布按钮 */
.publish-btn {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    cursor: pointer;
    box-shadow: var(--shadow-heavy);
    transition: all 0.3s ease;
    z-index: 1000;
}

.publish-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(41, 121, 255, 0.4);
}

/* 发布按钮内图标绝对居中 */
.publish-btn i,
.publish-btn .fas,
.publish-btn .fab,
.publish-btn .far {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
}

.publish-btn .fas::before,
.publish-btn .fab::before,
.publish-btn .far::before {
    display: block;
    line-height: 1;
}

/* 发布弹窗 */
.publish-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.publish-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-heavy);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.publish-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--text-primary);
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-round);
    background-color: var(--bg-gray);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: var(--error-color);
    color: white;
}

.modal-body {
    padding: var(--spacing-xl);
}

.publish-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-lg);
}

.option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    border-radius: var(--radius-medium);
    background-color: var(--bg-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.option-item:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.option-item i {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.option-item span {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-round);
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: var(--radius-small);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-small);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    border-radius: var(--radius-small);
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: var(--font-size-xs);
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-primary) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 返回顶部按钮样式（保证图标可见） */
.scroll-to-top svg {
    width: 20px;
    height: 20px;
}

.scroll-to-top {
    color: #fff;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background-color: var(--error-color);
    color: white;
    border-radius: var(--radius-round);
    font-size: var(--font-size-xs);
    font-weight: bold;
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

/* 分割线 */
.divider {
    height: 1px;
    background-color: var(--border-light);
    margin: var(--spacing-md) 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background-color: var(--border-light);
    margin: 0 var(--spacing-md);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .publish-btn {
        bottom: var(--spacing-lg);
        right: var(--spacing-lg);
        width: 50px;
        height: 50px;
        font-size: var(--font-size-lg);
    }
    
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .publish-options {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .option-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .option-item i {
        margin-bottom: 0;
        margin-right: var(--spacing-md);
    }
}

@media (max-width: 576px) {
    .publish-btn {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .modal-header,
    .modal-body {
        padding: var(--spacing-md);
    }
}
