:root {
    --base-bg-color: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.7); 
    
    --text-color: #444;
    --sub-text: #999;
    --border-color: #eee;
    --accent-color: #4cd964;
    
    --bg-image: url('images/backimg.png'); 
}

[data-theme="dark"] {
    --base-bg-color: #1a1a1a; 
    --bg-overlay: rgba(26, 26, 26, 0.7); 
    
    --text-color: #eee;
    --sub-text: #888;
    --border-color: #333;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 30px;
    -webkit-font-smoothing: antialiased;

    background-color: var(--base-bg-color);
    background-image: 
        linear-gradient(var(--bg-overlay), var(--bg-overlay)), 
        var(--bg-image);
    
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    transition: color 0.3s; 
}

header {
    margin-bottom: 60px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

.nav-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 30px;
}

.nav-links {
    display: flex;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    gap: 30px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
    text-decoration: none;
    color: var(--sub-text);
    font-size: 0.85rem;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--text-color); }

.scroll-indicator {
    position: absolute;
    right: 0;
    width: 26px;
    height: 26px;
    background: var(--bg-overlay);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.menu-trigger {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.menu-trigger span { width: 24px; height: 1px; background: var(--text-color); }

.side-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    height: 100%;
    background-color: var(--bg-overlay) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px 30px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    box-sizing: border-box;
}
.side-menu.open { right: 0; }

.menu-close { 
    background: none; 
    border: none; 
    font-size: 1.2rem; 
    color: var(--text-color); 
    cursor: pointer; 
    float: right; 
}

.side-nav-links { list-style: none; padding: 0; margin-top: 60px; }
.side-nav-links li { margin-bottom: 20px; }
.side-nav-links a { text-decoration: none; color: var(--text-color); font-size: 1.1rem; }

.side-divider { border: none; border-top: 1px solid var(--border-color); margin: 30px 0; }

.setting-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.setting-item.flex-column { flex-direction: column; align-items: flex-start; gap: 12px; }

.switch-label {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    display: block;
}
.switch-circle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.switch-input { display: none; }
.switch-input:checked + .switch-label { background: var(--accent-color); }
.switch-input:checked + .switch-label .switch-circle { transform: translateX(20px); }

.lang-selector {
    display: flex;
    width: 100%;
    background: var(--border-color);
    border-radius: 8px;
    padding: 2px;
}
.lang-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 0.7rem;
    color: var(--sub-text);
    cursor: pointer;
    border-radius: 6px;
}
.lang-btn.active {
    background: var(--bg-overlay);
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: none;
    z-index: 999;
}
.overlay.open { display: block; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInUp 0.6s ease forwards; }

.news-container {
    margin-top: 40px;
    width: 100%;
}

.news-container h1 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.news-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.news-scroll::-webkit-scrollbar {
    display: none;
}

.news-item {
    flex: 0 0 240px;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateY(-5px);
}

.news-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.news-item h3 {
    padding: 15px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-color);
    white-space: normal;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.banner-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.banner-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

.banner-img {
    width: 200px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.banner-name {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.my-banner-info {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    background: transparent;
    border-style: dashed;
}

/* Blog専用スタイル */
.blog-controls { margin-bottom: 30px; }

.search-wrapper input {
    width: 100%;
    padding: 12px 18px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
    font-size: 0.9rem;
}

.tag-filters {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.tag-filters::-webkit-scrollbar { display: none; }

.tag-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-overlay);
    color: var(--sub-text);
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}
.tag-btn.active {
    background: var(--text-color);
    color: var(--base-bg-color);
    border-color: var(--text-color);
}

.blog-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.blog-card {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.blog-card:hover { transform: translateY(-3px); }

.blog-card-content { padding: 20px; }

.post-date { font-size: 0.7rem; color: var(--sub-text); }
.post-title { margin: 8px 0; font-size: 1.1rem; font-weight: 400; }
.post-tags-display { display: flex; gap: 8px; margin-top: 10px; }
.tag-label { font-size: 0.7rem; color: var(--sub-text); }

#loader {
    position: fixed;
    inset: 0;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    color: white;
    font-family: sans-serif;
}

.loader-icon {
    width: 80px;
    margin-bottom: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    :root {
        --bg-image: url('./images/backimg2.png');
    }
}

footer { margin-top: 100px; font-size: 0.7rem; color: var(--sub-text); }
