/* ====== 系統驗證場專用樣式 ====== */

/* 基礎頁面結構 */
.modern-rules-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%);
    position: relative;
}

.modern-rules-list-page {
    padding-bottom: 4rem;
}

.modern-rules-single-page {
    padding: 2rem 0 4rem;
}

.modern-rules-inner-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 數據驅動頭部 */
.modern-rules-data-header {
    background: linear-gradient(135deg, #0a1929 0%, #1a2b3c 100%);
    color: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    border-top: 4px solid rgb(30, 136, 229);
}

.modern-rules-data-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(30, 136, 229, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 136, 229, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: modern-rules-grid-move 20s linear infinite;
}

@keyframes modern-rules-grid-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}
/* ====== List 首屏變乾淨：只覆蓋，不破壞原本風格 ====== */
.modern-rules-data-header.modern-rules-hero {
  padding: 2.4rem 2rem; /* 原本 3rem 2rem 稍微縮一下 */
}

.modern-rules-data-header.modern-rules-hero::before {
  opacity: 0.55; /* 格線淡一點，別搶戲 */
}

.modern-rules-page-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 1rem 0;
    position: relative;
    z-index: 2;
    text-align: center;
}

.modern-rules-page-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem 0;
    position: relative;
    z-index: 2;
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 數據儀表板 */
.modern-rules-stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin: 2.5rem 0;
    position: relative;
    z-index: 2;
}

.modern-rules-stat-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s ease;
}

.modern-rules-stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 25px rgba(30, 136, 229, 0.2);
}

.modern-rules-stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.modern-rules-stat-content {
    flex: 1;
}

.modern-rules-stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.modern-rules-stat-label {
    display: block;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.modern-rules-latest-update {
    position: relative;
    z-index: 2;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.modern-rules-update-label {
    color: rgba(255, 255, 255, 0.7);
}

/* 內容區塊 */
.modern-rules-content-section {
    margin: 4rem 0;
}

.modern-rules-section-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.modern-rules-section-title {
    font-size: 2rem;
    color: #0a1929;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modern-rules-section-description {
    color: #666;
    font-size: 1.05rem;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* ====== 規則剖析與維度分析 ====== */

.modern-rules-analysis-section {
    margin: 3rem 0 4rem;
}

/* 規則類型分析（橫向布局） */
.modern-rules-rule-types-container {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    border: 2px solid #e3f2fd;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.modern-rules-rule-types-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e88e5, #42a5f5, #1e88e5);
}

.modern-rules-rule-types-container h3 {
    font-size: 1.4rem;
    color: #0a1929;
    margin: 0 0 1.5rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modern-rules-rule-types-subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    margin: 0 0 2rem 0;
}

.modern-rules-rule-types-horizontal {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modern-rules-rule-type-horizontal {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.8rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.modern-rules-rule-type-horizontal:hover {
    transform: translateY(-8px);
    background: #e3f2fd;
    border-color: #bbdefb;
    box-shadow: 0 10px 25px rgba(30, 136, 229, 0.15);
}

.modern-rules-rule-type-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.2rem;
}

.modern-rules-rule-type-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modern-rules-rule-type-horizontal h4 {
    font-size: 1.2rem;
    color: #0a1929;
    margin: 0 0 0.5rem 0;
}

.modern-rules-rule-type-count {
    background: #1e88e5;
    color: white;
    padding: 0.3rem 0.9rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

.modern-rules-rule-type-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.2rem 0;
}

.modern-rules-rule-type-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.modern-rules-rule-type-keyword {
    background: #f1f8ff;
    color: #1e88e5;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

/* 破譯維度解釋 */
.modern-rules-dimensions-explanation {
    background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
    border-radius: 16px;
    padding: 2.5rem;
    border: 2px solid #e3f2fd;
}

.modern-rules-dimensions-explanation h3 {
    font-size: 1.4rem;
    color: #0a1929;
    margin: 0 0 1.5rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modern-rules-dimensions-subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    margin: 0 0 2rem 0;
}

.modern-rules-dimensions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 固定 2x2，避免 3+1 孤兒 */
    gap: 1.5rem;
}

.modern-rules-dimension-explanation {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #e3f2fd;
}

.modern-rules-dimension-explanation:hover {
    transform: translateY(-5px);
    border-color: #1e88e5;
    box-shadow: 0 8px 20px rgba(30, 136, 229, 0.15);
}

.modern-rules-dimension-explanation-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.modern-rules-dimension-explanation h4 {
    font-size: 1.2rem;
    color: #0a1929;
    margin: 0 0 0.8rem 0;
}

.modern-rules-dimension-explanation p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.2rem 0;
}

.modern-rules-dimension-questions {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.modern-rules-dimension-questions li {
    color: #555;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.4;
}

.modern-rules-dimension-questions li:before {
    content: "•";
    color: #1e88e5;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    line-height: 1;
}

/* ====== 四大主軸領域 ====== */

.modern-rules-domains-section {
    margin: 4rem 0;
}

.modern-rules-domains-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8rem;
    margin-top: 2rem;
}

.modern-rules-domain-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.modern-rules-domain-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(30, 136, 229, 0.15);
    border-color: #1e88e5;
}

.modern-rules-domain-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e88e5, #42a5f5);
}

.modern-rules-domain-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.modern-rules-domain-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 14px;
    flex-shrink: 0;
}

.modern-rules-domain-title h3 {
    font-size: 1.3rem;
    color: #0a1929;
    margin: 0 0 0.5rem 0;
}

.modern-rules-domain-count {
    display: inline-block;
    background: #e3f2fd;
    color: #1e88e5;
    padding: 0.3rem 0.9rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.modern-rules-domain-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.2rem 0;
    flex: 1;
}

.modern-rules-domain-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modern-rules-domain-keyword {
    background: #f1f8ff;
    color: #1e88e5;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.modern-rules-domain-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f7ff;
}

.modern-rules-domain-stat {
    text-align: center;
}

.modern-rules-domain-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.modern-rules-domain-stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0a1929;
}

.modern-rules-domain-actions {
    display: flex;
    gap: 1rem;
}

.modern-rules-domain-filter {
    flex: 1;
    background: #1e88e5;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modern-rules-domain-filter:hover {
    background: #1565c0;
    transform: translateY(-2px);
}

.modern-rules-domain-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1e88e5;
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e3f2fd;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.modern-rules-domain-explore:hover {
    background: #e3f2fd;
    border-color: #1e88e5;
}

/* ====== 最新破譯案例 ====== */

.modern-rules-cases-section {
    margin: 4rem 0;
}

.modern-rules-cases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.modern-rules-cases-controls {
    display: flex;
    gap: 0.5rem;
}

.modern-rules-sort-btn {
    padding: 0.5rem 1.2rem;
    background: #f1f8ff;
    border: 2px solid #e3f2fd;
    border-radius: 20px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.modern-rules-sort-btn:hover {
    background: #e3f2fd;
    border-color: #1e88e5;
}

.modern-rules-sort-btn.active {
    background: #1e88e5;
    color: white;
    border-color: #1e88e5;
}

.modern-rules-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
}

.modern-rules-case-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e3f2fd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modern-rules-case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(30, 136, 229, 0.15);
    border-color: #1e88e5;
}

.modern-rules-case-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e88e5, #42a5f5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-rules-case-card:hover::before {
    opacity: 1;
}

.modern-rules-case-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 1.8rem;
}

.modern-rules-case-badges {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.modern-rules-case-domain {
    background: #e3f2fd;
    color: #1e88e5;
    padding: 0.3rem 0.9rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modern-rules-case-type {
    background: #f1f8ff;
    color: #0a1929;
    padding: 0.3rem 0.9rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #bbdefb;
}

.modern-rules-case-card h3 {
    font-size: 1.3rem;
    color: #0a1929;
    margin: 0 0 0.8rem 0;
    line-height: 1.4;
}

.modern-rules-case-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.modern-rules-case-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 1.2rem;
    border-top: 1px solid #f0f0f0;
}

.modern-rules-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.modern-rules-meta-label {
    font-size: 0.85rem;
    color: #888;
}

.modern-rules-case-date {
    font-size: 0.95rem;
    color: #0a1929;
    font-weight: 500;
}

.modern-rules-difficulty-stars {
    position: relative;
    display: inline-block;
    color: #ffc107;
    font-size: 1rem;
    line-height: 1;
}

.modern-rules-difficulty-stars .filled {
    color: #ffc107;
}

.modern-rules-difficulty-stars .empty {
    color: #e0e0e0;
}

.modern-rules-case-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.modern-rules-case-readtime {
    color: #888;
    font-size: 0.9rem;
}

.modern-rules-case-cta {
    color: #1e88e5;
    font-weight: 600;
    font-size: 0.9rem;
}

.modern-rules-coming-soon-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.modern-rules-decoding-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.modern-rules-decoding-animation::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid #1e88e5;
    border-radius: 50%;
    border-top-color: transparent;
    animation: modern-rules-decode-spin 2s linear infinite;
}

@keyframes modern-rules-decode-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ====== 動畫效果 ====== */

.modern-rules-case-card.filtered {
    animation: modern-rules-card-highlight 1s ease;
}

@keyframes modern-rules-card-highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ====== 響應式設計 ====== */



/* ====== 減少動畫支持 ====== */

@media (prefers-reduced-motion: reduce) {
    .modern-rules-data-header::before,
    .modern-rules-decoding-animation::before {
        animation: none !important;
    }
    
    .modern-rules-stat-card:hover,
    .modern-rules-rule-type-horizontal:hover,
    .modern-rules-dimension-explanation:hover,
    .modern-rules-domain-card:hover,
    .modern-rules-case-card:hover,
    .modern-rules-domain-filter:hover,
    .modern-rules-domain-explore:hover {
        transform: none !important;
    }
}
/* ====== 圖片處理樣式 ====== */

/* 通用圖片容器 */
.modern-rules-image-container {
    margin: 2.5rem auto;
    max-width: 100%;
    overflow: visible !important;
    position: relative;
}

/* 文章內容圖片 */
.modern-rules-article-content img,
.modern-rules-article-content .modern-rules-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

/* 確保所有圖片都不裁切 */
.modern-rules-article-content img,
.modern-rules-article-content picture img,
.modern-rules-article-content figure img,
.modern-rules-article-content .modern-rules-image img {
    object-fit: contain !important;
    object-position: center !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
}

/* 懸停效果 */
.modern-rules-article-content img:hover,
.modern-rules-article-content .modern-rules-image img:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* 圖片說明文字 */
.modern-rules-image figcaption,
.modern-rules-article-content figcaption {
    text-align: center;
    font-size: 0.95rem;
    color: #666;
    margin-top: 0.8rem;
    font-style: italic;
    line-height: 1.5;
    padding: 0 1rem;
}

/* 響應式圖片 */
@media (max-width: 768px) {
    .modern-rules-article-content img,
    .modern-rules-article-content .modern-rules-image img {
        border-radius: 8px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    }
}

/* 列表頁案例卡片圖片 */
.modern-rules-case-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    margin-bottom: 1rem;
}

/* 清除所有可能的裁切樣式 */
img[style*="object-fit: cover"],
img[style*="object-fit: contain"],
img[style*="background-size: cover"] {
    object-fit: contain !important;
    background-size: contain !important;
}

/* 防止 Hugo 或其他主題的裁切 */
.responsive-img,
.featured-image,
.post-image,
.content img {
    object-fit: contain !important;
    max-width: 100% !important;
    height: auto !important;
}

/* 表格中的圖片 */
.modern-rules-article-content table img {
    max-width: 150px !important;
    height: auto !important;
    display: block;
    margin: 0.5rem auto;
}

/* ====== 單頁（single）補齊樣式：不改既有風格，只補缺的 class ====== */

/* 返回導航 */
.modern-rules-back-nav {
    margin: 1.5rem 0 0;
}

.modern-rules-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: #f1f8ff;
    border: 2px solid #e3f2fd;
    color: #1e88e5;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modern-rules-back-btn:hover {
    background: #e3f2fd;
    border-color: #1e88e5;
    transform: translateY(-2px);
}

/* 文章卡片容器 */
.modern-rules-article-detail {
    background: white;
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 1.5rem;
}

/* 文章頭部 */
.modern-rules-article-header {
    padding: 2.2rem 2rem 1.6rem;
    position: relative;
}

.modern-rules-article-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.modern-rules-article-domain {
    background: #e3f2fd;
    color: #1e88e5;
    padding: 0.3rem 0.9rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
}

.modern-rules-article-type {
    background: #f1f8ff;
    color: #0a1929;
    padding: 0.3rem 0.9rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #bbdefb;
}

.modern-rules-article-title {
    font-size: 2.1rem;
    color: #0a1929;
    margin: 0 0 0.8rem 0;
    line-height: 1.25;
    font-weight: 900;
}

.modern-rules-article-description {
    margin: 0 0 1.2rem 0;
    color: #666;
    font-size: 1.05rem;
    line-height: 1.6;
}

.modern-rules-article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.2rem;
    border-top: 1px solid #f0f7ff;
}

.modern-rules-article-date {
    color: #0a1929;
    font-weight: 600;
}

.modern-rules-status-badge.decoded {
    background: #1e88e5;
    color: white;
    padding: 0.3rem 0.9rem;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
}

.modern-rules-reading-time {
    margin-top: 1rem;
    color: #888;
    font-size: 0.95rem;
}

/* 文章內容（保守，不搶你全站排版） */
.modern-rules-article-content {
    padding: 0 2rem 2rem;
    color: #0a1929;
    line-height: 1.85;
    font-size: 1.05rem;
}

.modern-rules-article-content h2,
.modern-rules-article-content h3,
.modern-rules-article-content h4 {
    color: #0a1929;
    margin: 2rem 0 1rem;
}

.modern-rules-article-content p {
    margin: 1rem 0;
    color: #333;
}

.modern-rules-article-content a {
    color: #1e88e5;
    text-decoration: none;
    font-weight: 600;
}

.modern-rules-article-content a:hover {
    text-decoration: underline;
}

.modern-rules-article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid #1e88e5;
    background: #f8fafc;
    border-radius: 10px;
    color: #444;
}

/* 分析框架區塊 */
.modern-rules-analysis-framework,
.modern-rules-applicable-dimensions,
.modern-rules-recommended-strategies {
    margin: 0 2rem 2rem;
    padding: 1.8rem;
    border-radius: 16px;
    border: 2px solid #e3f2fd;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f8ff 100%);
}

.modern-rules-analysis-framework h3,
.modern-rules-applicable-dimensions h3,
.modern-rules-recommended-strategies h3 {
    margin: 0 0 1.2rem 0;
    color: #0a1929;
    font-size: 1.3rem;
}

.modern-rules-analysis-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.modern-rules-step {
    background: white;
    border-radius: 14px;
    border: 2px solid #e3f2fd;
    padding: 1.4rem;
    display: flex;
    gap: 1rem;
}

.modern-rules-step-number {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #1e88e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.modern-rules-step-content h4 {
    margin: 0 0 0.4rem 0;
    color: #0a1929;
}

.modern-rules-step-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* 維度 chips */
.modern-rules-dimension-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.modern-rules-dimension-chip {
    background: white;
    border: 2px solid #e3f2fd;
    color: #1e88e5;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* 策略卡片 */
.modern-rules-strategy-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.modern-rules-strategy-card {
    background: white;
    border-radius: 14px;
    border: 2px solid #e3f2fd;
    padding: 1.4rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modern-rules-strategy-card:hover {
    transform: translateY(-6px);
    border-color: #1e88e5;
    box-shadow: 0 12px 35px rgba(30, 136, 229, 0.12);
}

.modern-rules-strategy-card h4 {
    margin: 0 0 0.5rem 0;
    color: #0a1929;
}

.modern-rules-strategy-card p {
    margin: 0;
    color: #666;
}

/* 相關案例 */
.modern-rules-related-cases {
    margin: 2rem 0 0;
    padding: 2rem 0 0;
}

.modern-rules-related-cases h3 {
    margin: 0 0 1rem 0;
    color: #0a1929;
    font-size: 1.3rem;
}

.modern-rules-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.modern-rules-related-card {
    display: block;
    background: white;
    border-radius: 14px;
    border: 2px solid #e3f2fd;
    padding: 1.4rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.modern-rules-related-card:hover {
    transform: translateY(-6px);
    border-color: #1e88e5;
    box-shadow: 0 12px 35px rgba(30, 136, 229, 0.12);
}

.modern-rules-related-card h4 {
    margin: 0 0 0.6rem 0;
    color: #0a1929;
    font-size: 1.05rem;
    line-height: 1.4;
}

.modern-rules-related-card p {
    margin: 0 0 1rem 0;
    color: #666;
    line-height: 1.5;
}

.modern-rules-related-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #f0f0f0;
}

.modern-rules-related-type {
    color: #1e88e5;
    font-weight: 700;
}

.modern-rules-no-related {
    color: #888;
    margin: 0;
}

/* 上下篇導航 */
.modern-rules-article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin: 2.5rem 0 0;
}

.modern-rules-nav-prev,
.modern-rules-nav-next {
    display: block;
    background: white;
    border-radius: 14px;
    border: 2px solid #e3f2fd;
    padding: 1.4rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.modern-rules-nav-prev:hover,
.modern-rules-nav-next:hover {
    transform: translateY(-6px);
    border-color: #1e88e5;
    box-shadow: 0 12px 35px rgba(30, 136, 229, 0.12);
}

.modern-rules-nav-label {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.modern-rules-nav-title {
    color: #0a1929;
    font-weight: 800;
    line-height: 1.4;
}

/* 單頁響應式 */
@media (max-width: 1024px) {
    .modern-rules-related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modern-rules-article-header {
        padding: 1.8rem 1.2rem 1.2rem;
    }

    .modern-rules-article-content {
        padding: 0 1.2rem 1.6rem;
    }

    .modern-rules-analysis-framework,
    .modern-rules-applicable-dimensions,
    .modern-rules-recommended-strategies {
        margin: 0 1.2rem 1.4rem;
        padding: 1.4rem;
    }

    .modern-rules-analysis-steps {
        grid-template-columns: 1fr;
    }

    .modern-rules-strategy-cards {
        grid-template-columns: 1fr;
    }

    .modern-rules-article-navigation {
        grid-template-columns: 1fr;
    }
}

.modern-rules-controls {
  position: relative;
  z-index: 2;
  margin: 1.6rem auto 1.2rem;
  max-width: 900px;
}

.modern-rules-search {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.modern-rules-search-input {
  flex: 1;
  min-width: 280px;
  max-width: 560px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid rgba(227, 242, 253, 0.6);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: none;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.modern-rules-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.modern-rules-search-input:focus {
  border-color: rgba(66, 165, 245, 0.95);
  box-shadow: 0 10px 25px rgba(30, 136, 229, 0.25);
}

.modern-rules-clear-btn {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid rgba(227, 242, 253, 0.6);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modern-rules-clear-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.modern-rules-quick-filters {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.modern-rules-chip {
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 2px solid rgba(227, 242, 253, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modern-rules-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.modern-rules-chip.active {
  background: rgba(30, 136, 229, 0.9);
  border-color: rgba(30, 136, 229, 0.9);
  color: #fff;
}

/* 輔助：給 input label 但不顯示 */
.modern-rules-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* ====== 統計卡縮小：不搶主角 ====== */
.modern-rules-stats-dashboard.modern-rules-stats-compact {
  margin: 1.6rem 0 0.4rem;
  gap: 0.9rem;
}

.modern-rules-stats-dashboard.modern-rules-stats-compact .modern-rules-stat-card {
  padding: 1.1rem 1.2rem;
}

.modern-rules-stats-dashboard.modern-rules-stats-compact .modern-rules-stat-value {
  font-size: 1.9rem;
}
/* ====== 排序列 sticky：讓頁面瞬間變好用 ====== */
.modern-rules-cases-header-sticky {
  position: sticky;
  top: 12px;
  z-index: 5;
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  border: 2px solid #e3f2fd;
}

@media (max-width: 768px) {
  .modern-rules-cases-header-sticky {
    top: 8px;
  }
}
/* ====== 框架折疊區（details/summary） ====== */
.modern-rules-fold {
  background: white;
  border: 2px solid #e3f2fd;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.modern-rules-fold-summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.3rem;
  font-weight: 800;
  color: #0a1929;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f8ff 100%);
  border-bottom: 1px solid #e3f2fd;
}

.modern-rules-fold-summary::-webkit-details-marker {
  display: none;
}

.modern-rules-fold[open] .modern-rules-fold-summary {
  border-bottom-color: #bbdefb;
}

.modern-rules-fold-body {
  padding: 1.4rem 1.3rem 1.6rem;
}

@media (max-width: 768px) {
  .modern-rules-fold-body {
    padding: 1.2rem 1rem 1.4rem;
  }
}
