﻿/* =========================
   文章清單（單行列）UI
   class 皆以 al- 開頭
   ========================= */

.al-wrap {
    width: 100%;
}

.al-page {
    /*width: min(1440px, 100%);*/
    margin: 0 auto;
    padding: 14px 14px 22px;
    box-sizing: border-box;
}

/* ===== Filter ===== */
.al-filter {
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.06);
    overflow: clip;
}

.al-filter__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #fbfcfe;
    border-bottom: 1px solid #eef1f4;
}

.al-filter__title {
    font-weight: 900;
    color: #0f172a;
    letter-spacing: .2px;
}

.al-filter__meta {
    font-size: 13px;
    color: #475569;
}

.al-filter__body {
    padding: 12px 14px;
}

.al-filter__group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.al-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.al-field--grow {
    flex: 1;
    min-width: 260px;
}

.al-label {
    font-size: 12px;
    /*font-weight: 800;*/
    color: #64748b;
}

.al-select,
.al-input {
    height: 38px;
    border-radius: 12px;
    border: 1px solid #e6e9ee;
    background: #fff;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.al-select {
    min-width: 160px;
}

.al-input {
    width: 100%;
}

    .al-select:focus,
    .al-input:focus {
        border-color: #cfd6df;
        box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
    }

.al-btn {
    height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #e6e9ee;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    /*font-weight: 800;*/
    color: #0f172a;
}

.al-btn--ghost:hover {
    background: #f6f7f9;
}

/* ===== Empty ===== */
.al-empty {
    margin-top: 14px;
    padding: 18px;
    border: 1px dashed #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.al-empty__title {
    /*font-weight: 900;*/
    color: #111827;
    margin-bottom: 4px;
}

.al-empty__desc {
    color: #6b7280;
    font-size: 14px;
}

/* ===== List (single-line rows) ===== */
.al-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.al-row {
    display: grid;
    grid-template-columns: 1fr auto; /* item + edit */
    gap: 10px;
    align-items: stretch;
}

.al-item {
    display: grid;
    grid-template-columns: auto auto minmax(240px, 1fr) 220px; /* date / chips / title / count */
    gap: 12px;
    align-items: center;
    padding: 12px 12px;
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 14px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.05);
}

    .al-item:hover {
        border-color: #e4e8ee;
        box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
    }

    .al-item:focus {
        box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08), 0 10px 26px rgba(16, 24, 40, 0.08);
    }

.al-item__date {
    display: flex;
    align-items: center;
    justify-content: center;
}

.al-date {
    font-variant-numeric: tabular-nums;
    /*font-weight: 900;*/
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    padding: 8px 10px;
    border-radius: 12px;
    min-width: 58px;
    text-align: center;
}

.al-item__chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.al-item__title {
    min-width: 0;
    font-size: 14px;
    /*font-weight: 800;*/
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* ★title 單行 */
}

.al-item__count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    white-space: nowrap;
}

.al-frac {
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    /*font-weight: 900;*/
    color: #0f172a;
}

.al-num--zero {
    color: #94a3b8;
}

.al-slash {
    padding: 0 4px;
    color: #94a3b8;
    /*font-weight: 800;*/
}

.al-hint {
    font-size: 12px;
    color: #64748b;
}

/* ===== Chips ===== */
.al-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e6e9ee;
    background: #fff;
    font-size: 12px;
    /*font-weight: 800;*/
    color: #334155;
}

.al-chip--soft {
    background: #f8fafc;
}

.al-chip--type {
    background: #f3f4f6;
}

.al-chip--danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.al-chip--active {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.al-chip--pending {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.al-chip--expired {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.al-chip--review {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #0f172a;
}

/* ===== Edit button ===== */
.al-edit {
    border: 1px solid #eef1f4;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 52px;
}

    .al-edit:hover {
        background: #f8fafc;
        border-color: #e4e8ee;
    }

.al-edit__icon {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.92;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
    .al-item {
        grid-template-columns: 74px minmax(200px, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
    }

    .al-item__chips {
        grid-column: 2 / -1;
        grid-row: 1;
    }

    .al-item__title {
        grid-column: 2 / -1;
        grid-row: 2;
    }

    .al-item__count {
        display: none; /* 小螢幕先藏統計，避免擠爆 */
    }
}

@media (max-width: 720px) {
    .al-row {
        grid-template-columns: 1fr;
    }

    .al-edit {
        display: none; /* 手機版可改成長按/滑出工具列 */
    }

    .al-filter__head {
        flex-direction: column;
        align-items: flex-start;
    }
}
