:root {
    --primary-color: #14b8a6;
    --secondary-color: #0891b2;
    --accent-color: #fb7185;
    --highlight-teal: #5eead4;
    --highlight-coral: #fda4af;
    --background-color: #0a1628;
    --surface-color: #0f2847;
    --text-color: #e2e8f0;
    --text-color-light: #ffffff;
    --border-color: #1e3a5f;
    --shadow-color: rgba(20, 184, 166, 0.3);

    --font-family-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    --font-family-heading: 'Georgia', 'Times New Roman', 'Hiragino Mincho ProN', serif;

    --header-height: 70px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-family-base);
    line-height: 1.7;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--background-color), #0d1b2a);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--highlight-teal);
    line-height: 1.3;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(94, 234, 212, 0.3);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-speed);
}

a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 8px currentColor;
}

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

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

/* Header */
.header {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.header.scrolled {
    box-shadow: 0 2px 20px var(--shadow-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo a {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--highlight-teal);
    text-shadow: 0 0 15px currentColor;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: 800px;
    justify-content: center;
}

.nav-item a {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-item a:hover, .nav-item a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color-light);
    border-color: var(--highlight-teal);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.4);
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-light);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(20, 184, 166, 0.7), 
        rgba(8, 145, 178, 0.6), 
        rgba(251, 113, 133, 0.5));
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    padding: 30px 40px;
    background: rgba(10, 22, 40, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-color-light);
    text-shadow: 0 0 20px rgba(94, 234, 212, 0.6);
}

.hero p {
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Main Content */
.page-wrapper {
    padding: 4rem 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 3fr 1fr;
    }
}

.article-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.5rem;
}

.article-meta {
    font-size: 0.9rem;
    color: #9ca3af;
}

.article-content section {
    margin-bottom: 2.5rem;
}

.article-content h2 {
    font-size: 2rem;
    border-left: 5px solid var(--accent-color);
    padding-left: 1rem;
    margin-top: 2rem;
    background: linear-gradient(90deg, rgba(251, 113, 133, 0.1), transparent);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
}

.article-content p, .article-content ul {
    margin-bottom: 1rem;
}

.article-content ul {
    padding-left: 1.5rem;
}

.article-content img.inline-image {
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 8px 25px var(--shadow-color);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

/* Feature Grid */
.feature-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-grid-item {
    background: linear-gradient(135deg, var(--surface-color), rgba(13, 27, 42, 0.8));
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    border: 1px solid rgba(20, 184, 166, 0.3);
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.feature-grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(20, 184, 166, 0.1), 
        rgba(251, 113, 133, 0.1));
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: 0;
}

.feature-grid-item:hover::before {
    opacity: 1;
}

.feature-grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--shadow-color);
    border-color: var(--accent-color);
}

.feature-grid-item > * {
    position: relative;
    z-index: 1;
}

.feature-grid-item h3 {
    color: var(--highlight-coral);
    margin-bottom: 1rem;
}

.btn-read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color-light);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all var(--transition-speed);
    border: 1px solid transparent;
    text-shadow: none;
}

.btn-read-more:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: var(--text-color-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 113, 133, 0.4);
    border-color: var(--accent-color);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.sidebar-widget {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    margin-bottom: 2rem;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--highlight-coral);
}

.toc ul {
    list-style: none;
}

.toc ul li a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.toc ul li a:hover {
    background: rgba(20, 184, 166, 0.1);
    color: var(--accent-color);
    padding-left: 0.5rem;
}

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

.news-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

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

.news-list a {
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.news-list a:hover {
    color: var(--accent-color);
}

.related-links {
    list-style: none;
}

.related-links li {
    margin-bottom: 0.5rem;
}

.related-links a {
    color: var(--accent-color);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.related-links a:hover {
    color: var(--accent-color);
}

.ad-space {
    height: 250px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    font-weight: bold;
    border-radius: 12px;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--surface-color), var(--background-color));
    color: var(--text-color);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--primary-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-color);
    opacity: 0.8;
    transition: all var(--transition-speed);
}

.footer-nav a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 991px) {
    /* モバイル時にサイドバーを本文より先に表示 */
    .main-content {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        order: -1; /* サイドバーを最初に表示 */
        position: static; /* sticky解除 */
    }

    .article-content {
        order: 1; /* 本文を後に表示 */
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--surface-color);
        box-shadow: 0 8px 25px var(--shadow-color);
        padding: 1rem 0;
        border: 1px solid rgba(20, 184, 166, 0.3);
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hamburger-inner,
    .hamburger-inner::before,
    .hamburger-inner::after {
        width: 25px;
        height: 3px;
        background: var(--highlight-coral);
        border-radius: 3px;
        position: relative;
        transition: transform 0.3s;
        box-shadow: 0 0 5px currentColor;
    }

    .hamburger-inner::before,
    .hamburger-inner::after {
        content: '';
        position: absolute;
        left: 0;
    }

    .hamburger-inner::before {
        top: -8px;
    }

    .hamburger-inner::after {
        bottom: -8px;
    }

    .hamburger.active .hamburger-inner {
        transform: rotate(45deg);
    }

    .hamburger.active .hamburger-inner::before {
        top: 0;
        transform: rotate(90deg);
    }

    .hamburger.active .hamburger-inner::after {
        bottom: 0;
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .article-content h2 {
        font-size: 1.7rem;
    }

    .feature-grid-container {
        grid-template-columns: 1fr;
    }
}