/* ==============================
   项目19：字体展示平台
   Font Showcase
   ============================== */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ========== 侧边栏索引 ========== */
.sidebar {
    width: 280px;
    background: #fff;
    padding: 30px 20px;
    border-right: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 10px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid #000;
}

.sidebar-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #000;
}

.nav-link.active {
    background: #000;
    color: #fff;
}

.nav-category {
    font-size: 0.85rem;
    color: #999;
    margin: 20px 0 10px 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    padding: 40px;
    background: #fff;
}

header {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 2px solid #000;
    margin-bottom: 40px;
}

.title {
    font-size: 2.5rem;
    color: #000;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

/* ========== 字体网格 ========== */
.fonts-grid {
    display: grid;
    gap: 40px;
}

/* ========== 分类标题 ========== */
.font-category {
    padding: 10px 0;
}

.category-title {
    font-size: 1.8rem;
    color: #000;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #000;
    font-weight: 600;
}

/* ========== 字体卡片 ========== */
.font-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.font-card:hover {
    transform: translateX(5px);
    border-color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.font-card:last-child {
    margin-bottom: 0;
}

/* ========== 字体名称 ========== */
.font-name {
    font-size: 1.3rem;
    color: #000;
    margin-bottom: 15px;
    font-weight: 600;
}

/* ========== 字体示例 ========== */
.font-sample {
    font-size: 1.4rem;
    line-height: 1.7;
    color: #000;
    margin-bottom: 12px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #000;
}

/* 第一个示例（英文）- 有左边框 */
.font-card > .font-sample:first-of-type {
    border-left: 3px solid #000;
}

/* 第二个示例（中文）- 无左边框，灰色背景 */
.font-card > .font-sample:nth-of-type(2) {
    border-left: none;
    background: #f5f5f5;
    color: #333;
}

/* 最后一个示例不需要底部间距 */
.font-card > .font-sample:last-of-type {
    margin-bottom: 15px;
}

/* ========== 字体信息 ========== */
.font-info {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* ========== 页脚 ========== */
footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

/* ========== 语言筛选按钮 ========== */
.lang-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}

.lang-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    border-color: #000;
    color: #000;
}

.lang-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ========== 分类隐藏 ========== */
.font-category.hidden {
    display: none;
}

/* ========== 响应式设计 ========== */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 20px;
    }

    .main-content {
        padding: 30px 20px;
    }

    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-category {
        display: none;
    }

    .nav-item {
        margin-bottom: 0;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        background: #f5f5f5;
    }

    .nav-link.active {
        background: #000;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .font-sample {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }

    .title {
        font-size: 1.6rem;
    }

    .font-card {
        padding: 20px 15px;
    }

    .font-sample {
        font-size: 1rem;
        padding: 15px;
    }
}

/* ========== 模态窗口样式 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #000;
    padding: 80px 60px;
    max-width: 100%;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
}

.modal-font-name {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}

.modal-font-info {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 60px;
    font-style: italic;
}

.modal-sample {
    font-size: 4rem;
    line-height: 1.6;
    color: #fff;
    margin-bottom: 40px;
    padding: 40px;
    text-align: center;
    width: 100%;
    max-width: 1400px;
}

.modal-sample-large {
    font-size: 6rem;
    font-weight: 600;
    margin-bottom: 50px;
    padding: 50px 20px;
    line-height: 1.4;
}

/* 字体卡片添加点击提示 */
.font-card {
    cursor: pointer;
    position: relative;
}

.font-card::after {
    content: '点击全屏查看';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.75rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.font-card:hover::after {
    opacity: 1;
}

@media (max-width: 1024px) {
    .modal-content {
        padding: 60px 40px;
    }

    .modal-font-name {
        font-size: 2.5rem;
    }

    .modal-sample {
        font-size: 3rem;
        padding: 30px;
    }

    .modal-sample-large {
        font-size: 4.5rem;
        padding: 40px 15px;
    }

    .modal-close {
        width: 50px;
        height: 50px;
        font-size: 28px;
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 40px 30px;
    }

    .modal-font-name {
        font-size: 2rem;
    }

    .modal-font-info {
        font-size: 1rem;
        margin-bottom: 40px;
    }

    .modal-sample {
        font-size: 2rem;
        padding: 20px;
    }

    .modal-sample-large {
        font-size: 3rem;
        padding: 30px 15px;
    }

    .modal-close {
        width: 45px;
        height: 45px;
        font-size: 24px;
        top: 15px;
        right: 15px;
    }

    .font-card::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
    }

    .modal-font-name {
        font-size: 1.5rem;
    }

    .modal-sample {
        font-size: 1.5rem;
        padding: 15px;
    }

    .modal-sample-large {
        font-size: 2rem;
        padding: 20px 10px;
        line-height: 1.3;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
