/* =========================================================
    1. 基础重置与锚点修正
========================================================= */
        body, h1, h2, h3, p, ul, li { margin: 0; padding: 0; box-sizing: border-box; }
        html { scroll-padding-top: 42px; }
        body { 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
            line-height: 1.6; color: #333; background-color: #f8fafc; 
            padding-top: 68px; 
        }
        ul { list-style: none; }
        a { text-decoration: none; color: inherit; }
        header{
            background: -webkit-linear-gradient(top, #c9dbe9 0%, #fff 100%);
        }

/* Header height=42px logo height=39px */
.benri-logo {
    height: 39px; 
    width: auto;  
    vertical-align: middle;
}

/* =========================================================
   全站共通内容容器 (完美对齐基准)
========================================================= */
.header-container,
.footer-container,
.content-container {
    width: 92%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto; /* 保证左右绝对居中 */
}

/* 平板/手机端安全边距 */
@media (max-width: 1000px) {
    .header-container,
    .footer-container,
    .content-container {
        width: calc(100% - 40px);
    }
}

        /* =========================================================
           2. V2 页头主结构
        ========================================================= */
        #v2-header {
            position: fixed;
            top: 0; left: 0; 
            width: 100%; 
            height: 68px; 
            background-color: #ffffff;
            border-bottom: 1px solid #e2e8f0;
            z-index: 1000;
            transition: all 0.3s ease-in-out; 
            display: flex;
            align-items: center;
        }

        #v2-header.scrolled {
            height: 42px; 
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
            border-bottom: none;
        }

        .header-container {
            position: relative; 
            width: 92%;        
            max-width: 1440px; 
            margin: 0 auto;    
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;
        }

        @media (max-width: 1000px) {
            .header-container { width: calc(100% - 40px); }
        }

        .v2-logo a { display: flex; align-items: center; }
        .v2-logo img { height: 36px; margin-right: 10px; }

        /* =========================================================
           3. 桌面端导航菜单
        ========================================================= */
        .v2-nav { 
            flex: 1; 
            display: flex; 
            justify-content: center; 
            height: 100%; 
            padding-left: 30px; 
        }
        .v2-nav-list { 
            display: flex; 
            width: 100%; 
            max-width: 1000px; 
            height: 100%; 
        }
        .v2-nav-item { 
            flex: 1; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            height: 100%; 
        }
        
        .v2-nav-link {
            width: 100%;
            justify-content: center; 
            padding: 0 10px;
            font-size: 15px;
            font-weight: bold;
            color: #475569;
            display: flex;
            align-items: center;
            height: 100%;
            transition: color 0.2s;
            cursor: pointer;
        }
        
        .v2-nav-link:hover,
        .v2-nav-item:hover .v2-nav-link,
        .v2-nav-link.active { 
            color: #1629CC; 
        }

        /* =========================================================
           4. 下拉菜单面板
        ========================================================= */
        .v2-dropdown {
            position: absolute; 
            top: 100%;
            left: 0; 
            width: 100%; 
            background: #ffffff;
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
            border: 1px solid #e2e8f0;
            border-top: 2px solid #1629CC;
            border-radius: 0 0 8px 8px;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease-in-out;
            min-height: 200px; 
        }
        .v2-dropdown.show { opacity: 1; visibility: visible; }

        .dropdown-grid { display: grid; padding: 25px; gap: 30px; }

        /* ★ 修复魔法：强制限制 Grid 列的最小宽度，防止被内部的不换行文字撑爆屏幕 */
        .dropdown-grid > div,
        .dropdown-grid > li {
            min-width: 0; 
        }
        .grid-fav { grid-template-columns: 1fr 1fr 1fr 1fr; }
/* =========================================================
   只针对【お気に入り (dropdown-fav)】菜单的特殊 3+1 布局
========================================================= */

/* 限定只在 お気に入り 菜单下，第一个大框(マイツール)才占据 3 列 */
#dropdown-fav .grid-fav > div:first-child {
    grid-column: span 3; 
    min-width: 0; 
}

/* 限定只在 お気に入り 菜单下，第一个大框里的列表才执行“每列5行”的魔法 */
#dropdown-fav .grid-fav > div:first-child .dropdown-list {
    display: grid;
    grid-template-rows: repeat(5, auto); 
    grid-auto-flow: column;              
    grid-auto-columns: minmax(0, 1fr); 
    column-gap: 30px;                    
}

/* 针对超长文字的省略号截断处理（同样严格限定） */
#dropdown-fav .grid-fav > div:first-child .dropdown-list li {
    min-width: 0; 
}

#dropdown-fav .grid-fav > div:first-child .dropdown-list a {
    display: block;
    width: 100%;
    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;  
}

        
        .grid-history { grid-template-columns: 1.5fr 1fr 1fr; }

        .dropdown-col-title { 
            font-size: 14px; 
            font-weight: bold; 
            color: #94a3b8; 
            border-bottom: 2px solid #f1f5f9; 
            padding-bottom: 8px; 
            margin-bottom: 12px; 
            display: flex; 
            align-items: center; 
            gap: 6px; 
            transition: color 0.2s; 
        }
        .dropdown-col-title svg {
            width: 16px;
            height: 16px;
            fill: currentColor; 
            flex-shrink: 0; 
            transition: fill 0.2s; 
        }

        .dropdown-grid div:hover > .dropdown-col-title {
            color: #1629CC;
        }

        .dropdown-list li { margin-bottom: 10px; }
        .dropdown-list a { 
            font-size: 14px; color: #334155; 
            display: block;
            padding: 4px 0; 
            transition: color 0.2s; 
            width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .dropdown-list a:hover { color: #1629CC; text-decoration: underline; }
        
        .mobile-view-more { display: none; }

        .static-col { background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px dashed #cbd5e1; }

        .history-footer {
            padding: 12px 25px;
            background: #f8fafc;
            border-top: 1px dashed #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-radius: 0 0 8px 8px;
        }
        .privacy-note {
            font-size: 11px;
            color: #94a3b8;
        }
        .clear-history-btn {
            background: transparent;
            border: 1px solid #cbd5e1;
            color: #64748b;
            padding: 4px 10px;
            border-radius: 4px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 4px;
            outline: none;
        }
        .clear-history-btn:hover {
            color: #ef4444;
            border-color: #fca5a5;
            background: #fef2f2;
        }

        /* =========================================================
           5. 移动端菜单及交互
        ========================================================= */
        .mobile-page-title { display: none; } 
        .mobile-toggle { display: none; cursor: pointer; } 
        
        @media (max-width: 860px) {
            .mobile-toggle { 
                display: flex; flex-direction: column; justify-content: space-between; 
                width: 24px; height: 18px; position: relative; z-index: 1010;
            }
            .mobile-toggle span {
                display: block; width: 100%; height: 2px;
                background-color: #333; border-radius: 2px;
                transition: all 0.3s ease-in-out; transform-origin: center;
            }
            .mobile-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
            .mobile-toggle.active span:nth-child(2) { opacity: 0; }
            .mobile-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

            .mobile-page-title {
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                overflow: hidden; font-size: 13px; line-height: 1.3;
                font-weight: bold; color: #334155; text-align: center;
                flex: 1; margin: 0 15px;
            }

            .v2-nav {
                position: absolute; top: 100%; left: 0; width: 100%;
                background: #fff; box-shadow: 0 10px 10px rgba(0,0,0,0.1);
                flex-direction: column; padding-left: 0;
                display: flex; height: auto; max-height: 0; opacity: 0;
                visibility: hidden; overflow: hidden;
                transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, visibility 0.4s;
            }
            .v2-nav.mobile-open { 
                max-height: 85vh; opacity: 1; visibility: visible; overflow-y: auto;
            }
            .v2-nav-list { flex-direction: column; width: 100%; height: auto; }
            .v2-nav-item { width: 100%; flex: none; flex-direction: column; align-items: flex-start; border-bottom: 1px solid #f1f5f9; }
            .v2-nav-link { width: 100%; padding: 15px 20px; justify-content: space-between; min-height: 48px; text-align: left; }
            
            .v2-dropdown {
                position: static; width: 100%; box-shadow: none; border: none; 
                display: block; max-height: 0; overflow: hidden;
                opacity: 0; visibility: hidden; border-radius: 0; min-height: 0; background: #f8fafc;
                transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, visibility 0.4s ease-in-out;
            }
            .v2-dropdown.mobile-show { 
                max-height: 1500px; opacity: 1; visibility: visible; border-top: 1px dashed #e2e8f0;
            }
            .dropdown-grid { grid-template-columns: 1fr !important; gap: 10px; padding: 15px 20px; }

            /* =========================================================
               ★ 今回の修正箇所：スマホ版アコーディオン（手風琴）スタイル
            ========================================================= */
            .dropdown-col-title {
                cursor: pointer;
                position: relative;
                margin-bottom: 0 !important;
                padding-top: 10px;
                padding-bottom: 10px !important;
            }
            /* 右端の矢印アイコン */
            .dropdown-col-title::after {
                content: '▼';
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
                font-size: 10px;
                color: #94a3b8;
                transition: transform 0.2s;
            }
            .dropdown-col-title.expanded {
                margin-bottom: 10px !important;
            }
            /* 展開時の矢印回転 */
            .dropdown-col-title.expanded::after {
                transform: translateY(-50%) rotate(180deg);
            }

            /* 次級メニュー（初期は隠す） */
            .dropdown-list {
                max-height: 0;
                overflow: hidden;
                opacity: 0;
                transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
            }
            /* 展開時の次級メニュー */
            .dropdown-list.mobile-expanded {
                max-height: 1500px;
                opacity: 1;
                margin-bottom: 15px;
            }
            /* ========================================================= */

            .dropdown-list .desktop-item {
                display: list-item !important;
            }
            
            .dropdown-list .mobile-view-more {
                display: block !important;
                padding-left: 24px; 
            }
            .dropdown-list .empty-msg {
                padding-left: 24px !important;
            }

            .history-footer {
                flex-direction: column;
                gap: 12px;
                padding: 15px 20px;
                text-align: left;
                align-items: flex-start;
            }

            #fav-dynamic-area {
                flex-direction: column !important;
                gap: 20px !important; 
            }
            #fav-dynamic-area > div {
                width: 100% !important;
            }
        }

        /* 页面内容容器 */
        .main-content { 
            width: 92%; 
            max-width: 1440px; 
            margin: 40px auto; 
            padding: 30px; 
            background: #fff; 
            border-radius: 12px; 
            box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
        }
        .section-box { height: 600px; margin-top: 30px; padding: 20px; background: #f1f5f9; border-radius: 8px; }


    .content-container,
    .Container {
            background-color: #f8fafc;
            background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
            background-size: 20px 20px;
    }

/* =========================================================
   6. 共通面包屑导航 & 右侧操作按钮 (Breadcrumb V2)
========================================================= */
.breadcrumb-container {
    width: 100%;
    margin: 15px auto; /* 与下方 H1 保持合适的间距 */
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* 允许手机端换行 */
    gap: 10px;       /* 换行时的上下间距 */
}

@media (max-width: 1000px) {
    .breadcrumb-container {
        width: calc(100% - 40px);
    }
}

ul.CrumbList,
ul.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    color: #64748b; 
    margin: 0;
    padding: 0;
    flex: 1 1 auto; /* 让面包屑自适应占据剩余空间 */
    min-width: 0;   /* 防止超长标题撑爆容器边界 */
}

ul.CrumbList li, ul.breadcrumb li { display: inline-flex; align-items: center; white-space: nowrap; }
ul.CrumbList li a, ul.breadcrumb li a { color: #475569; text-decoration: none; transition: color 0.2s ease; }
ul.CrumbList li a:hover, ul.breadcrumb li a:hover { color: #1629CC; }
ul.CrumbList li.separator { margin: 0 10px; color: #cbd5e1; font-size: 12px; }
ul.CrumbList li:not(.separator):not(:last-child)::after { content: '/'; margin: 0 10px; color: #cbd5e1; font-weight: normal; }
ul.CrumbList li:last-child { color: #94a3b8; pointer-events: none; font-weight: 500; }

/* ---------------------------------------------------------
   7. 右侧操作按钮区 (放在面包屑容器内部)
--------------------------------------------------------- */
.tool-action-bar {
    display: flex;
    gap: 12px;
    margin-left: auto; /* 核心魔法：自动把按钮推到容器的最右侧！ */
    flex-shrink: 0;    /* 防止按钮被过长的面包屑挤扁 */
}

/* 共通按钮样式 */
.action-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: #64748b; transition: all 0.2s ease; outline: none; }
.action-btn:hover { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.action-btn svg { width: 16px; height: 16px; fill: currentColor; transition: all 0.2s ease; }

/* 收藏按钮激活状态 */
.action-btn.fav-btn.active { background: #fef3c7; border-color: #fde68a; color: #b45309; }
.action-btn.fav-btn.active svg { fill: #f59e0b; }

/* 手机端响应式 */
@media (max-width: 600px) {
    .btn-text { display: none; }
    .action-btn { padding: 8px 10px; }
}

/* 气泡提示 (Toast) */
.fav-btn { position: relative; }
.fav-toast { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(10px); background: #334155; color: #ffffff; padding: 6px 12px; border-radius: 6px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none; z-index: 100; }
.fav-toast::before { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 5px 5px 0 5px; border-style: solid; border-color: #334155 transparent transparent transparent; }
.fav-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }



.footer-container {
    padding: 20px 0; /* 只保留 Footer 特有的上下内边距 */
}