*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
:root{
  --c-bg:#f8f9fc;
  --c-surface:#fff;
  --c-primary:#4361ee;
  --c-primary-dark:#3a56d4;
  --c-accent:#f59e0b;
  --c-accent-dark:#d97706;
  --c-text:#1a1a2e;
  --c-text-secondary:#5a6078;
  --c-text-light:#8b92a8;
  --c-border:#e2e5ef;
  --c-code-bg:#f1f3f9;
  --c-hero-bg:linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);
  --c-cat-bg:#eef1fb;
  --radius:8px;
  --radius-lg:12px;
  --shadow-sm:0 1px 3px rgba(26,26,46,.06);
  --shadow-md:0 4px 12px rgba(26,26,46,.08);
  --shadow-lg:0 8px 30px rgba(26,26,46,.12);
  --font-main:'Noto Sans JP','Hiragino Sans','Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif;
  --max-w:1180px;
  --sidebar-w:280px;
}
html{scroll-behavior:smooth;font-size:16px}
body{font-family:var(--font-main);background:var(--c-bg);color:var(--c-text);line-height:1.8;-webkit-font-smoothing:antialiased}
a{color:var(--c-primary);text-decoration:none;transition:color .2s}
a:hover{color:var(--c-primary-dark)}
img{max-width:100%;height:auto;display:block}
.container{max-width:var(--max-w);margin:0 auto;padding:0 20px}

/* ====== HEADER ====== */
.site-header{background:var(--c-hero-bg);position:sticky;top:0;z-index:100;border-bottom:1px solid rgba(255,255,255,.1)}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:64px}
.logo{color:#fff;font-size:1.25rem;font-weight:900;letter-spacing:.02em;white-space:nowrap}
.logo:hover{color:var(--c-accent)}
.global-nav{display:flex;gap:24px}
.global-nav a{color:rgba(255,255,255,.85);font-size:.85rem;font-weight:500;white-space:nowrap;transition:color .2s}
.global-nav a:hover{color:#fff}
.hamburger{display:none;background:none;border:none;cursor:pointer;padding:6px;flex-direction:column;gap:5px}
.hamburger span{display:block;width:24px;height:2px;background:#fff;border-radius:2px;transition:transform .3s,opacity .3s}
.hamburger[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.hamburger[aria-expanded="true"] span:nth-child(2){opacity:0}
.hamburger[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ====== HERO ====== */
.hero{background:var(--c-hero-bg);padding:80px 0 60px;color:#fff;text-align:center}
.hero-title{font-size:2rem;font-weight:900;line-height:1.35;margin-bottom:16px}
.hero-sub{font-size:1rem;opacity:.85;margin-bottom:32px;max-width:640px;margin-left:auto;margin-right:auto}
.hero-actions{display:flex;gap:16px;justify-content:center;flex-wrap:wrap}

/* ====== BUTTONS ====== */
.btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 28px;border-radius:var(--radius);font-size:.95rem;font-weight:700;transition:background .2s,transform .1s,box-shadow .2s;cursor:pointer;border:none}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--c-accent);color:#fff}
.btn-primary:hover{background:var(--c-accent-dark);color:#fff;box-shadow:0 4px 16px rgba(245,158,11,.35)}
.btn-outline{background:transparent;color:#fff;border:2px solid rgba(255,255,255,.5)}
.btn-outline:hover{border-color:#fff;color:#fff}

/* ====== SECTION TITLES ====== */
.section-title{font-size:1.5rem;font-weight:900;margin-bottom:32px;position:relative;padding-bottom:12px}
.section-title::after{content:'';position:absolute;bottom:0;left:0;width:48px;height:4px;background:var(--c-primary);border-radius:2px}

/* ====== CATEGORY SECTION ====== */
.category-section{padding:48px 0}
.category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.category-card{display:flex;flex-direction:column;align-items:center;gap:4px;padding:24px 16px;background:var(--c-surface);border:2px solid var(--c-border);border-radius:var(--radius-lg);transition:border-color .2s,transform .15s}
.category-card:hover{border-color:var(--c-primary);transform:translateY(-2px)}
.category-name{font-size:.9rem;font-weight:700;color:var(--c-text);text-align:center}
.category-count{font-size:.8rem;color:var(--c-text-light)}

/* ====== CARD GRID ====== */
.articles-section{padding:48px 0 64px}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}
.card{background:var(--c-surface);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-sm);transition:box-shadow .25s,transform .2s;display:flex;flex-direction:column}
.card:hover{box-shadow:var(--shadow-lg);transform:translateY(-4px)}
.card-img{width:100%;aspect-ratio:16/9;overflow:hidden;background:var(--c-cat-bg)}
.card-img img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.card:hover .card-img img{transform:scale(1.04)}
.card-img-placeholder{display:flex;align-items:center;justify-content:center;font-size:3rem;color:var(--c-primary);opacity:.3}
.card-body{padding:20px;flex:1;display:flex;flex-direction:column;gap:8px}
.card-cat a{font-size:.75rem;color:var(--c-primary);font-weight:700;background:var(--c-cat-bg);padding:3px 8px;border-radius:4px;display:inline-block}
.card-cat a:hover{background:var(--c-primary);color:#fff}
.card-title{font-size:1rem;font-weight:700;line-height:1.5}
.card-title a{color:var(--c-text)}
.card-title a:hover{color:var(--c-primary)}
.card-keyword{font-size:.8rem;color:var(--c-text-light)}
.card-date{font-size:.78rem;color:var(--c-text-light);margin-top:auto}

/* ====== BREADCRUMB ====== */
.breadcrumb{background:var(--c-surface);border-bottom:1px solid var(--c-border);font-size:.82rem}
.breadcrumb-list{display:flex;flex-wrap:wrap;align-items:center;gap:4px;padding:10px 0;list-style:none}
.breadcrumb-list li{color:var(--c-text-light)}
.breadcrumb-list li+li::before{content:'›';margin-right:4px;color:var(--c-text-light)}
.breadcrumb-list a{color:var(--c-primary)}
.breadcrumb-list span{color:var(--c-text)}

/* ====== ARTICLE LAYOUT ====== */
.article-layout{padding:48px 0 64px}
.article-layout-inner{display:grid;grid-template-columns:1fr var(--sidebar-w);gap:48px;align-items:start}
.article-main{}
.article-header{margin-bottom:32px}
.article-cat{margin-bottom:12px;display:inline-block}
.article-cat a{font-size:.78rem;color:var(--c-primary);font-weight:700;background:var(--c-cat-bg);padding:3px 10px;border-radius:4px}
.article-title{font-size:1.75rem;font-weight:900;line-height:1.45;margin-bottom:12px}
.article-meta{font-size:.82rem;color:var(--c-text-light)}
.article-eyecatch{margin-bottom:32px;border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-md)}
.article-eyecatch img{width:100%;height:auto}

/* ====== ARTICLE BODY ====== */
.article-body{line-height:1.9;font-size:1rem;max-width:100%}
.article-body h1{font-size:1.6rem;font-weight:900;margin:48px 0 20px;padding-bottom:10px;border-bottom:3px solid var(--c-primary)}
.article-body h2{font-size:1.35rem;font-weight:800;margin:40px 0 16px;padding-bottom:8px;border-bottom:2px solid var(--c-border)}
.article-body h3{font-size:1.15rem;font-weight:700;margin:32px 0 12px}
.article-body h4{font-size:1rem;font-weight:700;margin:24px 0 8px}
.article-body p{margin-bottom:16px}
.article-body ul,.article-body ol{margin-bottom:16px;padding-left:24px}
.article-body li{margin-bottom:6px}
.article-body strong{font-weight:700}
.article-body a{color:var(--c-primary);text-decoration:underline;text-underline-offset:2px}
.article-body a:hover{color:var(--c-primary-dark)}
.article-body table{width:100%;border-collapse:collapse;margin-bottom:20px;font-size:.92rem}
.article-body th,.article-body td{border:1px solid var(--c-border);padding:10px 14px;text-align:left}
.article-body th{background:var(--c-cat-bg);font-weight:700;white-space:nowrap}
.article-body blockquote{border-left:4px solid var(--c-primary);background:var(--c-cat-bg);padding:16px 20px;margin-bottom:20px;border-radius:0 var(--radius) var(--radius) 0;font-size:.95rem}
.article-body hr{border:none;border-top:2px solid var(--c-border);margin:36px 0}
.article-body code{background:var(--c-code-bg);padding:2px 6px;border-radius:4px;font-size:.88em}
.article-body pre{background:var(--c-code-bg);padding:16px;border-radius:var(--radius);overflow-x:auto;margin-bottom:20px;font-size:.88em}
.article-body img{border-radius:var(--radius)}
.article-body .headerlink{font-size:.7em;color:var(--c-text-light);margin-left:6px;text-decoration:none}
.article-body .headerlink:hover{color:var(--c-primary)}

/* ====== SIDEBAR TOC ====== */
.article-sidebar{position:sticky;top:80px;background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--radius-lg);padding:20px;max-height:calc(100vh - 100px);overflow-y:auto}
.article-sidebar .toc{font-size:.82rem;line-height:1.6}
.article-sidebar .toc ul{list-style:none;padding-left:16px}
.article-sidebar .toc>ul{padding-left:0}
.article-sidebar .toc li{margin-bottom:4px}
.article-sidebar .toc a{color:var(--c-text-secondary);display:block;padding:3px 0}
.article-sidebar .toc a:hover{color:var(--c-primary)}

/* ====== RELATED SECTION ====== */
.related-section{margin-top:48px;padding-top:32px;border-top:2px solid var(--c-border)}
.related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin-top:20px}
.related-card{display:flex;flex-direction:column;gap:4px;padding:16px;background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--radius);transition:border-color .2s}
.related-card:hover{border-color:var(--c-primary)}
.related-keyword{font-size:.72rem;color:var(--c-primary);font-weight:700}
.related-title{font-size:.82rem;color:var(--c-text);line-height:1.5}
.related-title:hover{color:var(--c-primary)}

/* ====== CATEGORY PAGE ====== */
.category-hero{background:var(--c-hero-bg);padding:48px 0;text-align:center;color:#fff}
.category-hero-title{font-size:1.75rem;font-weight:900;margin-bottom:8px}
.category-hero-desc{font-size:.95rem;opacity:.8}

/* ====== FOOTER ====== */
.site-footer{background:var(--c-hero-bg);color:rgba(255,255,255,.75);padding:48px 0 24px;margin-top:auto}
.footer-inner{display:flex;justify-content:space-between;gap:32px;flex-wrap:wrap;margin-bottom:32px}
.footer-brand{max-width:360px}
.footer-brand .logo{display:block;font-size:1.15rem;font-weight:900;color:#fff;margin-bottom:8px}
.footer-brand p{font-size:.82rem;line-height:1.7}
.footer-nav{display:flex;flex-direction:column;gap:8px}
.footer-nav a{color:rgba(255,255,255,.75);font-size:.82rem}
.footer-nav a:hover{color:#fff}
.copyright{text-align:center;font-size:.75rem;opacity:.5;border-top:1px solid rgba(255,255,255,.1);padding-top:20px;margin-top:12px}

/* ====== RESPONSIVE ====== */
@media(max-width:1024px){
  .article-layout-inner{grid-template-columns:1fr}
  .article-sidebar{position:static;order:-1;margin-bottom:24px}
}
@media(max-width:768px){
  .hamburger{display:flex}
  .global-nav{display:none;position:fixed;top:64px;left:0;right:0;bottom:0;background:linear-gradient(180deg,#1a1a2e,#0f3460);flex-direction:column;padding:32px 24px;gap:20px;z-index:99}
  .global-nav.is-open{display:flex}
  .global-nav a{font-size:1rem}
  .hero{padding:48px 0 40px}
  .hero-title{font-size:1.5rem}
  .hero-sub{font-size:.88rem}
  .card-grid{grid-template-columns:1fr}
  .category-grid{grid-template-columns:1fr 1fr}
  .article-title{font-size:1.35rem}
  .article-body h1{font-size:1.3rem}
  .article-body h2{font-size:1.15rem}
  .article-body h3{font-size:1.05rem}
  .related-grid{grid-template-columns:1fr}
  .footer-inner{flex-direction:column}
  .section-title{font-size:1.25rem}
}