/*
 * JunYiXiao Studio - Web Frontend CSS
 * Bootstrap 5 + Mac Glassmorphism Style
 */

/* ========== CSS Variables ========== */
:root {
    --jyx-primary: #0056b3;
    --jyx-secondary: #00a8cc;
    --jyx-accent: #ff6b6b;
    --jyx-dark-bg: #0f172a;
    --jyx-light-bg: #f8fafc;
    --jyx-glass-bg: rgba(255, 255, 255, 0.7);
    --jyx-glass-border: rgba(255, 255, 255, 0.5);
    --jyx-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --jyx-card-radius: 16px;
    --jyx-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    --jyx-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Base Reset ========== */
body {
    font-family: var(--jyx-font);
    background-color: var(--jyx-light-bg);
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.ls-1 { letter-spacing: 0.05em; }

a { transition: color var(--jyx-transition); }

/* ========== Navbar - Glassmorphism ========== */
.navbar-glass {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 0.75rem 0;
    transition: all var(--jyx-transition);
}

.navbar-glass.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--jyx-primary) !important;
    letter-spacing: -0.5px;
}

.navbar-brand .brand-sub {
    font-weight: 300;
    color: #94a3b8 !important;
    font-size: 0.9em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 0.92rem;
    color: #475569 !important;
    padding: 0.5rem 1rem !important;
    margin: 0 2px;
    border-radius: 8px;
    transition: all var(--jyx-transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--jyx-primary) !important;
    background: rgba(0, 86, 179, 0.06);
}

/* ========== Hero Section (Homepage) ========== */
.hero-section {
    position: relative;
    padding: 120px 0 80px;
    background: radial-gradient(circle at top right, rgba(0, 168, 204, 0.08), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 86, 179, 0.08), transparent 40%);
    overflow: hidden;
}

.hero-title {
    font-weight: 800;
    font-size: 2.8rem;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--jyx-primary), var(--jyx-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* ========== Page Hero (Inner Pages) ========== */
.page-hero {
    padding: 110px 0 50px;
    background: radial-gradient(circle at top right, rgba(0, 168, 204, 0.06), transparent 50%),
                radial-gradient(circle at bottom left, rgba(0, 86, 179, 0.06), transparent 50%);
}

.page-hero .hero-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.page-hero .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 0;
}

/* ========== Feature Cards ========== */
.feature-card {
    background: white;
    border-radius: var(--jyx-card-radius);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1.75rem;
    height: 100%;
    transition: all var(--jyx-transition);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--jyx-glass-shadow);
    border-color: var(--jyx-secondary);
}

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--jyx-primary);
}

.icon-box.green {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #15803d;
}

.icon-box.orange {
    background: linear-gradient(135deg, #fff7ed, #ffedd5);
    color: #c2410c;
}

.icon-box.purple {
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    color: #7e22ce;
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.badge-h { background: #e0f2fe; color: #0369a1; }
.badge-c { background: #f0fdf4; color: #15803d; }
.badge-new { background: #fef3c7; color: #92400e; }

/* ========== Article Card (列表卡片) ========== */
.article-card {
    background: white;
    border-radius: var(--jyx-card-radius);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all var(--jyx-transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: var(--jyx-secondary);
}

.article-card .card-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
}

.article-card .card-cover-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 50%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jyx-primary);
    font-size: 2.5rem;
    opacity: 0.6;
}

.article-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.article-card .card-title a:hover {
    color: var(--jyx-primary);
}

.article-card .card-summary {
    font-size: 0.88rem;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-card .card-meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== Journal Card (顶刊分析) ========== */
.journal-card {
    background: white;
    border-radius: var(--jyx-card-radius);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    transition: all var(--jyx-transition);
    height: 100%;
}

.journal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: var(--jyx-secondary);
}

.journal-card .journal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    margin-bottom: 0.75rem;
}

.journal-card .if-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ========== Section Titles ========== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header .section-tag {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--jyx-primary);
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1rem;
    color: #64748b;
}

/* ========== Article Detail ========== */
.article-detail {
    max-width: 860px;
    margin: 0 auto;
    background: white;
    border-radius: var(--jyx-card-radius);
    padding: 2.5rem;
    border: 1px solid #e2e8f0;
}

.article-detail .detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

.article-detail .detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2rem;
}

.article-detail .detail-content {
    font-size: 1rem;
    line-height: 1.85;
    color: #334155;
}

.article-detail .detail-content h2,
.article-detail .detail-content h3,
.article-detail .detail-content h4 {
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-detail .detail-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-detail .detail-content pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.article-detail .detail-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ========== Tool Cards ========== */
.tool-card {
    background: white;
    border-radius: var(--jyx-card-radius);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    text-align: center;
    transition: all var(--jyx-transition);
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--jyx-glass-shadow);
    border-color: var(--jyx-secondary);
}

.tool-card .tool-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 1.25rem;
}

.tool-card .tool-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.tool-card .tool-status.available {
    background: #f0fdf4;
    color: #15803d;
}

.tool-card .tool-status.coming-soon {
    background: #fef3c7;
    color: #92400e;
}

/* ========== Update Timeline (首页动态) ========== */
.update-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background var(--jyx-transition);
}

.update-item:last-child {
    border-bottom: none;
}

.update-item:hover {
    background: #f8fafc;
    border-radius: 8px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.update-item .update-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.update-item .update-info {
    flex: 1;
    min-width: 0;
}

.update-item .update-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-item .update-title a {
    color: inherit;
    text-decoration: none;
}

.update-item .update-title a:hover {
    color: var(--jyx-primary);
}

.update-item .update-date {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ========== Registration Dynamic ========== */
.reg-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
}

.reg-item .reg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe, #bfdbfe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jyx-primary);
    font-size: 14px;
    flex-shrink: 0;
}

/* ========== QR Code Section ========== */
.qr-section {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-radius: var(--jyx-card-radius);
    padding: 2.5rem;
    text-align: center;
}

.qr-section .qr-img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    margin: 1rem auto;
    background: white;
    padding: 8px;
}

/* ========== Pagination ========== */
.jyx-pagination .page-link {
    color: var(--jyx-primary);
    border-radius: 8px !important;
    margin: 0 3px;
    border: 1px solid #e2e8f0;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    transition: all var(--jyx-transition);
}

.jyx-pagination .page-item.active .page-link {
    background-color: var(--jyx-primary);
    border-color: var(--jyx-primary);
    color: white;
}

.jyx-pagination .page-link:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* ========== Footer ========== */
.jyx-footer {
    background: var(--jyx-dark-bg);
    color: #94a3b8;
    padding: 60px 0 30px;
}

.jyx-footer h5 {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.jyx-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color var(--jyx-transition);
}

.jyx-footer a:hover {
    color: white;
}

.jyx-footer .footer-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
}

.jyx-footer .footer-links li {
    margin-bottom: 0.5rem;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ========== Responsive ========== */
@media (max-width: 991px) {
    .hero-section {
        padding: 100px 0 60px;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .page-hero {
        padding: 90px 0 40px;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 90px 0 50px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .page-hero .hero-title {
        font-size: 1.6rem;
    }
    .section-header h2 {
        font-size: 1.5rem;
    }
    .article-detail {
        padding: 1.5rem;
    }
    .article-detail .detail-title {
        font-size: 1.35rem;
    }
    .feature-card {
        padding: 1.25rem;
    }
    .navbar-nav .nav-link {
        margin: 2px 0;
    }
}

/* 单词本 Popover */
.jyx-vocab-popover-body {
    max-width: 320px;
    max-height: 240px;
    overflow-y: auto;
}
.popover { max-width: 340px; }
