/* ========================================
   Chinapost - 中国ニュース日本語版
   Light & Modern Design
======================================== */

:root {
    --primary: #d32f2f;
    --primary-dark: #b71c1c;
    --primary-light: #ffcdd2;
    --secondary: #1976d2;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #f1f3f5;
    --text-dark: #212529;
    --text-body: #495057;
    --text-muted: #868e96;
    --text-light: #adb5bd;
    --border: #e9ecef;
    --border-dark: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* カテゴリカラー */
    --cat-politics: #d32f2f;
    --cat-economy: #1976d2;
    --cat-finance: #7b1fa2;
    --cat-tech: #00897b;
    --cat-semiconductor: #5e35b1;
    --cat-military: #455a64;
    --cat-energy: #f57c00;
    --cat-japan: #c2185b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-body);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   ヘッダー
======================================== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 6px 0;
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-date {
    font-weight: 500;
}

.header-links {
    opacity: 0.9;
}

.header-main {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: 2px;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav a {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-body);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.header-nav a.active {
    color: white;
    background: var(--primary);
}

/* ========================================
   メインレイアウト
======================================== */
.main {
    padding: 30px 0 60px;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.main-content {
    min-width: 0;
}

/* ========================================
   カテゴリページヘッダー
======================================== */
.category-page-header {
    background: var(--bg-white);
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.category-page-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.category-page-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================
   トップニュース
======================================== */
.top-news {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.top-news-main {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.top-news-main:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.top-news-main a {
    display: block;
}

.top-news-image {
    height: 280px;
    overflow: hidden;
}

.top-news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.top-news-main:hover .top-news-image img {
    transform: scale(1.05);
}

.top-news-content {
    padding: 20px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border-radius: 20px;
    margin-bottom: 10px;
}

.news-category.small {
    padding: 3px 10px;
    font-size: 0.7rem;
}

/* カテゴリ色 */
.cat-politics, .news-category.cat-politics { background: var(--cat-politics); }
.cat-economy, .news-category.cat-economy { background: var(--cat-economy); }
.cat-finance, .news-category.cat-finance { background: var(--cat-finance); }
.cat-tech, .news-category.cat-tech { background: var(--cat-tech); }
.cat-semiconductor, .news-category.cat-semiconductor { background: var(--cat-semiconductor); }
.cat-military, .news-category.cat-military { background: var(--cat-military); }
.cat-energy, .news-category.cat-energy { background: var(--cat-energy); }
.cat-japan, .news-category.cat-japan { background: var(--cat-japan); }

.top-news-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 10px;
}

.top-news-lead {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
}

.news-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* サブニュース */
.top-news-sub {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-news-sub-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.top-news-sub-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.top-news-sub-item a {
    display: flex;
    height: 100%;
}

.top-news-sub-image {
    width: 120px;
    flex-shrink: 0;
}

.top-news-sub-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-news-sub-content {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top-news-sub-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   セクション
======================================== */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 30px 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-bar {
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

/* ========================================
   ニュース一覧
======================================== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.news-card:hover {
    box-shadow: var(--shadow-md);
}

.news-card a {
    display: flex;
    align-items: stretch;
}

.news-card-image {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.news-card-meta time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-card:hover .news-card-title {
    color: var(--primary);
}

.news-card-lead {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

/* ========================================
   サイドバー
======================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget.sticky {
    position: sticky;
    top: 100px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.category-list {
    list-style: none;
}

.category-list li {
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    font-size: 0.9rem;
    color: var(--text-body);
    transition: all 0.2s;
}

.category-list a:hover {
    color: var(--primary);
    padding-left: 10px;
}

.category-list a.active {
    color: var(--primary);
    font-weight: 600;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
}

.cat-dot.cat-politics { background: var(--cat-politics); }
.cat-dot.cat-economy { background: var(--cat-economy); }
.cat-dot.cat-finance { background: var(--cat-finance); }
.cat-dot.cat-tech { background: var(--cat-tech); }
.cat-dot.cat-semiconductor { background: var(--cat-semiconductor); }
.cat-dot.cat-military { background: var(--cat-military); }
.cat-dot.cat-energy { background: var(--cat-energy); }
.cat-dot.cat-japan { background: var(--cat-japan); }

.cat-arrow {
    margin-left: auto;
    color: var(--text-light);
    font-size: 1.2rem;
}

.widget-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ========================================
   ページネーション
======================================== */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-body);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========================================
   パンくず
======================================== */
.breadcrumb {
    background: var(--bg-white);
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.breadcrumb a {
    color: var(--text-body);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .sep {
    margin: 0 8px;
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-muted);
}

/* ========================================
   記事詳細
======================================== */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
}

.article {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-header {
    padding: 30px 30px 20px;
}

.article-category {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    border-radius: 20px;
    margin-bottom: 15px;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 12px;
}

.article-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-meta time,
.article-meta .article-source {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta svg {
    opacity: 0.6;
}

/* アイキャッチ */
.article-hero {
    padding: 0 30px;
    margin-bottom: 30px;
}

.article-hero img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* 目次 */
.article-toc {
    margin: 0 30px 30px;
    padding: 20px;
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.toc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title svg {
    color: var(--primary);
}

.toc-list {
    margin-left: 20px;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    font-size: 0.9rem;
    color: var(--text-body);
}

.toc-list a:hover {
    color: var(--primary);
}

/* 本文 */
.article-body {
    padding: 0 30px 30px;
}

.article-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 35px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.article-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-body);
    margin-bottom: 20px;
}

/* タグ */
.article-tags {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tags-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tag {
    background: var(--bg-gray);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-body);
}

/* ソース */
.article-source-box {
    margin: 0 30px;
    padding: 15px 20px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-label {
    color: var(--text-muted);
}

.article-source-box a {
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-source-box a:hover {
    text-decoration: underline;
}

/* シェア */
.article-share {
    padding: 25px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.twitter { background: #000; }
.share-btn.facebook { background: #1877f2; }
.share-btn.line { background: #06c755; }

/* 戻るリンク */
.article-nav {
    padding: 20px 30px 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-body);
    padding: 10px 20px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================
   フッター
======================================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 40px 0 20px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: 2px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.footer-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-nav a {
    font-size: 0.9rem;
    color: var(--text-body);
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 1024px) {
    .main-layout,
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .sidebar-widget.sticky {
        position: static;
    }
    
    .top-news {
        grid-template-columns: 1fr;
    }
    
    .top-news-sub {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .top-news-sub-item {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .top-news-image {
        height: 200px;
    }
    
    .top-news-title {
        font-size: 1.2rem;
    }
    
    .news-card a {
        flex-direction: column;
    }
    
    .news-card-image {
        width: 100%;
        height: 180px;
    }
    
    .article-title {
        font-size: 1.4rem;
    }
    
    .article-header,
    .article-body,
    .article-toc,
    .article-hero,
    .article-tags,
    .article-source-box,
    .article-share,
    .article-nav {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .article-hero {
        padding: 0;
    }
    
    .article-hero img {
        border-radius: 0;
    }
    
    .footer-inner {
        flex-direction: column;
        gap: 20px;
    }
}

/* ========================================
   アニメーション
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card,
.top-news-main,
.top-news-sub-item {
    animation: fadeInUp 0.5s ease forwards;
}
