/* ============================================================
   styles.css — 文章列表頁 + 個別文章專用樣式
   依賴 shared.css 的 CSS 變數
   ============================================================ */

/* ============ 列表頁 (index.html) ============ */

.list-hero {
    text-align: center;
    padding: 1rem 1rem 0.8rem;
}
.list-hero h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.list-hero p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.2rem 0;
    padding: 0.7rem 0.9rem;
    background-color: #1B2436;
    background-image: linear-gradient(180deg, rgba(34,217,231,0.05), transparent);
    border: 1px solid var(--border-bright);
    border-top: 3px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
body[data-theme="light"] .tag-filter-bar {
    background-color: #EDF3F7;
    background-image: linear-gradient(180deg, rgba(6,137,159,0.04), transparent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.tag-pill {
    padding: 0.32rem 0.85rem;
    background: rgba(160, 176, 192, 0.08);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.tag-pill:hover {
    background: rgba(34, 217, 231, 0.12);
    color: var(--text);
}
.tag-pill.active {
    background: var(--primary);
    color: #0A0F1A;
    border-color: var(--primary);
    font-weight: 600;
}

.article-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}
.article-card {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.article-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(34, 217, 231, 0.12);
}
.article-card.hidden { display: none; }
.article-card-icon {
    font-size: 2.2rem;
    align-self: center;
    text-align: center;
}
.article-card-body { min-width: 0; }
.article-card-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.article-card-summary {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.article-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.article-card-tag {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
    background: rgba(34, 217, 231, 0.1);
    color: var(--primary);
    border-radius: 12px;
    font-weight: 500;
}
.article-card-meta {
    align-self: center;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.article-card-meta div { margin-bottom: 0.15rem; }

@media (max-width: 600px) {
    .article-card {
        grid-template-columns: 50px 1fr;
        gap: 0.7rem;
    }
    .article-card-meta {
        grid-column: 2;
        text-align: left;
        margin-top: 0.4rem;
    }
}

/* ============ 個別文章 (00X-*.html) ============ */

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.article-head {
    text-align: left;
    padding: 1.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.8rem;
}
.article-meta-row {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
}
.article-meta-tag {
    padding: 0.18rem 0.65rem;
    background: rgba(34, 217, 231, 0.12);
    color: var(--primary);
    border-radius: 12px;
    font-weight: 500;
}
.article-head h1 {
    font-size: 1.9rem;
    line-height: 1.35;
    margin: 0 0 0.6rem;
    color: var(--text);
}
.article-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.article-content section {
    margin-bottom: 1.8rem;
}
.article-content h2 {
    font-size: 1.35rem;
    color: var(--primary);
    margin: 1.2rem 0 0.8rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid rgba(34, 217, 231, 0.15);
}
.article-content h3 {
    font-size: 1.08rem;
    color: var(--text);
    margin: 1rem 0 0.5rem;
}
.article-content p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}
.article-content strong { color: var(--text); font-weight: 600; }
.article-content em {
    color: var(--accent);
    font-style: normal;
}
.article-content ul, .article-content ol {
    line-height: 1.9;
    color: var(--text-muted);
    padding-left: 1.4rem;
    margin: 0 0 1rem;
}
.article-content li { margin-bottom: 0.3rem; }
.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(34, 217, 231, 0.4);
}
.article-content a:hover { border-bottom-style: solid; }

/* 引用塊(大師名言或概念引用) */
.article-content blockquote {
    margin: 1.2rem 0;
    padding: 0.9rem 1.2rem;
    background: rgba(34, 217, 231, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.7;
}
.article-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: normal;
    text-align: right;
}

/* Callout 提示框 */
.callout {
    padding: 0.9rem 1.1rem;
    margin: 1.2rem 0;
    border-radius: 10px;
    border-left: 4px solid;
    line-height: 1.7;
}
.callout-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.callout-info {
    background: rgba(34, 217, 231, 0.06);
    border-left-color: var(--primary);
}
.callout-warning {
    background: rgba(255, 196, 0, 0.06);
    border-left-color: #FFB300;
}
body[data-theme="light"] .callout-warning {
    background: rgba(217, 119, 6, 0.06);
    border-left-color: #D97706;
}
.callout-danger {
    background: rgba(255, 92, 92, 0.06);
    border-left-color: #FF5C5C;
}
body[data-theme="light"] .callout-danger {
    background: rgba(220, 38, 38, 0.06);
    border-left-color: #DC2626;
}
.callout-tip {
    background: rgba(52, 230, 142, 0.06);
    border-left-color: #34E68E;
}
body[data-theme="light"] .callout-tip {
    background: rgba(16, 185, 129, 0.06);
    border-left-color: #10B981;
}

/* 數據表 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 0.92rem;
}
.article-content th, .article-content td {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    text-align: left;
}
.article-content th {
    background: rgba(34, 217, 231, 0.08);
    color: var(--text);
    font-weight: 600;
}
.article-content tbody tr:nth-child(even) {
    background: rgba(160, 176, 192, 0.03);
}

/* 重點摘要 */
.article-summary {
    margin: 2rem 0 1.5rem;
    padding: 1.1rem 1.3rem;
    background: linear-gradient(135deg, rgba(34, 217, 231, 0.06), rgba(52, 230, 142, 0.04));
    border: 1px solid var(--border-bright);
    border-radius: 12px;
}
.article-summary h3 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    color: var(--text);
}
.article-summary ul {
    margin: 0;
    padding-left: 1.3rem;
    line-height: 1.85;
    color: var(--text-muted);
}

/* 延伸閱讀 */
.article-related {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.article-related h3 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: var(--text);
}
.article-related ul {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.9;
    font-size: 0.93rem;
}
.article-related a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(34, 217, 231, 0.4);
}

/* 上下篇導航 */
.article-nav-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}
@media (max-width: 600px) {
    .article-nav-prev-next { grid-template-columns: 1fr; }
}
.article-nav-prev-next a {
    padding: 0.9rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.article-nav-prev-next a:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.article-nav-prev-next a.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.article-nav-prev-next .nav-direction {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}
.article-nav-prev-next .nav-title {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
    line-height: 1.4;
}
.article-nav-prev-next .next { text-align: right; }
