:root {
    --apple-red: #fa233b;
    --sidebar-bg: #f9f9f9;
    --border-color: #e5e5e5;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
}

body.apple-style {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    /* 1. 提升高度：从 44px 提升到 52px 或 56px，产生旗舰感 */
    height: 56px;
    display: flex;
    justify-content: flex-end; /* 保持内容靠右 */
    align-items: center;
    padding: 0 24px;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px); /* 磨砂玻璃效果 */

    /* 2. 核心：增加那条“消失的线” */
    /* 使用 0.5px 可以在 Retina 屏上产生极细的丝绸感 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);

    position: sticky;
    top: 0;
    z-index: 100;
}

/* 1. 侧边栏整体：固定宽度，解耦高度，吸附左侧 */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed; /* 核心：脱离文档流，不干扰右侧内容 */
    left: 0;
    top: 0;
    background-color: #f9f9f9; /* 苹果风格浅灰色背景 */
    border-right: 1px solid rgba(0, 0, 0, 0.12); /* 提高透明度至 12% */
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.brand-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 30px;
}

/* 1. 侧边栏头部：进一步压缩顶部间距，实现“上移” */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 核心：回归左对齐 */
    padding: 16px 0 8px 20px;
    /* 向上提升整体位置 */
    margin-top: -5px;
}

.sidebar-nav {
    padding: 0 10px; /* 侧边留白缩小 */
    margin-top: 10px;
}

/* 2. 第一行：Logo 和 标题 */
.brand-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: -4px; /* 让图标和文字更聚拢 */
}

/* Logo 样式：品牌视觉起点 */
.donkey-logo {
    width: 52px;
    height: auto;
    margin-bottom: 4px;
    margin-left: -2px; /* 视覚微調：补偿图片边缘透明度，确保绝对左对齐 */
    margin-top: 0;
}

/* 文字组：主标题与副标题 */
.brand-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px; /* 标题与 Slogan 之间的紧凑间距 */
}

/* 主标题：Donkey Japanese / Donkey Jepang */
.main-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

/* Slogan： 副标题/标语：兼容 10 语种长短不一的终极方案 */
.sub-title {
    font-size: 16px;
    font-weight: 500;
    color: #636366;
    margin-top: 2px; /* 极限贴近标题 */
    text-align: left; /* 回归左对齐 */
    margin-bottom: -6px; /* 为下方列表留出一丁点呼吸空间 */
}

.nav-link {

    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500; /* 基础字重 */
    border-radius: 8px;
    text-decoration: none;

    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    /*transition: background-color 0.2s ease;*/
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* 丝滑过渡 */
    color: #48484a; /* 默认稍微淡一点 */
    background-color: transparent;
}


.nav-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    list-style: none;
    margin: 0 12px 2px 12px; /* 核心：给条目左右留出 12px 间隙 */
}

.nav-item img {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    /* 未選択時はグレー、ホバー時や選択時に赤くする */
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.2s;
}

.nav-item.active img {
    filter: none; /* 元の赤色（またはCSSでの色制御）に戻す */
    opacity: 1;
}

.nav-icon {
    width: 20px; /* 从 20px 增加到 22px */
    height: 20px;
    margin-right: 12px; /* 增加与文字の间距，更有空气感 */

    /* 線条稍微加粗，防止在大屏下发虚 */
    stroke-width: 1.8px;
    filter: opacity(0.6);
}

/* 3. 増強激活態（選中）の視覚衝撃力 - 終極修復版 */
.nav-item.active .nav-link {
    /* 核心修改：背景色调到 0.12，既能看清選中，又保持透明感 */
    background-color: rgba(0, 0, 0, 0.08);

    /* 核心修改：文字颜色。如果你喜欢红色，可以用红色，但背景一定要浅 */
    /* 如果你觉得红色还是不够亮，就改回純黑 #000000 */
    color: #000000;

    /* 核心修改：字重 600 は黄金比例，比 700 よりも明確 */
    font-weight: 600;

    /* 增加一个非常に微妙な 0.5px 内辺距線，増加立体感 */
    /*box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.05);*/
}

.nav-link.active {
    background-color: rgba(0, 0, 0, 0.1) !important;
    color: #000; /* 文字変深 */
    font-weight: 600;
}

.nav-item.active .nav-link,
.nav-link:hover {
    /* 核心修改：棄用実色，使用 0.06 - 0.08 の黒色透明度 */
    background-color: rgba(0, 0, 0, 0.08);

    /* 核心修改：選中時文字変黒，生み出す「押された」感覚 */
    color: #000000;
    font-weight: 600; /* 選中時少し太くして、視覚フィードバック */
}

.nav-item.active .nav-icon {
    filter: grayscale(0); /* もしアイコンがあれば、それを完全黒または完全彩に戻す */
    opacity: 1;
    /* もしあなたの SVG が黒色の場合は、このフィルタをオンにすると即座に赤くなる */
    /* filter: invert(27%) sepia(91%) saturate(2352%) hue-rotate(331deg) brightness(95%) contrast(100%); */
}

.nav-link:hover:not(.active) {
    background-color: transparent; /* 高さ背景を除去 */
    color: #1d1d1f; /* 文字を少し濃くして、ガイド */
    font-weight: 500; /* 太くしないように */
    background-color: rgba(0, 0, 0, 0.05);
}

/*
.nav-link:active {
    background-color: rgba(0, 0, 0, 0.04);
    transform: scale(0.98);
}*/

/* 仿 Apple 標準の側边栏小タイトル */
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #86868b; /* Apple 次級テキストグレー */
    padding: 18px 0 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* 1. トップツールバー：極致窄条，解耦独立 */

.top-bar {
    /* 1. 核心高度ロック */
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;             /* 必須占满右侧すべての空間 */
    height: 56px;
    padding: 0 12px;         /* 右側に 32px の呼吸感 */
    box-sizing: border-box;

    /* 2. 必須設定为半透明背景、それ以外はぼかし効果が通らない */
    /* 使用 rgba(255, 255, 255, 0.7) で 70% 透明度 */
    background-color: rgba(255, 255, 255, 0.72);

    /* 3. 核心：ガウスぼかし (磨砂ガラス) */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%); /* Safari 互換 */

    position: sticky; /* 吸頂 */
    top: 0;
    z-index: 1000;

    /* 5. 枠線を除去して無縁感を保つが、極淡い投影を追加して深さを模倣 */
    border: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);

    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px); /* 磨砂ガラス効果 */

    /* 核心修正：ログインボタンの下の線を追加 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}


/* 2. 内部コンテナ：padding-top で位置を微調整して、要素を少し下げる */
.top-bar-right {
    display: flex;
    gap: 16px;
    align-items: center;

    /* コンテナの高さが padding によって太くなるのを防ぎ、ヘッダーの狭さを維持 */
    box-sizing: border-box;
    margin: 0;

    /* 追加：言語選択器とログインボタン全体を左に移動 */
    margin-right: 30px;
}

/* 言語選択器ラッパー */
.lang-selector-wrapper {
    margin-right: 6px;  /* 追加：言語選択バーを 6 ピクセル左に移動 */
}


/* 3. 赤色ログインボタン：Apple Music コアカラー（重磅深赤） */
.btn-signin {

    display: inline-flex;
    /* 核心修正：高さを 28px に保ちつつ、左右のパディングを広げるで「長条カプセル」感を出す */
    height: 28px;
    padding: 0 16px;

    /* 核心修正：ピンクの赤を放棄し、Apple 測定の深赤 #d60017   #fa233b*/
    background-color: #d60017;
    color: #ffffff;

    /* 核心修正：Apple の丸みは高さの半分（14px）で完全な弧度を形成 */
    border-radius: 6px;

    /* 核心修正：フォントサイズを小さくして 13px にし、ウェイトを最高 (700) にし、緊致感を出す */
    font-size: 14px;
    font-weight: 700;

    text-decoration: none;
    display: inline-flex; /* 垂直水平絶対中央 */
    align-items: center;
    justify-content: center;

    /* 核心修正：シャドウは赤ではなく、極淡い黒の投影で、ボタンが「沈む」ようにする */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);

    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-signin span {
    display: inline-block;
    transform: translateY(-1px); /* 1 ピクセル上にずらすのが最も正確 */
}

/* ホバーフィードバック：Apple 風格の軽い薄め */
.btn-signin:hover {
    background-color: #f52d48;
    opacity: 0.9;
}

/* 4. 言語選択ボックス：同期大フォント */
.apple-select {
    height: 30px;
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 500;
    padding: 4px 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 7px;
    background-color: #fff;
    outline: none;
}

/* 底部ボタン */
/* 4. 底部ボタン：ミュージックで開く 風格 */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.weather-icon-mask {
    width: 18px;
    height: 18px;
    background-color: #1d1d1f; /* 初期色は苹果深灰 */
    display: inline-block;
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
}

.open-music-btn {
    font-size: 12px;
    color: #86868b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    transition: background 0.2s;
}

.open-music-btn:hover {
    background-color: #ffffff;
}

/* 主内容区背景 */
.main-content {
    background-color: #ffffff;
    flex: 1;
    margin-left: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

/* 主内容区視口 */
/* main.css */
.content-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: transparent;

    /* 1. 彻底释放右侧空间 */
    padding-right: 0 !important;
    padding-left: 0 !important; /* 建議左右边距都交给子元素控制，这样線才能到頭 */

    position: relative !important;
    overflow: hidden !important; /* 確保父級不スクロール */
    align-items: stretch;

    /* 2. 关键：删除或注释掉这一行 */
    /* scrollbar-gutter: stable; */

    z-index: 1;
    height: 100vh;
}


/* 滚动条轨道透明，让导航栏白色背景覆盖 */
.content-viewport::-webkit-scrollbar-track {
    background: transparent;
}
/* 2. 移除内容区の padding 挤压 */
.has-ad-padding {
    padding-right: 0 !important; /* 不再通過 padding 避讓，防止导航栏缩短 */
}

.ad-paper-card-sticky {
    width: 160px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    /* If希望广告在内容很长时能“粘”在屏幕上，可以使用 sticky */
    position: sticky;
    top: 0;
}

/* 浮層コンテナ：画面右側に固定 */
.fixed-ad-layer {
    position: fixed;
    right: 20px;         /* 画面右端からの距離 */
    top: 50%;            /* 画面垂直中央 */
    transform: translateY(-50%);
    width: 300px;        /* 幅を 300px に固定 */
    height: 600px;       /* 高さを 600px に固定 */
    z-index: 999999;     /* すべてのコンテンツの上に表示 */
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);

    /* 角丸問題の解決 */
    border-radius: 0 !important;
}

/* iframe はコンテナを満たす */
.fixed-ad-layer iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 閉じるボタンスタイル */
.ad-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* レスポンシブ：画面が小さくなった場合（例えばスマートフォン）自動的に非表示にし、コンテンツを覆うのを防ぐ */
@media (max-width: 1300px) {
    .fixed-ad-layer {
        display: none;
    }
}


/* 复刻スクリーンショット中リストの白い容器感 */
.content-viewposrt {
    background-color: #ffffff; /* リストエリアは純白 */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02); /* 极細微のシャドウ、紙張感を生み出す */
    margin-top: 30px;
}

/* 赤色ハイライトアイテム (スクリーンショット中の選択曲) */
.active-item {
    background-color: var(--apple-red); /* #fa233b */
    color: #ffffff;
    border-radius: 8px;
}

/* --- 插入開始 --- */
[v-cloak] { display: none; }

/* 1. 独立广告列：固定定位，不占用文档流 */
.global-ad-sidebar {
    position: fixed;
    right: 0;
    width: 160px;
    height: 600px; /* 限制高度，不要让它无限延伸 */
        /* pointer-events: none; 容器不挡人 */

    border: 2px solid red !important; /* 临时调试：红色边框 */
    background: rgba(255, 255, 0, 0.2) !important; /* 临时调试：黄色半透明背景 */

    flex-shrink: 0;
    margin-left: 20px;
    overflow: hidden;
    /*background: transparent !important; /* 关键：确保容器背景不挡人 */
    z-index: 50; /* 低于顶部导航栏の 1000 */
    pointer-events: none;
}

/* 2. 广告栏容器：外挂模式 */
.global-ad-sidebar-absolute {
    position: absolute;
    top: 4px;
    right: 2px;
    width: 160px !important;
    flex-shrink: 0;

    /* 调试蓝色框 */
    border: 2px solid blue !important;
    background: rgba(0, 0, 255, 0.05);

    z-index: 100;
    transition: top 0.3s ease;
}

.ad-sidebar-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ad-header { font-size: 10px; color: #86868b; text-align: center; padding: 10px 0; letter-spacing: 1px; }
.ad-visual-placeholder {
    background: #f5f5f7;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #1d1d1f;
}
.ad-size-tag { font-weight: 600; font-size: 16px; }
.ad-plus-icon { font-size: 30px; color: #0071e3; margin: 10px 0; }
.ad-hint { font-size: 12px; color: #86868b; }

/* 3. 調试用蓝色边框容器 */
.ad-debug-container {
    width: 160px;
    height: 600px;
    border: 2px solid blue !important; /* 蓝色调试边框 */
    background-color: rgba(0, 0, 255, 0.05); /* 淡淡の蓝色底，方便看清范围 */
    box-sizing: border-box;
    border-radius: 2px;
    overflow: hidden;
}

/* 2. 广告カード：sticky 定位跟随滚动 */
.ad-paper-card {
    position: sticky;
    top: 140px; /* 默认位置：二级导航下方 */
    width: 100% !important; /* 撑满 160px の父容器 */
        height: 100% !important;
        background: #ffffff;
        border-radius: 12px;
        margin: 0 !important;
        /* 窄版阴影要更聚拢一些，显得精致 */
        box-shadow: 0 4px 16px rgba(0,0,0,0.06);
        border: 1px solid rgba(0,0,0,0.05);
        overflow: hidden;
        pointer-events: auto; /* 只有カード部分响应点击 */
}

/* 3. 内容区：自動填充右侧空間 */
.module-render-area {
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden !important;

    padding-right: 0 !important;
    margin-right: 0 !important;

    width: auto !important;
    background-color: #fafafa;
}

/* ============================================================
   占位模块样式 (JLPT / Download / Culture / Business)
   ============================================================ */
.placeholder-module-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    background-color: #fafafa;
}

.placeholder-content {
    text-align: center;
    padding: 40px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.placeholder-title {
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 8px 0;
}

.placeholder-desc {
    font-size: 14px;
    color: #86868b;
    margin: 0;
}

