/* ========================================
   字体管理器 - 磨砂玻璃高级设计
   黑白灰配色 | iOS风格 | 极简主义
======================================== */

/* 主容器 */
.font-manager-content {
    padding: 0;
    background: #f5f5f7;
    overflow-y: auto;
    height: calc(100% - 60px);
}

/* ========================================
   顶部操作区 - 磨砂玻璃效果
======================================== */
.font-manager-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px 20px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.font-manager-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.font-import-btn,
.font-reset-btn {
    flex: 1;
    max-width: 180px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.font-import-btn {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.font-import-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.font-import-btn:active {
    transform: translateY(0);
}

.font-reset-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}

.font-reset-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ========================================
   字体列表 - 卡片式设计
======================================== */
.font-list-section {
    padding: 20px;
}

.font-list-title {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.font-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   字体项 - 磨砂卡片
======================================== */
.font-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.font-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

.font-item.active {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

.font-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.font-item-name {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.2px;
}

.font-item-actions {
    display: flex;
    gap: 8px;
}

.font-active-badge {
    background: #000000;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.font-apply-btn,
.font-delete-btn {
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.3px;
}

.font-apply-btn {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

.font-apply-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.font-delete-btn {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.font-delete-btn:hover {
    background: rgba(255, 59, 48, 0.15);
    transform: translateY(-1px);
}

/* 字体预览 */
.font-preview {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
}

/* 空状态 */
.empty-state-text {
    text-align: center;
    color: #86868b;
    padding: 80px 20px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ========================================
   导入模态框 - 磨砂玻璃设计
======================================== */
.font-import-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.font-import-modal.show {
    display: flex;
}

.font-import-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.font-import-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 0.5px solid rgba(255, 255, 255, 0.8);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.font-import-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px 24px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

.font-import-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

.font-import-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    font-size: 20px;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.font-import-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.font-import-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.font-import-field {
    margin-bottom: 20px;
}

.font-import-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.2px;
}

.font-input {
    width: 100%;
    padding: 12px 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.02);
    color: #1a1a1a;
}

.font-input:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.04);
}

.font-file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.font-file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.font-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.font-file-label:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.3);
}

.font-file-name {
    margin-top: 8px;
    font-size: 13px;
    color: #86868b;
}

.font-import-tips {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    font-size: 12px;
    color: #86868b;
    line-height: 1.6;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.font-import-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px 24px 24px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.font-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.3px;
}

.font-btn-cancel {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
}

.font-btn-cancel:hover {
    background: rgba(0, 0, 0, 0.08);
}

.font-btn-import {
    background: #000000;
    color: #ffffff;
}

.font-btn-import:hover {
    background: #1a1a1a;
}

.font-btn:active {
    transform: scale(0.98);
}

/* ========================================
   响应式设计 - 移动端优化
======================================== */
@media (max-width: 768px) {
    .font-manager-header {
        padding: 20px 16px;
    }
    
    .font-manager-actions {
        gap: 10px;
    }
    
    .font-import-btn,
    .font-reset-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .font-list-section {
        padding: 16px;
    }
    
    .font-item {
        padding: 16px;
    }
    
    .font-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .font-item-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .font-preview {
        font-size: 14px;
        padding: 14px;
    }
    
    .font-import-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .font-import-header {
        padding: 20px;
    }
    
    .font-import-body {
        padding: 20px;
    }
    
    .font-import-footer {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .font-manager-content {
        padding: 0;
    }
    
    .font-manager-header {
        padding: 16px 12px;
    }
    
    .font-manager-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .font-import-btn,
    .font-reset-btn {
        max-width: 100%;
        width: 100%;
        padding: 14px 20px;
    }
    
    .font-list-section {
        padding: 12px;
    }
    
    .font-list-title {
        font-size: 12px;
    }
    
    .font-item {
        padding: 14px;
        border-radius: 14px;
    }
    
    .font-item-name {
        font-size: 16px;
    }
    
    .font-item-date {
        font-size: 11px;
    }
    
    .font-item-actions {
        width: 100%;
        gap: 6px;
    }
    
    .font-active-badge,
    .font-apply-btn,
    .font-delete-btn {
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .font-preview {
        font-size: 13px;
        padding: 12px;
        line-height: 1.8;
    }
    
    .font-import-container {
        width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
    
    .font-import-header h3 {
        font-size: 18px;
    }
    
    .font-import-field label {
        font-size: 12px;
    }
    
    .font-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .font-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .font-import-btn,
    .font-reset-btn,
    .font-apply-btn,
    .font-delete-btn,
    .font-btn {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .font-item {
        touch-action: manipulation;
    }
}

/* 滚动条样式 */
.font-manager-content::-webkit-scrollbar,
.font-import-body::-webkit-scrollbar {
    width: 8px;
}

.font-manager-content::-webkit-scrollbar-track,
.font-import-body::-webkit-scrollbar-track {
    background: transparent;
}

.font-manager-content::-webkit-scrollbar-thumb,
.font-import-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.font-manager-content::-webkit-scrollbar-thumb:hover,
.font-import-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}