/* ═══════════════════════════
   Index — Editorial Magazine
   ═══════════════════════════ */

/* ── Hero — Magazine Cover Style ── */
.hero {
    text-align: center; padding: 56px 0 20px;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--accent);
    margin-bottom: 20px;
}
.hero-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--accent); }
.hero-eyebrow::after { content: ''; width: 24px; height: 1px; background: var(--accent); }

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem; font-weight: 800; letter-spacing: -1px;
    line-height: 1.1; margin-bottom: 12px; color: var(--text);
}
.hero h1 em { font-style: italic; color: var(--accent); }

.hero .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 16px; color: var(--text-muted);
    max-width: 480px; margin: 0 auto 28px;
    line-height: 1.6;
}

.hero-actions { display: flex; justify-content: center; gap: 12px; margin-bottom: 20px; }

@media (max-width: 768px) {
    .hero h1 { font-size: 2.25rem; }
    .hero { padding: 32px 0 16px; }
}

/* ── Stats Bar — Bento Grid KPI Cards ── */
.stats-bar {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    transition: all .25s var(--ease);
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.stat-card:first-child {
    background: var(--accent);
    color: #fff; border-color: var(--accent);
}
.stat-card:first-child .stat-num { color: #fff; font-size: 36px; }
.stat-card:first-child .stat-lbl { color: rgba(255,255,255,.75); }
.stat-card:first-child .stat-sparkline { opacity: .25; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 28px; font-weight: 700; color: var(--accent);
    position: relative; z-index: 1;
}
.stat-card .stat-lbl {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 500;
    position: relative; z-index: 1;
}
/* Pure CSS sparkline — horizontal mini bar chart */
.stat-sparkline {
    position: absolute; bottom: 0; left: 0; right: 0; height: 28px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--accent) 100%
    );
    opacity: .06; z-index: 0;
    clip-path: polygon(
        0% 90%, 12% 65%, 25% 78%, 38% 50%, 50% 62%,
        62% 45%, 75% 55%, 88% 30%, 100% 40%,
        100% 100%, 0% 100%
    );
}
.stat-card:first-child .stat-sparkline {
    background: linear-gradient(180deg, transparent 0%, #fff 100%);
    opacity: .12;
}
@media (max-width: 768px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .stat-card:first-child { grid-column: span 2; }
}
@media (max-width: 400px) {
    .stats-bar { grid-template-columns: 1fr; }
    .stat-card:first-child { grid-column: span 1; }
    .stat-card { padding: 14px 16px; }
    .stat-card .stat-num { font-size: 24px; }
    .stat-card:first-child .stat-num { font-size: 28px; }
}

/* ── Section Header ── */
.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 2px solid var(--text);
}
.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem; font-weight: 700;
}
.section-header .count {
    font-family: 'Inter', sans-serif;
    font-size: 13px; color: var(--text-muted);
}

/* ── Tab Bar ── */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--text); margin-bottom: 28px; }
.tab-bar .tab {
    padding: 12px 28px; font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
    color: var(--text-muted); cursor: pointer; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: all .2s; letter-spacing: .2px;
}
.tab-bar .tab:hover { color: var(--text); }
.tab-bar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Filter Pills ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-row.market-row { margin-bottom: 24px; }
.filter-row.market-row .filter-pill { font-size: 12px; padding: 6px 14px; }
.filter-pill {
    padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; font-family: 'Inter', sans-serif;
    cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
    transition: all .2s; min-height: 36px;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Doc Type Pill ── */
.pill-doctype {
    background: #f0f9ff; color: #0369a1; font-weight: 600;
    font-size: 11px; padding: 2px 8px; border-radius: 999px;
    border: 1px solid #bae6fd;
}

/* ── Card Grid — Bento Asymmetric Layout ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.report-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px;
    box-shadow: var(--shadow-sm); transition: all .3s var(--ease);
    animation: fadeUp .5s var(--ease-out) both;
    position: relative; display: flex; flex-direction: column;
}
/* First card: featured — spans 2 columns, larger */
.report-card:first-child {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--surface) 0%, #fafaf9 100%);
    border-left: 3px solid var(--accent);
}
.report-card:first-child .card-title { font-size: 22px; }
.report-card:first-child .card-summary { -webkit-line-clamp: 4; font-size: 15px; }
@media (max-width: 900px) { .report-card:first-child { grid-column: span 2; } }
@media (max-width: 600px) { .report-card:first-child { grid-column: span 1; } .report-card:first-child .card-title { font-size: 18px; } }

/* Every 4th card in a 3-col grid: accent treatment */
.report-card:nth-child(5n+1) {
    border-top: 2px solid var(--accent-light);
}

.report-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.report-card:nth-child(1) { animation-delay: .03s; }
.report-card:nth-child(2) { animation-delay: .06s; }
.report-card:nth-child(3) { animation-delay: .09s; }
.report-card:nth-child(4) { animation-delay: .12s; }
.report-card:nth-child(5) { animation-delay: .15s; }
.report-card:nth-child(6) { animation-delay: .18s; }
.report-card:nth-child(7) { animation-delay: .21s; }
.report-card:nth-child(8) { animation-delay: .24s; }
.report-card:nth-child(9) { animation-delay: .27s; }

/* Card category tag */
.card-inst {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .8px; padding: 3px 10px; border-radius: 3px;
    background: var(--accent-light); color: var(--accent);
    margin-bottom: 10px;
}
.card-time { font-size: 12px; color: var(--text-muted); }

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px; font-weight: 700; line-height: 1.3;
    margin-bottom: 12px; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-metrics { display: flex; gap: 6px; margin-bottom: 10px; }
.card-metric {
    background: var(--bg); border-radius: 4px; padding: 7px 10px; flex: 1; min-width: 0;
}
.card-metric .m-label { font-size: 9px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.card-metric .m-value { font-size: 14px; font-weight: 700; color: var(--text); }
.m-green { color: var(--green) !important; }
.m-purple { color: var(--purple) !important; }
.m-blue { color: var(--accent) !important; }

.card-summary {
    font-size: 14px; color: var(--text-secondary); line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border-light); }
.card-stats { font-size: 12px; color: var(--text-muted); }

/* ── 收藏按钮 — Chip 风格 ── */
.fav-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; min-height: 38px;
    border-radius: 999px;
    font-size: 12px; font-weight: 500; font-family: 'Inter', sans-serif;
    cursor: pointer; user-select: none;
    background: var(--surface); color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all .2s;
}
.fav-btn:hover { border-color: var(--amber); color: var(--amber); }
.fav-btn--active {
    background: #fffbeb; color: var(--amber); border-color: var(--amber);
}
.fav-btn--active:hover { background: #fef3c7; }
.fav-icon { font-size: 14px; line-height: 1; }
.fav-label { font-size: 12px; }
.fav-count {
    font-size: 11px; font-weight: 600;
    background: var(--bg); color: var(--text-muted);
    padding: 1px 7px; border-radius: 999px;
    min-width: 18px; text-align: center;
}
.fav-btn--active .fav-count { background: var(--amber); color: #fff; }

@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
    .upload-hint { max-width: 100%; }
}

/* ── Upload Zone ── */
.upload-zone {
    max-width: 520px; margin: 0 auto;
    background: var(--surface); border: 2px dashed var(--border);
    border-radius: var(--radius-lg); padding: 56px 24px;
    text-align: center; cursor: pointer;
    transition: all .3s var(--ease);
}
.upload-zone:hover { border-color: var(--accent); background: #fafaf9; }
.upload-icon {
    width: 56px; height: 56px; margin: 0 auto 16px;
    background: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 4px 16px rgba(15,61,46,.15);
}
.upload-zone h3 { font-family: 'Playfair Display', serif; font-size: 18px; margin-bottom: 6px; color: var(--text); }
.upload-zone p { font-size: 14px; color: var(--text-muted); }

.progress-bar { width: 100%; height: 4px; background: var(--border-light); border-radius: 99px; margin-top: 18px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.progress-pct { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 8px; font-family: 'Inter', sans-serif; }

/* ── History ── */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 18px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    transition: all .15s;
}
.history-item:hover { box-shadow: var(--shadow-sm); }
.hi-info { flex: 1; min-width: 0; }
.hi-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.hi-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hi-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

@media (max-width: 768px) {
    .upload-zone { padding: 40px 16px; }
    .history-item { flex-direction: column; align-items: flex-start; }
    .hi-actions { width: 100%; }
    .hi-actions .btn { flex: 1; justify-content: center; }
}

/* ── Search Toolbar ── */
.lib-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.lib-search { flex: 1; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); transition: border-color .15s; }
.lib-search:focus { outline: none; border-color: var(--accent); }
.lib-search::placeholder { color: var(--text-muted); }
.lib-sort { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
