/* ========================================
   字体详情页样式
   ======================================== */

/* 页面容器 - 左右布局 */
main.font-detail-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}
.font-detail-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 28px;
    align-items: flex-start;
}
.font-main-content {
    flex: 1;
    min-width: 0;
    order: 1;
}

/* 侧边栏 */
.font-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    order: 2;
    box-sizing: border-box;
}
.sidebar-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.sidebar-title .icon {
    font-size: 16px;
}
.sidebar-font-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-font-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.sidebar-font-item:hover {
    background: #fff;
    border-color: #6366f1;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}
.sidebar-font-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-font-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.sidebar-font-info {
    flex: 1;
    min-width: 0;
}
.sidebar-font-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.sidebar-font-meta {
    font-size: 11px;
    color: #94a3b8;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    flex-wrap: wrap;
}
.breadcrumb-item {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-item:hover {
    color: #4f46e5;
    text-decoration: underline;
}
.breadcrumb-sep {
    color: #94a3b8;
}
.breadcrumb-current {
    color: #64748b;
}

/* 上一个/下一个导航 */
.font-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 24px;
    margin-top: 40px;
}
.font-nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.font-nav-item:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.18);
    transform: translateY(-3px);
}
.font-nav-item.prev {
    flex-direction: row;
}
.font-nav-item.next {
    flex-direction: row-reverse;
    text-align: right;
}
.font-nav-arrow {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 12px;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.font-nav-info {
    flex: 1;
    min-width: 0;
}
.font-nav-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}
.font-nav-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.font-nav-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    background: #f8f9fb;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    color: #94a3b8;
    font-size: 13px;
}

/* 推荐/热门字体区块 */
.font-section {
    margin-top: 40px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.font-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.font-section-title .icon {
    font-size: 22px;
}
.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.font-grid-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.font-grid-item:hover {
    background: #fff;
    border-color: #6366f1;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.font-grid-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.font-grid-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}
.font-grid-info {
    flex: 1;
    min-width: 0;
}
.font-grid-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.font-grid-meta {
    font-size: 12px;
    color: #64748b;
}

/* 字体头部卡片 */
.font-header-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.font-header-top {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 20px;
}
.font-icon-large {
    width: 88px;
    height: 88px;
    border-radius: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}
.font-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}
.font-header-info {
    flex: 1;
}
.font-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px 0;
    letter-spacing: -0.5px;
}
.font-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.font-tag {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.font-tag.category {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}
.font-tag.license {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.font-tag.author {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* 头部下载按钮 */
.header-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.header-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}

/* 预览区域 */
.font-preview-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.section-title .icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.font-preview-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
/* 体验字体按钮 */
.load-font-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.load-font-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.load-font-btn:disabled {
    cursor: default;
    opacity: 0.9;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 10px;
}
.control-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.control-group input[type="range"] {
    width: 100px;
    accent-color: #818cf8;
}
.control-group input[type="color"] {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}
.size-value {
    font-size: 13px;
    color: #818cf8;
    font-weight: 600;
    min-width: 42px;
}

/* 预设文字按钮 */
.preset-texts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.preset-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.preset-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* 预览输入框 */
.font-preview-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    margin-bottom: 20px;
    transition: all 0.2s;
    box-sizing: border-box;
}
.font-preview-input::placeholder {
    color: #94a3b8;
}
.font-preview-input:focus {
    outline: none;
    border-color: #5b6cf0;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91, 108, 240, 0.1);
}

/* 预览显示区 */
.font-preview-display {
    min-height: 160px;
    padding: 40px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
    position: relative;
}
.font-preview-display::before {
    content: '预览效果';
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.font-preview-text {
    font-size: 48px;
    color: #1e293b;
    transition: all 0.2s;
    line-height: 1.4;
}

/* 字符集预览 */
.charset-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    overflow-x: auto;
}
.charset-title {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.charset-chars {
    font-size: 20px;
    line-height: 2.2;
    color: #1e293b;
    letter-spacing: 2px;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* 字体信息卡片 */
.font-info-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.font-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.font-info-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}
.font-info-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.font-info-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.font-info-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
}

/* 字体详细信息 */
.font-meta-detail {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.font-meta-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 下载区域 */
.download-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #d1fae5;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}
.font-variant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}
.font-variant-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.font-variant-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.font-variant-meta {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}
.latest-tag {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    border-radius: 12px;
    font-size: 11px;
    color: #fff;
    margin-left: 8px;
    font-weight: 500;
}
.download-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}
.no-download {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}
.font-meta-item {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}
.font-meta-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.font-meta-item:first-child {
    padding-top: 0;
}
.font-meta-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}
.font-meta-value {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.6;
    word-break: break-word;
}
.font-meta-value a {
    color: #5b6cf0;
    text-decoration: none;
    margin-right: 16px;
}
.font-meta-value a:hover {
    text-decoration: underline;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 900px) {
    .font-detail-layout {
        flex-direction: column !important;
    }
    .font-sidebar {
        width: 100% !important;
        position: static;
        display: block;
        order: 3;
    }
    .sidebar-section {
        margin-bottom: 16px;
        width: 100%;
    }
    .sidebar-font-item {
        width: 100%;
    }
    .font-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .font-nav {
        flex-direction: column;
        gap: 12px;
    }
    .font-nav-item {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .font-sidebar {
        width: 100% !important;
    }
    .sidebar-section {
        width: 100%;
        box-sizing: border-box;
    }
    main.font-detail-page { padding: 16px; }
    .font-header-card { padding: 20px; }
    .font-header-top { flex-direction: column; align-items: center; text-align: center; }
    .font-icon-large { width: 64px; height: 64px; font-size: 28px; }
    .font-title { font-size: 22px; }
    .font-tags { justify-content: center; }
    .font-preview-section { padding: 20px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .font-preview-controls { width: 100%; }
    .control-group { flex: 1; justify-content: space-between; }
    .font-preview-text { font-size: 32px; }
    .font-info-grid { grid-template-columns: 1fr 1fr; }
    .font-info-section { padding: 20px; }
    .download-section { padding: 20px; }
    .font-variant-item { flex-direction: column; gap: 12px; align-items: flex-start; }
    .header-download-btn { padding: 10px 18px; font-size: 14px; }
}

@media (max-width: 600px) {
    .font-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .font-info-grid { grid-template-columns: 1fr; }
    .preset-texts { justify-content: center; }
    .font-header-top { flex-direction: column; }
    .header-download-btn { width: 100%; justify-content: center; margin-top: 16px; }
    .charset-chars { font-size: 16px; letter-spacing: 1px; }
    .charset-section { padding: 16px; }
}
