        * { margin: 0; padding: 0; box-sizing: border-box; }
        html { -webkit-text-size-adjust: 100%; }
        body {
            font-family: "Microsoft YaHei", "PingFang SC", "SimSun", sans-serif;
            background: linear-gradient(135deg, #f7f3ea 0%, #e8ddd0 100%);
            min-height: 100vh;
            min-height: 100dvh;
            padding: 25px;
            overflow-x: hidden;
        }
        html.study-embed body { padding: 0 !important; margin: 0 !important; }
        .container { max-width: 1400px; margin: 0 auto; width: 100%; }
        html.study-embed .container { max-width: none; margin: 0; width: 100%; height: 100%; }
        .title {
            text-align: center; color: #5c3d2e; margin-bottom: 6px;
            font-size: 30px; font-weight: bold; letter-spacing: 6px;
        }
        .subtitle {
            text-align: center; color: #8b6914; margin-bottom: 20px;
            font-size: 15px; letter-spacing: 2px;
        }
        .tab-nav {
            display: flex; justify-content: center; gap: 6px;
            margin-bottom: 18px; flex-wrap: wrap;
        }
        .tab-btn {
            padding: 10px 22px; border: 2px solid #c9b896; background: #fffef8;
            color: #6b5344; font-size: 14px; font-weight: bold; cursor: pointer;
            border-radius: 8px 8px 0 0; transition: all 0.25s; letter-spacing: 1px;
        }
        .tab-btn:hover { background: #faf6ed; color: #8b4513; }
        .tab-btn.active {
            background: linear-gradient(180deg, #daa520 0%, #b8860b 100%);
            color: #fff; border-color: #b8860b;
            box-shadow: 0 -2px 8px rgba(184,134,11,0.3);
        }
        .tab-content { display: none; }
        .tab-content.active { display: block; }
        .main-content {
            display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
        }
        .diagram-wrapper {
            flex: 1; min-width: 700px; max-width: 820px;
            background: #fffef8; border-radius: 0 14px 14px 14px;
            padding: 20px; box-shadow: 0 4px 24px rgba(92, 61, 46, 0.15);
            border: 2px solid #d4c4a8;
        }
        .legend-wrapper {
            width: 410px; background: #fffef8; border-radius: 14px;
            padding: 24px; box-shadow: 0 4px 24px rgba(92, 61, 46, 0.15);
            border: 2px solid #d4c4a8; max-height: calc(100vh - 140px);
            overflow-y: auto; align-self: flex-start;
        }
        .legend-wrapper.is-collapsed {
            width: auto; min-width: 148px; max-width: 220px;
            max-height: none; overflow: visible; padding: 10px 12px;
        }
        .legend-wrapper.is-collapsed > *:not(.legend-title) {
            display: none !important;
        }
        .legend-title {
            font-size: 19px; color: #5c3d2e; margin-bottom: 18px;
            padding-bottom: 10px; border-bottom: 2px solid #d4c4a8;
            text-align: center; letter-spacing: 3px;
            cursor: pointer; user-select: none;
        }
        .legend-wrapper.is-collapsed .legend-title {
            margin-bottom: 0; padding-bottom: 0; border-bottom: 0;
            font-size: 14px; letter-spacing: 1px;
        }
        .legend-fold-hint {
            display: block; margin-top: 4px;
            font-size: 11px; font-weight: 400; color: #8b7355; letter-spacing: 0;
        }
        .legend-section { margin-bottom: 18px; }
        .legend-section h4 {
            color: #8b4513; font-size: 14px; margin-bottom: 10px;
            padding-left: 8px; border-left: 3px solid #cd853f; letter-spacing: 1px;
        }
        .legend-item {
            display: flex; align-items: center; margin-bottom: 7px;
            font-size: 12.5px; color: #4a3728; line-height: 1.4;
        }
        .legend-icon {
            width: 30px; height: 20px; margin-right: 10px; flex-shrink: 0;
            display: flex; align-items: center; justify-content: center;
        }
        .legend-line { width: 26px; height: 0; border-top: 2.5px solid; }
        .legend-line-dashed { width: 26px; height: 0; border-top: 2.5px dashed; }
        .legend-solid { width: 26px; height: 3px; border-radius: 2px; }
        .legend-dot { width: 12px; height: 12px; border-radius: 50%; }
        .legend-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid; }
        .note-text {
            font-size: 12px; color: #5c4a3a; line-height: 1.65;
            padding: 10px 12px; background: #faf6ed; border-radius: 6px;
            border-left: 3px solid #daa520;
        }
        svg { width: 100%; height: auto; }
        /* 六经整圆热区：含空白环；脏腑不再单独接点击（穿透到 jing-node） */
        .jing-node {
            cursor: pointer;
            fill: rgba(255, 255, 255, 0.01);
            stroke: transparent;
            stroke-width: 2;
            pointer-events: all;
            transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
        }
        .jing-node:hover {
            fill: rgba(218, 165, 32, 0.08);
            stroke: rgba(184, 134, 11, 0.45);
        }
        .jing-node.study-hl {
            fill: rgba(218, 165, 32, 0.18) !important;
            stroke: #daa520 !important;
            stroke-width: 3.5 !important;
            filter: drop-shadow(0 0 6px rgba(218, 165, 32, 0.55));
        }
        .zang-node { pointer-events: none; cursor: inherit; transition: all 0.2s ease; }
        .zang-node:hover { filter: none; }
        .zang-node.study-hl circle {
            stroke-width: 3.5 !important;
            filter: drop-shadow(0 0 5px rgba(218, 165, 32, 0.65));
        }

        .wuzhi-tag { cursor: pointer; pointer-events: all; }
        .biao-tag { cursor: pointer; pointer-events: all; }
        /* 透明加宽热区：移动端手指可点到「误」「表」 */
        .wuzhi-tag .tag-hit,
        .biao-tag .tag-hit {
            fill: rgba(0, 0, 0, 0.001) !important;
            stroke: none !important;
            opacity: 1 !important;
            pointer-events: all !important;
            cursor: pointer;
        }
        .tooltip {
            position: absolute; background: rgba(45, 28, 15, 0.97);
            color: #fff8e7; padding: 12px 16px; border-radius: 8px;
            font-size: 12.5px; pointer-events: none; opacity: 0;
            transition: opacity 0.2s; z-index: 100; max-width: 320px;
            line-height: 1.6; box-shadow: 0 4px 16px rgba(0,0,0,0.35);
        }
        .tooltip strong { color: #ffd700; }
        .tooltip .jing-title {
            color: #ffd700; font-weight: bold; font-size: 13.5px;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px dashed rgba(255,215,0,0.4);
        }
        .tooltip .zang-title {
            color: #82e0aa; font-weight: bold; font-size: 13.5px;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px dashed rgba(130,224,170,0.4);
        }
        .tooltip .wz-title {
            color: #ff6b35; font-weight: bold; font-size: 13.5px;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px dashed rgba(255,107,53,0.5);
        }
        .tooltip .wz-sub { color: #ffa726; font-weight: bold; margin-top: 6px; font-size: 12px; }
        .tooltip .wz-item { padding-left: 10px; font-size: 12px; }
        .tooltip .path-jin-title {
            color: #ff6b6b; font-weight: bold; font-size: 13.5px;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px dashed rgba(255,107,107,0.5);
        }
        .tooltip .path-tui-title {
            color: #58d68d; font-weight: bold; font-size: 13.5px;
            margin-bottom: 6px; padding-bottom: 6px;
            border-bottom: 1px dashed rgba(88,214,141,0.5);
        }
        .tooltip .path-section { color: #ffd700; font-weight: bold; margin-top: 8px; font-size: 12px; }
        .tooltip .path-item { padding-left: 10px; font-size: 11.5px; line-height: 1.5; }
        .tooltip .path-formula { color: #f5b041; font-style: italic; font-size: 11.5px; margin-top: 4px; }
        .path-tooltip { transition: stroke-width 0.2s, filter 0.2s; stroke-linecap: round; }
        .path-tooltip:hover,
        .path-tooltip.path-hover { stroke-width: 4.5 !important; filter: drop-shadow(0 0 5px rgba(255,255,255,0.55)); }
        /* 透明加宽热区：便于点选病进/病退箭头 */
        .path-hit {
            fill: none !important;
            stroke: rgba(0, 0, 0, 0.01) !important;
            stroke-width: 24 !important;
            stroke-dasharray: none !important;
            stroke-linecap: round !important;
            marker-end: none !important;
            transition: none !important;
            filter: none !important;
            cursor: pointer;
            pointer-events: stroke;
        }
        .path-hit:hover { stroke-width: 24 !important; filter: none !important; }
        /* 图①气血流注：依次短暂隐现，示如环无端（JS 驱动，兼容性更好） */
        .flow-path {
            transition: opacity 0.4s ease, filter 0.4s ease;
        }
        .flow-path.flow-dim {
            opacity: 0.08;
            filter: grayscale(0.3);
        }
        .flow-path.flow-lit {
            opacity: 1;
            filter: drop-shadow(0 0 3px rgba(46, 139, 87, 0.75));
            stroke-width: 2.8;
        }
        .footer {
            text-align: center; margin-top: 22px; color: #8b7355;
            font-size: 12.5px; letter-spacing: 1px;
        }
        .theory-box {
            background: #faf6ed; border-radius: 8px; padding: 12px 14px;
            margin-top: 14px; border: 1px dashed #c9b896;
        }
        .theory-box h5 { color: #8b4513; margin-bottom: 6px; font-size: 13.5px; }
        .theory-box p { font-size: 12px; color: #5c4a3a; line-height: 1.65; }
        .zang-label { font-size: 12px; font-weight: bold; pointer-events: none; }
        .jing-label { font-size: 10px; pointer-events: none; }

        .path-label {
            font-size: 9px; font-weight: bold; pointer-events: none;
            paint-order: stroke fill;
            stroke: #fffef8; stroke-width: 3px; stroke-linejoin: round;
        }
        .ziwu-label {
            font-size: 8.5px; font-weight: 600; fill: #1a6b3c;
            pointer-events: none;
            paint-order: stroke fill;
            stroke: #fffef8; stroke-width: 3px; stroke-linejoin: round;
        }
        .route-label {
            font-size: 10.5px; font-weight: bold; pointer-events: none;
            paint-order: stroke fill;
            stroke: #fffef8; stroke-width: 3.5px; stroke-linejoin: round;
        }
        .diagram-wrapper svg text { paint-order: stroke fill; }
        .tip-hint {
            text-align: center; font-size: 12px; color: #7a6550;
            margin: -8px 0 14px; letter-spacing: 0.5px;
        }
        .tip-panel {
            position: fixed; left: 12px; right: 12px; bottom: 12px;
            max-height: min(48vh, 420px); overflow-y: auto;
            background: rgba(45, 28, 15, 0.97); color: #fff8e7;
            padding: 14px 16px 12px; border-radius: 12px;
            font-size: 13px; line-height: 1.55; z-index: 200;
            box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
            opacity: 0; pointer-events: none; transform: translateY(12px);
            transition: opacity 0.2s, transform 0.2s;
        }
        .tip-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
        .tip-panel .tip-close {
            position: sticky; top: 0; float: right; margin: -4px -4px 0 8px;
            border: none; background: rgba(255,255,255,0.12); color: #fff;
            width: 28px; height: 28px; border-radius: 50%; font-size: 16px; cursor: pointer;
        }
        .tip-panel .jing-title { color: #ffd700; font-weight: bold; font-size: 14px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,215,0,0.4); }
        .tip-panel .zang-title { color: #82e0aa; font-weight: bold; font-size: 14px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed rgba(130,224,170,0.4); }
        .tip-panel .wz-title { color: #ff6b35; font-weight: bold; font-size: 14px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,107,53,0.5); }
        .tip-panel .wz-sub { color: #ffa726; font-weight: bold; margin-top: 6px; font-size: 12px; }
        .tip-panel .wz-item { padding-left: 10px; font-size: 12px; }
        .tip-panel .path-jin-title { color: #ff6b6b; font-weight: bold; font-size: 14px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed rgba(255,107,107,0.5); }
        .tip-panel .path-tui-title { color: #58d68d; font-weight: bold; font-size: 14px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px dashed rgba(88,214,141,0.5); }
        .tip-panel .path-section { color: #ffd700; font-weight: bold; margin-top: 8px; font-size: 12px; }
        .tip-panel .path-item { padding-left: 10px; font-size: 12px; line-height: 1.5; }
        .tip-panel .path-formula { color: #f5b041; font-style: italic; font-size: 12px; margin-top: 4px; }
        .is-active-hit { filter: drop-shadow(0 0 5px rgba(218,165,32,0.75)); }
        @media (max-width: 900px) {
            body {
                padding: 6px 0 max(72px, env(safe-area-inset-bottom));
                padding-left: env(safe-area-inset-left);
                padding-right: env(safe-area-inset-right);
            }
            .container { max-width: 100%; }
            .title {
                font-size: 18px; letter-spacing: 2px;
                margin: 4px 10px 2px;
            }
            .subtitle {
                font-size: 11px; margin: 0 10px 6px; letter-spacing: 0.5px;
                line-height: 1.35;
            }
            .tip-hint {
                margin: 0 10px 8px; font-size: 11px; line-height: 1.4;
            }
            .tab-nav {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 6px;
                margin: 0 8px 8px;
            }
            .tab-btn {
                padding: 9px 6px; font-size: 12px; border-radius: 8px;
                width: 100%; letter-spacing: 0;
                border-width: 1.5px;
            }
            .tab-btn.active { border-radius: 8px; box-shadow: none; }
            .main-content { flex-direction: column; gap: 8px; margin: 0; }
            .diagram-wrapper {
                min-width: 0; max-width: none; width: 100%;
                border-radius: 0; padding: 0;
                border-left: none; border-right: none;
                box-shadow: none; overflow: hidden;
                background: #fffef8;
            }
            .diagram-wrapper svg {
                min-width: 0 !important;
                width: 100% !important;
                max-width: 100%;
                height: auto !important;
                max-height: min(78dvh, 100vw);
                display: block;
                margin: 0 auto;
                touch-action: manipulation;
            }
            .legend-wrapper {
                width: auto; max-height: none; border-radius: 12px;
                padding: 12px; margin: 0 8px;
            }
            .legend-wrapper.is-collapsed {
                width: auto; max-width: none; margin: 0 8px;
            }
            .theory-box { font-size: 11px; margin: 8px; }
            .portal-bar {
                margin: 12px 8px 8px; border-radius: 10px; padding: 12px;
            }
            .portal-actions { flex-direction: column; align-items: stretch; }
            .portal-actions button,
            .portal-actions a.portal-btn {
                justify-content: center; width: 100%;
            }
            .footer { font-size: 11px; margin: 8px 10px 16px; padding: 0 4px; }
            .zang-node:hover { filter: none; }
            .path-tooltip:hover,
            .path-tooltip.path-hover { stroke-width: inherit !important; filter: none; }
            .path-hit { stroke-width: 28 !important; }
            .path-hit:hover { stroke-width: 28 !important; }
            .tip-panel {
                left: 8px; right: 8px;
                bottom: max(8px, env(safe-area-inset-bottom));
                max-height: min(42vh, 360px);
            }
            /* 窄屏：误治改到古方心法「三层」页外圈外，拓扑图隐藏「误」 */
            .wuzhi-tag { display: none !important; }
        }
        /* 极窄屏：再压顶栏，图尽量占满首屏 */
        @media (max-width: 420px) {
            .subtitle { display: none; }
            .tip-hint { display: none; }
            .title { font-size: 17px; margin-bottom: 4px; }
            .diagram-wrapper svg {
                max-height: min(82dvh, 106vw);
            }
        }
        @media (min-width: 901px) {
            .tip-panel { left: auto; right: 24px; bottom: 24px; width: 360px; max-height: 50vh; }
        }
        /* 研学 iframe 嵌入：压掉图面固定说明，留给父页帮助 */
        html.study-embed .title,
        html.study-embed .subtitle,
        html.study-embed .tip-hint,
        html.study-embed #study-clinical-banner { display: none !important; }
        html.study-embed .biao-tag { display: none !important; }
        html.study-embed .footer,
        html.study-embed .portal-bar { display: none !important; }
        /* 嵌入：拓扑图尽量放大铺满 iframe（仅 study-embed，不影响独立打开的移动页） */
        html.study-embed,
        html.study-embed body {
            height: 100% !important;
            max-height: 100% !important;
            overflow: hidden !important;
        }
        html.study-embed body {
            display: flex !important;
            flex-direction: column !important;
            padding: 0 !important;
            margin: 0 !important;
            min-height: 0 !important;
            box-sizing: border-box;
        }
        html.study-embed .container {
            max-width: none !important;
            margin: 0 !important;
            width: 100% !important;
            flex: 1 1 auto !important;
            min-height: 0 !important;
            height: 100% !important;
            display: flex !important;
            flex-direction: column !important;
            overflow: hidden !important;
            padding: 2px 4px !important;
            box-sizing: border-box;
        }
        html.study-embed .tab-nav {
            flex: 0 0 auto !important;
            margin: 0 0 4px !important;
            gap: 4px !important;
            display: grid !important;
            grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        }
        html.study-embed .tab-btn {
            padding: 5px 4px !important;
            font-size: 11px !important;
            border-radius: 6px !important;
            letter-spacing: 0 !important;
            white-space: normal !important;
            line-height: 1.25 !important;
        }
        html.study-embed .tab-content {
            display: none !important;
        }
        html.study-embed .tab-content.active {
            flex: 1 1 0 !important;
            min-height: 0 !important;
            height: 0 !important; /* 关键 flex 子项吃满剩余高度 */
            overflow: hidden !important;
            display: flex !important;
            flex-direction: column !important;
        }
        html.study-embed .tab-content.active .main-content {
            flex: 1 1 0 !important;
            min-height: 0 !important;
            height: 100% !important;
            overflow: hidden !important;
            display: block !important;
            margin: 0 !important;
            position: relative !important;
        }
        html.study-embed .diagram-wrapper {
            position: absolute !important;
            inset: 0 !important;
            width: auto !important;
            height: auto !important;
            min-width: 0 !important;
            max-width: none !important;
            overflow: hidden !important;
            padding: 0 !important;
            margin: 0 !important;
            border: 0 !important;
            border-radius: 0 !important;
            box-shadow: none !important;
            background: transparent !important;
            touch-action: none !important;
            -webkit-user-select: none !important;
            user-select: none !important;
        }
        html.study-embed .diagram-wrapper svg {
            display: block !important;
            /* 覆盖窄屏媒体查询的 width:100%!important，否则 fit 像素会被盖掉、只能看见局部 */
            width: auto !important;
            height: auto !important;
            max-width: none !important;
            max-height: none !important;
            min-width: 0 !important;
        }
        html.study-embed .theory-box,
        html.study-embed .legend-wrapper {
            display: none !important;
        }
        html.study-embed .tip-panel {
            position: fixed !important;
            left: auto !important;
            right: 8px !important;
            bottom: 8px !important;
            top: auto !important;
            width: min(340px, 36vw) !important;
            max-height: min(42vh, 380px) !important;
            flex: none !important;
            transform: none !important;
            z-index: 300;
        }
        html.study-embed .tip-panel:not(.open) {
            display: none !important;
        }
        html.study-embed .tip-panel.open {
            opacity: 1;
            pointer-events: auto;
        }
        /* 窄屏嵌入：浮层改底部通栏，避免 36vw 细条几乎看不见 */
        @media (max-width: 899px) {
            html.study-embed .tip-panel {
                left: 8px !important;
                right: 8px !important;
                width: auto !important;
                max-width: none !important;
                max-height: min(48vh, 420px) !important;
                bottom: max(8px, env(safe-area-inset-bottom)) !important;
            }
        }
        /* 门户：医生版 APK 下载（仅纯网页外链浏览；系统内打开见 html.meridian-in-system） */
        html.meridian-in-system .portal-bar { display: none !important; }
        .portal-bar {
            margin: 20px auto 8px; max-width: 720px;
            background: linear-gradient(160deg, #fff9f0 0%, #f3ebe0 100%);
            border: 1px solid #d4c4a8; border-radius: 12px;
            padding: 14px 16px 12px; box-shadow: 0 2px 10px rgba(90, 60, 20, 0.06);
        }
        .portal-bar h3 {
            margin: 0 0 6px; font-size: 15px; color: #6b4423; letter-spacing: 1px;
        }
        .portal-bar .portal-desc {
            margin: 0 0 10px; font-size: 12px; color: #7a6550; line-height: 1.55;
        }
        .portal-wechat {
            display: none; margin-bottom: 10px; padding: 10px 12px;
            background: #fff3e0; border: 1px dashed #e67e22; border-radius: 8px;
            color: #a04000; font-size: 13px; line-height: 1.55;
        }
        .portal-wechat.show { display: block; }
        .portal-wechat strong { color: #c0392b; }
        .portal-actions {
            display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
        }
        .portal-actions button, .portal-actions a.portal-btn {
            appearance: none; border: none; border-radius: 8px; cursor: pointer;
            padding: 10px 14px; font-size: 13.5px; font-weight: 600;
            text-decoration: none; display: inline-flex; align-items: center;
        }
        .portal-dl {
            background: #1e8449; color: #fff;
        }
        .portal-dl:disabled { opacity: 0.55; cursor: not-allowed; }
        .portal-test-fold {
            margin-top: 10px;
            border: 1px dashed #c9b896;
            border-radius: 8px;
            padding: 4px 10px 8px;
            background: rgba(255, 255, 255, 0.45);
            color: #7a6550;
            font-size: 12px;
        }
        .portal-test-fold[hidden] { display: none !important; }
        .portal-test-fold > summary {
            cursor: pointer;
            list-style: none;
            padding: 6px 0;
            color: #8a7560;
            font-weight: 600;
            user-select: none;
        }
        .portal-test-fold > summary::-webkit-details-marker { display: none; }
        .portal-test-fold-body {
            padding-top: 6px;
        }
        .portal-test-fold-body .portal-actions {
            margin-bottom: 8px;
        }
        .portal-alt-actions {
            display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
            margin-top: 8px;
        }
        .portal-alt-label {
            font-size: 12px; color: #7a6550;
        }
        .portal-alt-btn {
            appearance: none; cursor: pointer;
            border: 1px solid #c9b896; border-radius: 6px;
            background: #fffef8; color: #6b4423;
            padding: 6px 10px; font-size: 12px; font-weight: 600;
        }
        .portal-alt-btn:hover { background: #f3ebe0; }
        .portal-progress-wrap {
            display: none; margin-top: 10px;
        }
        .portal-progress-wrap.show { display: block; }
        .portal-progress-track {
            height: 10px; background: #e8ddd0; border-radius: 999px; overflow: hidden;
        }
        .portal-progress-fill {
            height: 100%; width: 0%; background: linear-gradient(90deg, #27ae60, #1e8449);
            border-radius: 999px; transition: width 0.15s ease;
        }
        .portal-progress-fill.indeterminate {
            width: 40% !important;
            animation: portal-indeterminate 1.2s ease-in-out infinite;
        }
        @keyframes portal-indeterminate {
            0% { transform: translateX(-120%); }
            100% { transform: translateX(280%); }
        }
        .portal-progress-meta {
            margin-top: 6px; font-size: 12px; color: #6b4423;
            display: flex; justify-content: space-between; gap: 8px;
        }
        .portal-status { margin: 8px 0 0; font-size: 12px; color: #5c4a3a; min-height: 1.2em; }
        .portal-status.err { color: #c0392b; }
        .portal-status.ok { color: #1e8449; }
    
