/* ==========================================================
   字体演示页专用样式（列表现代化）
   设计规范见项目根目录 .design-spec.md
   ========================================================== */

.font-body {
    background: #f8fafc !important;
}

.font-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

/* ---------- 字体选择网格 ---------- */
.font-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.font-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    padding: 20px 22px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    font-family: inherit;
}

.font-card:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.font-card.active {
    background: #f0fdfa;
    border-color: #e2e8f0;
}

.font-card.active::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #14b8a6;
}

.font-card.active::after {
    content: '';
    position: absolute;
    top: 19px;
    right: 17px;
    width: 10px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg);
}

.font-card h4 {
    font-size: 1rem;
    font-weight: 650;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.font-card p {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

.font-badge {
    font-size: 0.68rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.font-card.active .font-badge {
    background: #ffffff;
    color: #0d9488;
}

/* ---------- 通用面板 ---------- */
.font-panel {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 20px;
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.font-panel-title {
    position: relative;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    padding-left: 16px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.font-panel-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 4px;
    background: #cbd5e1;
}

.font-panel-title i {
    color: #64748b;
    font-size: 0.95rem;
}

/* ---------- 引用代码（终端窗口，签名元素） ---------- */
.font-terminal {
    background: #141414;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #545454;
}

.font-terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #202020;
}

.font-terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.font-terminal-dot:nth-child(1) { background: #f87171; }
.font-terminal-dot:nth-child(2) { background: #fbbf24; }
.font-terminal-dot:nth-child(3) { background: #34d399; }

.font-terminal-title {
    margin-left: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    font-size: 0.75rem;
    color: #64748b;
}

.font-copy-btn {
    margin-left: auto;
    background: rgba(148, 163, 184, 0.15);
    border: none;
    color: #cbd5e1;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.font-copy-btn:hover {
    background: #334155;
    color: #ffffff;
}

.font-copy-btn.copied {
    background: #059669;
    color: #ffffff;
}

.font-terminal-body {
    padding: 14px 0;
    overflow-x: auto;
}

/* 代码块样式完全由 Prism okaidia 主题控制，不做任何覆盖 */

/* ---------- 预览控制条 ---------- */
.font-controls {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.font-controls > div {
    flex: 1;
    min-width: 200px;
}

.font-controls label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.font-controls input,
.font-controls select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.font-controls input:focus,
.font-controls select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.15);
    background: #ffffff;
}

/* ---------- 字号梯度预览 ---------- */
.font-size-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #eef2f7;
}

.font-size-row:last-child {
    border-bottom: none;
}

.font-size-label {
    width: 52px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: right;
    flex-shrink: 0;
}

.font-size-sample {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #0f172a;
}

.font-size-end {
    width: 52px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    font-size: 0.78rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* ---------- 鸣谢 ---------- */
.font-credit {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-left: 4px solid #0ea5e9;
    padding: 14px 18px;
    border-radius: 10px;
    color: #0369a1;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.font-credit a {
    color: #0ea5e9;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .font-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .font-container {
        padding: 16px 14px 40px;
    }

    .font-head {
        align-items: flex-start;
    }

    .font-grid {
        grid-template-columns: 1fr;
    }

    .font-panel {
        padding: 16px;
    }

    .font-size-row {
        gap: 10px;
    }
}
