<template>
  <div class="process-overview-wrap">
    <div class="box-header">
      <div class="header-left"></div>
      <div class="title">流程概要</div>
				<div class="header-right">
					<div class="icon">
						<img src="@/assets/icons/box-header-icon2.png" alt="" />
					</div>
					<div class="icon">
						<img src="@/assets/icons/box-header-icon3.png" alt="" />
					</div>
				</div>
    </div>
    <div class="main">
      <div class="left">
        <div class="top">
          <div class="top-line" :style="{ width: lineWidth }">
            <div class="top-line1"></div>
          </div>
          <div class="start">
            <div class="icon">
              <img src="./assets/images/logo1.png" alt="" />
            </div>
            <div class="name">{{ "参议院" }}</div>
          </div>
          <div class="content-box" :style="senateBoxStyle">
            <div class="item-box" v-for="(item, index) in senateList" :key="item.id" style="width: 280px; flex-shrink: 0;">
              <div class="item-box-dot">
                <img src="./assets/images/top-line-dot.png" alt="" />
              </div>
              <div class="item-header">
                <div class="item-title" :title="item.actionTitle">
                  {{ item.actionTitle }} <span v-if="item.versionId">({{ item.versionId }})</span>
                </div>
                <div class="item-header-icon" @click="handleClickDetail(true, item)">
                  <img src="./assets/images/item-header-icon.png" alt="" />
                </div>
              </div>
              <div class="item-info" v-if="item.agreeVote !== null || item.disagreeVote !== null">
                {{ (item.agreeVote || 0) + "赞成：" + (item.disagreeVote || 0) + "反对" }}
              </div>
              <div class="item-main" v-if="item.fynrList && item.fynrList.length">
                <div class="item-main-item" v-for="(sub, subIndex) in item.fynrList" :key="subIndex">
                  <div class="icon"></div>
                  <div class="text">{{ sub }}</div>
                </div>
              </div>
              <div class="item-time">
                {{ item.actionDate }}
              </div>
            </div>
          </div>
        </div>

        <div class="bottom">
          <div class="bottom-line" :style="{ width: lineWidth }">
            <div class="bottom-line1"></div>
          </div>
          <div class="start">
            <div class="name">{{ "众议院" }}</div>

            <div class="icon">
              <img src="./assets/images/logo2.png" alt="" />
            </div>
          </div>
          <div class="content-box" :style="houseBoxStyle">
            <div class="item-box" v-for="(item, index) in houseList" :key="item.id" style="width: 280px; flex-shrink: 0;">
              <div class="item-time">
                {{ item.actionDate }}
              </div>
              <div class="item-box-dot">
                <img src="./assets/images/bottom-line-dot.png" alt="" />
              </div>
              <div class="item-header">
                <div class="item-title" :title="item.actionTitle">
                  {{ item.actionTitle }} <span v-if="item.versionId">({{ item.versionId }})</span>
                </div>
                <div class="item-header-icon" @click="handleClickDetail(true, item)">
                  <img src="./assets/images/item-header-icon.png" alt="" />
                </div>
              </div>
              <div class="item-info" v-if="item.agreeVote !== null || item.disagreeVote !== null">
                {{ (item.agreeVote || 0) + "赞成：" + (item.disagreeVote || 0) + "反对" }}
              </div>
              <div class="item-main" v-if="item.fynrList && item.fynrList.length">
                <div class="item-main-item" v-for="(sub, subIndex) in item.fynrList" :key="subIndex">
                  <div class="icon"></div>
                  <div class="text">{{ sub }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="right" :style="{ left: rightPos }">
          <div class="junction-dot">
            <div class="inner-dot"></div>
          </div>
          <div class="right-line"></div>
        </div>
      </div>
    </div>
    <!-- <div class="footer">
      <div class="footer-left">
        <img src="./assets/icons/right-icon1.png" alt="" />
      </div>
      <div class="footer-center">
        立法过程始于2025年2月共和党启动预算框架谈判，5月22日众议院以215:214的1票优势通过初始版本；随后参议院历经16小时全文朗读和马拉松式辩论，于7月1日以51:50的票数通过修订版（副总统万斯投关键票）；因参议院版本大改（如永久化减税、提高债限至5万亿美元），法案重返众议院审议，经程序性投票（219:213）和最终表决（218:214），于7月3日深夜通过；特朗普在7月4日独立日签署生效，全程凸显两党对立、党内分歧及程序博弈。
      </div>
      <div class="footer-right">
        <img src="./assets/icons/arrow-right.png" alt="" />
      </div>
    </div> -->
    <div class="dialog-wrapper" v-if="isShowDetailDialog" ref="dialogRef">
      <div class="dialog-box1" @mousedown="handleMouseDown">
        <div class="icon">
          <img v-if="currentDetailItem.orgName === '参议院'" src="./assets/images/logo1.png" alt="" />
          <img v-else src="./assets/images/logo2.png" alt="" />
        </div>
        <div class="title">
          <div class="date">{{ currentDetailItem.actionDate }}</div>
          <div class="text">
            {{ currentDetailItem.actionTitle }}
          </div>
        </div>
        <div class="close" @click="handleClickDetail(false)">
          <img src="./assets/images/close.png" alt="" />
        </div>
      </div>
      <div class="dialog-box2" v-if="currentDetailItem.agreeVote !== null || currentDetailItem.disagreeVote !== null">
        <div class="vote-bar">
          <div class="agree-bar" :style="{ flex: currentDetailItem.agreeVote || 1 }"></div>
          <div class="disagree-bar" :style="{ flex: currentDetailItem.disagreeVote || 1 }"></div>
        </div>
        <div class="vote-text">
          <div class="agree-text">{{ (currentDetailItem.agreeVote || 0) + "赞成" }}</div>
          <div class="disagree-text">{{ (currentDetailItem.disagreeVote || 0) + "反对" }}</div>
        </div>
      </div>
      <!-- <div class="dialog-box3">
        <div class="box3-left">
          <img src="./assets/icons/right-icon1.png" alt="" />
        </div>
        <div class="box3-center">
          {{ "法案在众议院惊险通过，凸显两党分歧严重。" }}
        </div>
        <div class="box3-right">
          <img src="./assets/icons/arrow-right.png" alt="" />
        </div>
      </div> -->
      <template v-if="currentDetailItem.fynrList && currentDetailItem.fynrList.length">
        <div class="dialog-box4">
          <div class="box4-left">
            <div class="icon">
              <img src="./assets/images/dialog-box4-icon.png" alt="" />
            </div>
            <div class="text">{{ "变更条款" }}</div>
          </div>
          <div class="box4-right" @click="handleSwitchCompareDialog(true)">
            {{ "条款对比 >" }}
          </div>
        </div>
        <div class="dialog-box5">
          <div class="box5-item" v-for="(sub, subIndex) in currentDetailItem.fynrList" :key="subIndex">
            <div class="icon"></div>
            <div class="text">{{ sub }}</div>
          </div>
        </div>
      </template>
      <!-- <div class="dialog-box6">
        <div class="icon">
          <img src="./assets/images/dialog-box6-icon.png" alt="" />
        </div>
        <div class="text">{{ "支持意见领袖" }}</div>
      </div>
      <div class="dialog-box7">
        <div class="box7-item">
          <div class="icon">
            <img src="./assets/images/dialog-box7-icon1.png" alt="" />
            <div class="inner-icon">
              <img src="./assets/images/user-inner-icon.png" alt="" />
            </div>
          </div>
          <div class="right">
            <div class="name">{{ "迈克·约翰逊" }}</div>
            <div class="content">
              {{
                "协调党内分歧：修改条款争取支持（如调整SALT扣除上限），推动程序性投票"
              }}
            </div>
          </div>
        </div>
        <div class="box7-item">
          <div class="icon">
            <img src="./assets/images/dialog-box7-icon2.png" alt="" />
            <div class="inner-icon">
              <img src="./assets/images/user-inner-icon.png" alt="" />
            </div>
          </div>
          <div class="right">
            <div class="name">{{ "詹姆斯·戴维·万斯" }}</div>
            <div class="content">
              {{ "框架谈判主导：与约翰逊合作确立调和程序方向" }}
            </div>
          </div>
        </div>
      </div> -->
    </div>
    <div class="dialog-wrapper1" v-if="isShowCompareDialog">
      <div class="dialog-header">
        <div class="header-left">
          <div class="icon">
            <img src="./assets/images/dialog-box4-icon.png" alt="" />
          </div>
          <div class="title">{{ "法案版本对比" }}</div>
        </div>
        <div class="header-right" @click="handleSwitchCompareDialog(false)">
          <img src="./assets/images/close.png" alt="" />
        </div>
      </div>
      <div class="dialog-info">
        <div class="info-box1">
          <span>原版本：</span>
          <el-select
            v-model="preVersion"
            placeholder="请选择原版本"
            style="width: 300px"
          >
            <el-option
              v-for="item in preVersionList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </div>
        <div class="info-box2">
          <span>现版本：</span>
          <el-select
            v-model="curVersion"
            placeholder="请选择现版本"
            style="width: 300px"
          >
            <el-option
              v-for="item in curVersionList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </div>
        <div class="info-box3">
          <div
            class="icon1"
            v-if="!isOnlyShowChinesePolicy"
            @click="handleSwitchPolicy(true)"
          ></div>
          <div class="icon2" v-else @click="handleSwitchPolicy(false)">
            <img src="./assets/images/info-box3-selected.png" alt="" />
          </div>
          <div class="text">{{ "只看涉华条款" }}</div>
        </div>
        <div class="info-box4">
          <el-input
            v-model="input"
            style="width: 160px"
            placeholder="搜索条款"
          />
          <div class="icon">
            <img src="./assets/images/search.png" alt="" />
          </div>
        </div>
      </div>
      <div class="dialog-main">
        <div class="dialog-main-header">
          <div class="dialog-main-header-left">
            {{ " H.R.1（众议院）" }}
          </div>
          <div class="dialog-main-header-right">
            {{ "H.R.1（参议院）" }}
          </div>
        </div>
        <div class="dialog-main-item">
          <div class="dialog-main-left">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(a)." }}</div>
              <div class="title-right">
                {{
                  "废止1930年《关税法》第321(a)(2)(C) 条规定的最低免税门槛。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Repeal the de minimis threshold under section 321(a)(2)(C) of the
              Tariff Act of 1930.
            </div>
          </div>
          <div class="dialog-main-right">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(b)." }}</div>
              <div class="title-right">
                {{
                  "自2027年1月1日起，对依据《1930年关税法》第321(a)(2)(C)条申报入境的货物，征收30%从价税或每件25美元关税（以较高者为准）。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Effective January 1, 2027, impose a duty of 30% ad valorem or $25
              per package (whichever is higher) on articles entered under
              section 321(a)(2)(C) of the Tariff Act of 1930.
            </div>
          </div>
        </div>
        <div class="dialog-main-item">
          <div class="dialog-main-left">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(a)." }}</div>
              <div class="title-right">
                {{
                  "废止1930年《关税法》第321(a)(2)(C) 条规定的最低免税门槛。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Repeal the de minimis threshold under section 321(a)(2)(C) of the
              Tariff Act of 1930.
            </div>
          </div>
          <div class="dialog-main-right">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(b)." }}</div>
              <div class="title-right">
                {{
                  "自2027年1月1日起，对依据《1930年关税法》第321(a)(2)(C)条申报入境的货物，征收30%从价税或每件25美元关税（以较高者为准）。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Effective January 1, 2027, impose a duty of 30% ad valorem or $25
              per package (whichever is higher) on articles entered under
              section 321(a)(2)(C) of the Tariff Act of 1930.
            </div>
          </div>
        </div>
        <div class="dialog-main-item">
          <div class="dialog-main-left">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(a)." }}</div>
              <div class="title-right">
                {{
                  "废止1930年《关税法》第321(a)(2)(C) 条规定的最低免税门槛。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Repeal the de minimis threshold under section 321(a)(2)(C) of the
              Tariff Act of 1930.
            </div>
          </div>
          <div class="dialog-main-right">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(b)." }}</div>
              <div class="title-right">
                {{
                  "自2027年1月1日起，对依据《1930年关税法》第321(a)(2)(C)条申报入境的货物，征收30%从价税或每件25美元关税（以较高者为准）。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Effective January 1, 2027, impose a duty of 30% ad valorem or $25
              per package (whichever is higher) on articles entered under
              section 321(a)(2)(C) of the Tariff Act of 1930.
            </div>
          </div>
        </div>
        <div class="dialog-main-item">
          <div class="dialog-main-left">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(a)." }}</div>
              <div class="title-right">
                {{
                  "废止1930年《关税法》第321(a)(2)(C) 条规定的最低免税门槛。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Repeal the de minimis threshold under section 321(a)(2)(C) of the
              Tariff Act of 1930.
            </div>
          </div>
          <div class="dialog-main-right">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(b)." }}</div>
              <div class="title-right">
                {{
                  "自2027年1月1日起，对依据《1930年关税法》第321(a)(2)(C)条申报入境的货物，征收30%从价税或每件25美元关税（以较高者为准）。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Effective January 1, 2027, impose a duty of 30% ad valorem or $25
              per package (whichever is higher) on articles entered under
              section 321(a)(2)(C) of the Tariff Act of 1930.
            </div>
          </div>
        </div>
        <div class="dialog-main-item">
          <div class="dialog-main-left">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(a)." }}</div>
              <div class="title-right">
                {{
                  "废止1930年《关税法》第321(a)(2)(C) 条规定的最低免税门槛。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Repeal the de minimis threshold under section 321(a)(2)(C) of the
              Tariff Act of 1930.
            </div>
          </div>
          <div class="dialog-main-right">
            <div class="dialog-main-item-title">
              <div class="title-left">{{ "§1102(b)." }}</div>
              <div class="title-right">
                {{
                  "自2027年1月1日起，对依据《1930年关税法》第321(a)(2)(C)条申报入境的货物，征收30%从价税或每件25美元关税（以较高者为准）。"
                }}
              </div>
            </div>
            <div class="dialog-main-item-content">
              Effective January 1, 2027, impose a duty of 30% ad valorem or $25
              per package (whichever is higher) on articles entered under
              section 321(a)(2)(C) of the Tariff Act of 1930.
            </div>
          </div>
        </div>
      </div>
      <div class="dialog-footer">
        <el-pagination background layout="prev, pager, next" :total="1000" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, computed } from "vue";
import { getBillDyqkSummary } from "@/api/bill";


// 获取法案流程
const actionList = ref([]);
const getBillDyqkSummaryList = async () => {
  try {
    const billId = window.sessionStorage.getItem("billId");
    if (!billId) return; // 防止 id 为空
    const params = {
      id: billId
    };
    const res = await getBillDyqkSummary(params);
    if (res && res.code === 200) {
      console.log("法案流程概要:", res);
      // 确保赋值的是数组，如果 data 为 null 则给空数组
      actionList.value = Array.isArray(res.data) ? res.data : [];
    } else {
      actionList.value = [];
    }
  } catch (error) {
    console.log(error);
    actionList.value = []; // 出错时也重置为空数组
  }
};

// 总统签署节点
const presidentAction = computed(() => {
  return actionList.value.find(item => item.actionTitle && item.actionTitle.includes("呈递给总统")) || null;
});

// 参议院列表
const senateList = computed(() => {
  return actionList.value
    .filter(item => item.orgName === "参议院" && (!presidentAction.value || item.id !== presidentAction.value.id))
    .sort((a, b) => new Date(a.actionDate) - new Date(b.actionDate));
});

// 众议院列表
const houseList = computed(() => {
  return actionList.value
    .filter(item => item.orgName === "众议院" && (!presidentAction.value || item.id !== presidentAction.value.id))
    .sort((a, b) => new Date(a.actionDate) - new Date(b.actionDate));
});

// 计算最大线条宽度数值
const maxLineWidth = computed(() => {
  const senateWidth = 254 + senateList.value.length * 280;
  const houseWidth = 150 + houseList.value.length * 280;
  return Math.max(1100, senateWidth, houseWidth);
});

// 绑定给线条的样式
const lineWidth = computed(() => {
  return maxLineWidth.value + 'px';
});

// 参议院容器宽度：线条总长 + 线条左偏移(110) - 容器左偏移(254)
const senateBoxStyle = computed(() => {
  return {
    width: (maxLineWidth.value + 110 - 254) + 'px',
    justifyContent: 'space-between'
  };
});

// 众议院容器宽度：线条总长 + 线条左偏移(110) - 容器左偏移(150)
const houseBoxStyle = computed(() => {
  return {
    width: (maxLineWidth.value + 110 - 150) + 'px',
    justifyContent: 'space-between'
  };
});

const rightPos = computed(() => {
   // 右侧节点位置 = 线条宽度 + 斜线水平投影长度(约90px)
   return (maxLineWidth.value + 90) + 'px'; 
});

const isShowCompareDialog = ref(false)
const handleSwitchCompareDialog = (isShow) => {
  isShowCompareDialog.value = isShow
}


const isOnlyShowChinesePolicy = ref(false);

const handleSwitchPolicy = (isShow) => {
  isOnlyShowChinesePolicy.value = isShow;
};

const preVersion = ref("委员会初始版本（2025年5月20日）");

const preVersionList = ref([
  {
    label: "委员会初始版本（2025年5月20日）",
    value: "委员会初始版本（2025年5月20日）",
  },
]);

const curVersion = ref("公法（2025年7月4日）");
const curVersionList = ref([
  {
    label: "公法（2025年7月4日）",
    value: "公法（2025年7月4日）",
  },
]);

const isShowDetailDialog = ref(false);
const currentDetailItem = ref({});

const handleClickDetail = (isShow, item = {}) => {
  isShowDetailDialog.value = isShow;
  if (isShow) {
    currentDetailItem.value = item;
  }
};

const dialogRef = ref(null);

const handleMouseDown = (e) => {
  const dialog = dialogRef.value;
  if (!dialog) return;

  const startX = e.clientX;
  const startY = e.clientY;
  
  // 获取当前的 offsetLeft 和 offsetTop
  // 注意：如果是第一次拖动，且原本是 right 定位的，offsetLeft 也是可以直接获取到的
  const initialLeft = dialog.offsetLeft;
  const initialTop = dialog.offsetTop;

  const move = (moveEvent) => {
    const deltaX = moveEvent.clientX - startX;
    const deltaY = moveEvent.clientY - startY;

    // 清除 right 定位，改用 left
    dialog.style.right = 'auto';
    dialog.style.left = `${initialLeft + deltaX}px`;
    dialog.style.top = `${initialTop + deltaY}px`;
  };

  const stop = () => {
    document.removeEventListener('mousemove', move);
    document.removeEventListener('mouseup', stop);
  };

  document.addEventListener('mousemove', move);
  document.addEventListener('mouseup', stop);
};

// 挂载阶段调用
onMounted(() => {
  getBillDyqkSummaryList();
});
</script>

<style lang="scss" scoped>
.process-overview-wrap {
  width: 1744px;
  height: 848px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 1);
  margin-top: 16px;
  position: relative;
  .box-header {
    width: 100%;
    height: 56px;
    display: flex;
    position: relative;
    .header-left {
      margin-top: 18px;
      width: 8px;
      height: 20px;
      border-radius: 0 4px 4px 0;
      background: var(--color-main-active);
    }
    .title {
      margin-left: 14px;
      margin-top: 14px;
      height: 26px;
      line-height: 26px;
      color: var(--color-main-active);
      font-family: Microsoft YaHei;
      font-size: 20px;
      font-weight: 700;
    }
		.header-right {
			position: absolute;
			top: 14px;
			right: 12px;
			display: flex;
			justify-content: flex-end;
			gap: 4px;
			.icon {
				width: 28px;
				height: 28px;
				img {
					width: 100%;
					height: 100%;
				}
			}
		}
  }
  .main {
    margin-left: 59px;
    height: 680px;
    padding: 3px 10px;
    overflow: hidden;
    .left {
      height: 680px;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: center;

      .top {
        height: 260px;
        display: flex;
        position: relative;
        .top-line {
          position: absolute;
          left: 110px;
          top: 242px;
          height: 8px;
          width: 1100px;
          background: url("./assets/images/top-line-icon.png");
          .top-line1 {
            position: absolute;
            left: 100%;
            top: 0;
            height: 8px;
            width: 127px;
            background: url("./assets/images/top-line-icon.png");
            transform: rotate(45deg);
            transform-origin: 0 0;
          }
        }
        .start {
          width: 120px;
          height: 260px;
          display: flex;
          flex-direction: column;
          justify-content: flex-end;
          align-items: center;
          .icon {
            width: 120px;
            height: 120px;
            img {
              width: 100%;
              height: 100%;
            }
          }
          .name {
            margin-top: 30px;
            width: 100px;
            height: 30px;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 8;
            padding: 1px 8px;
            box-sizing: border-box;
            border: 1px solid rgba(186, 224, 255, 1);
            border-radius: 4px;
            background: rgba(230, 244, 255, 1);
            color: rgba(22, 119, 255, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 700;
            line-height: 20px;
          }
        }
        .content-box {
          display: flex;
          margin-left: 134px;
          margin-bottom: 19px;
          .item-box {
            padding: 2px 15px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            position: relative;
            .item-time {
              position: absolute;
              bottom: -50px;
              left: 30px;
              height: 30px;
              color: rgba(20, 89, 187, 1);
              font-family: Microsoft YaHei;
              font-size: 16px;
              font-weight: 700;
              line-height: 30px;
            }
            .item-box-dot {
              position: absolute;
              z-index: 9999;
              left: 10px;
              bottom: -7px;
              width: 12px;
              height: 12px;
              img {
                width: 100%;
                height: 100%;
              }
            }
            .item-header {
              display: flex;
              align-items: center;
              height: 30px;
              border-left: 1px solid rgb(20, 89, 187);
              padding: 0 10px;
              .item-title {
                line-height: 26px;
                color: rgb(59, 65, 75);
                font-family: Microsoft YaHei;
                font-size: 20px;
                font-weight: 700;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                span {
                  color: rgba(132, 136, 142, 1);
                  font-family: Microsoft YaHei;
                  font-size: 14px;
                  font-weight: 400;
                  line-height: 22px;
                }
              }
              .item-header-icon {
                margin-left: 5px;
                width: 16px;
                height: 16px;
                cursor: pointer;
                flex-shrink: 0;
                img {
                  width: 100%;
                  height: 100%;
                }
              }
            }
            .item-info {
              border-left: 1px solid rgb(20, 89, 187);
              padding: 0 10px;
              color: rgb(59, 65, 75);
              font-family: Microsoft YaHei;
              font-size: 16px;
              font-weight: 400;
              line-height: 24px;
            }
            .item-main {
              border-left: 1px solid rgb(20, 89, 187);
              padding: 5px 10px;
              .item-main-item {
                display: flex;
                align-items: baseline;
                width: 269px;
                .icon {
                  margin: 9px 12px;
                  width: 6px;
                  height: 6px;
                  border-radius: 3px;
                  background: #84888e;
                }
                .text {
                  width: 240px;
                  color: rgb(59, 65, 75);
                  font-family: Microsoft YaHei;
                  font-size: 16px;
                  font-weight: 400;
                  line-height: 24px;
                }
              }
            }
            .item-footer {
              border-left: 1px solid rgb(20, 89, 187);
              display: flex;
              padding: 8px 15px;
              justify-content: space-between;
              .item-footer-box {
                display: flex;
                margin-left: 12px;
                .icon {
                  position: relative;
                  width: 24px;
                  height: 24px;
                  img {
                    width: 100%;
                    height: 100%;
                  }
                  .inner-icon {
                    position: absolute;
                    right: -5px;
                    top: 0;
                    width: 12px;
                    height: 12px;
                    border-radius: 6px;
                    background: rgba(255, 255, 255, 0.8);
                    display: flex;
                    box-sizing: border-box;
                    padding: 1px;
                    img {
                      width: 10px;
                      height: 10px;
                    }
                  }
                }
                .text {
                  margin-left: 9px;
                  height: 24px;
                  color: rgba(95, 101, 108, 1);
                  font-family: Microsoft YaHei;
                  font-size: 14px;
                  font-weight: 400;
                  line-height: 24px;
                }
              }
            }
          }
        }
      }

      .bottom {
        margin-top: 150px;
        // height: 300px;
        display: flex;
        position: relative;

        .bottom-line {
          position: absolute;
          left: 110px;
          top: 11px;
          height: 8px;
          width: 1100px;
          background: url("./assets/images/bottom-line-icon.png");
          .bottom-line1 {
            position: absolute;
            left: 100%;
            top: 0;
            height: 8px;
            width: 127px;
            background: url("./assets/images/bottom-line-icon.png");
            transform: rotate(-45deg);
            transform-origin: 0 100%;
          }
        }
        .start {
          width: 120px;
          // height: 260px;
          display: flex;
          flex-direction: column;
          justify-content: flex-start;
          align-items: center;
          .icon {
            margin-top: 30px;
            width: 120px;
            height: 120px;
            img {
              width: 100%;
              height: 100%;
            }
          }
          .name {
            width: 100px;
            height: 30px;
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 8;
            padding: 1px 8px;
            box-sizing: border-box;
            border-radius: 4px;
            border: 1px solid rgba(255, 229, 143, 1);
            background: rgba(255, 251, 230, 1);
            color: rgba(250, 173, 20, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 700;
            line-height: 20px;
          }
        }
        .content-box {
          display: flex;
          margin-left: 30px;
          .item-box {
            padding: 20px 15px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            position: relative;
            .item-time {
              position: absolute;
              top: -30px;
              left: 30px;
              height: 30px;
              color: rgba(255, 172, 77, 1);
              font-family: Microsoft YaHei;
              font-size: 16px;
              font-weight: 700;
              line-height: 30px;
            }
            .item-box-dot {
              position: absolute;
              z-index: 9999;
              left: 10px;
              top: 7px;
              width: 12px;
              height: 12px;
              img {
                width: 100%;
                height: 100%;
              }
            }
            .item-header {
              display: flex;
              align-items: center;
              height: 30px;
              border-left: 1px solid rgba(255, 172, 77, 1);
              padding: 5px 10px;
              .item-title {
                line-height: 26px;
                color: rgb(59, 65, 75);
                font-family: Microsoft YaHei;
                font-size: 20px;
                font-weight: 700;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                span {
                  color: rgba(132, 136, 142, 1);
                  font-family: Microsoft YaHei;
                  font-size: 14px;
                  font-weight: 400;
                  line-height: 22px;
                }
              }
              .item-header-icon {
                margin-left: 5px;
                width: 16px;
                height: 16px;
                cursor: pointer;
                flex-shrink: 0;
                img {
                  width: 100%;
                  height: 100%;
                }
              }
            }
            .item-info {
              border-left: 1px solid rgba(255, 172, 77, 1);
              padding: 0 10px;
              color: rgb(59, 65, 75);
              font-family: Microsoft YaHei;
              font-size: 16px;
              font-weight: 400;
              line-height: 24px;
            }
            .item-main {
              border-left: 1px solid rgba(255, 172, 77, 1);
              padding: 5px 10px;
              .item-main-item {
                display: flex;
                align-items: baseline;
                width: 269px;
                .icon {
                  margin: 9px 12px;
                  width: 6px;
                  height: 6px;
                  border-radius: 3px;
                  background: #84888e;
                }
                .text {
                  width: 240px;
                  color: rgb(59, 65, 75);
                  font-family: Microsoft YaHei;
                  font-size: 16px;
                  font-weight: 400;
                  line-height: 24px;
                }
              }
            }
            .item-footer {
              border-left: 1px solid rgba(255, 172, 77, 1);
              display: flex;
              padding: 8px 15px;
              justify-content: space-between;
              .item-footer-box {
                display: flex;
                margin-left: 12px;
                .icon {
                  position: relative;
                  width: 24px;
                  height: 24px;
                  img {
                    width: 100%;
                    height: 100%;
                  }
                  .inner-icon {
                    position: absolute;
                    right: -5px;
                    top: 0;
                    width: 12px;
                    height: 12px;
                    border-radius: 6px;
                    background: rgba(255, 255, 255, 0.8);
                    display: flex;
                    box-sizing: border-box;
                    padding: 1px;
                    img {
                      width: 10px;
                      height: 10px;
                    }
                  }
                }
                .text {
                  margin-left: 9px;
                  height: 24px;
                  color: rgba(95, 101, 108, 1);
                  font-family: Microsoft YaHei;
                  font-size: 14px;
                  font-weight: 400;
                  line-height: 24px;
                }
              }
            }
          }
        }
      }

      .right {
        position: absolute;
        top: 370px; 
        margin-left: 90px; 
        display: flex;
        align-items: center;
        .junction-dot {
          width: 24px;
          height: 24px;
          border-radius: 50%;
          background: #5f656c;
          display: flex;
          justify-content: center;
          align-items: center;
          z-index: 10;
          margin-right: -4px; // 稍微重叠
          .inner-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #fff;
          }
        }
        .right-line {
          width: 70px;
          height: 8px;
          background: url("./assets/images/right-line-icon.png");
        }
      }
    }
  }
  .footer {
    width: 1710px;
    height: 76px;
    display: flex;
    border: 1px solid rgba(231, 241, 255, 1);
    border-radius: 4px;
    background: rgba(246, 251, 255, 1);
    margin-left: 13px;
    .footer-left {
      margin-top: 28px;
      margin-left: 12px;
      width: 19px;
      height: 20px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .footer-center {
      margin-left: 13px;
      margin-top: 8px;
      width: 1617px;
      height: 60px;
      color: var(--color-main-active);
      font-family: Microsoft YaHei;
      font-size: 14px;
      font-weight: 400;
      line-height: 24px;
    }
    .footer-right {
      margin-left: 13px;
      margin-top: 28px;
      width: 24px;
      height: 24px;
      background: rgba(231, 241, 255, 1);
      border-radius: 12px;
      background: #e7f1ff;
      box-sizing: border-box;
      padding: 3px;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .dialog-wrapper {
    position: absolute;
    top: 56px;
    right: 17px;
    width: 480px;
    // height: 692px; // 去掉固定高度，由内容撑开
    padding-bottom: 20px;
    box-sizing: border-box;
    border: 1px solid rgba(230, 231, 232, 1);
    border-radius: 4px;
    background: rgba(255, 255, 255, 1);
    z-index: 10000; // 提高层级，超过节点的 9999
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15); // 加个阴影更好看
    .dialog-box1 {
      display: flex;
      min-height: 90px; // 改为最小高度，允许撑开
      height: auto; // 高度自动
      padding-bottom: 15px; // 底部留白
      position: relative;
      border-bottom: 1px solid rgba(240, 242, 244, 1);
      cursor: move; // 鼠标变为移动手势
      .icon {
        width: 48px;
        height: 48px;
        margin-left: 18px;
        margin-top: 20px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .title {
        margin-top: 20px;
        margin-left: 16px;
        width: 350px;
        .date {
          height: 22px;
          color: rgba(59, 65, 75, 1);
          font-family: Microsoft YaHei;
          font-size: 16px;
          font-weight: 700;
          line-height: 22px;
        }
        .text {
          margin-top: 4px;
          color: rgba(59, 65, 75, 1);
          font-family: Microsoft YaHei;
          font-size: 16px;
          font-weight: 700;
          line-height: 22px;
          span {
            color: rgba(95, 101, 108, 1);
            font-family: Microsoft YaHei;
            font-size: 14px;
            font-weight: 400;
          }
        }
      }
      .close {
        position: absolute;
        top: 14px;
        right: 15px;
        width: 16px;
        height: 16px;
        cursor: pointer;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
    .dialog-box2 {
      height: 59px;
      padding: 0 23px;
      // border-bottom: 1px solid rgba(240, 242, 244, 1);
      .vote-bar {
        display: flex;
        height: 4px;
        width: 100%;
        margin-top: 20px;
        border-radius: 2px;
        overflow: hidden;
        .agree-bar {
          background: #52C41A;
          margin-right: 2px;
        }
        .disagree-bar {
          background: #F5222D;
        }
      }
      .vote-text {
        display: flex;
        justify-content: space-between;
        margin-top: 8px;
        .agree-text {
          color: #52C41A;
          font-size: 14px;
        }
        .disagree-text {
          color: #F5222D;
          font-size: 14px;
        }
      }
    }
    .dialog-box3 {
      width: 438px;
      height: 46px;
      display: flex;
      justify-content: center;
      align-items: center;
      box-sizing: border-box;
      border: 1px solid rgba(231, 241, 255, 1);
      border-radius: 4px;
      background: rgba(246, 251, 255, 1);
      margin-left: 23px;
      margin-top: 15px;
      .box3-left {
        width: 19px;
        height: 20px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .box3-center {
        width: 345px;
        margin-left: 25px;
        color: var(--color-main-active);
        font-family: Microsoft YaHei;
        font-size: 16px;
        font-weight: 400;
        line-height: 46px;
      }
      .box3-right {
        width: 24px;
        height: 24px;
        background: rgba(231, 241, 255, 1);
        border-radius: 12px;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
    .dialog-box4 {
      width: 438px;
      margin-left: 23px;
      margin-top: 20px;
      display: flex;
      justify-content: space-between;
      height: 30px;
      .box4-left {
        display: flex;
        .icon {
          margin-top: 6px;
          width: 18px;
          height: 18px;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .text {
          width: 64px;
          height: 30px;
          margin-left: 6px;
          color: rgba(95, 101, 108, 1);
          font-family: Microsoft YaHei;
          font-size: 16px;
          font-weight: 700;
          line-height: 30px;
        }
      }
      .box4-right {
        height: 30px;
        line-height: 30px;
        color: rgba(20, 89, 187, 1);
        font-family: Microsoft YaHei;
        font-size: 14px;
        font-weight: 400;
        cursor: pointer;
      }
    }
    .dialog-box5 {
      margin-top: 3px;
      margin-left: 23px;
      width: 438px;
      .box5-item {
        height: 30px;
        color: rgba(132, 136, 142, 1);
        font-family: Microsoft YaHei;
        font-size: 16px;
        font-weight: 400;
        line-height: 30px;
        display: flex;
        .icon {
          margin-left: 15px;
          width: 6px;
          height: 6px;
          margin-top: 12px;
          border-radius: 3px;
          background: #84888e;
        }
        .text {
          margin-left: 10px;
        }
      }
    }
    .dialog-box6 {
      margin-top: 30px;
      margin-left: 20px;
      display: flex;
      height: 30px;
      .icon {
        margin-top: 6px;
        width: 18px;
        height: 18px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .text {
        color: rgba(95, 101, 108, 1);
        font-family: Microsoft YaHei;
        font-size: 16px;
        font-weight: 700;
        line-height: 30px;
        margin-left: 6px;
      }
    }
    .dialog-box7 {
      margin-left: 21px;
      margin-top: 3px;
      height: 190px;
      width: 440px;
      overflow: hidden;
      .box7-item {
        display: flex;
        .icon {
          width: 42px;
          height: 42px;
          position: relative;
          img {
            width: 42px;
            height: 42px;
          }
          .inner-icon {
            position: absolute;
            top: 0;
            right: -8px;
            width: 24px;
            height: 24px;
            box-sizing: border-box;
            padding: 2px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.8);
            img {
              width: 20px;
              height: 20px;
            }
          }
        }
        .right {
          margin-left: 30px;
          .name {
            height: 30px;
            color: rgba(95, 101, 108, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 700;
            line-height: 30px;
          }
          .content {
            color: rgba(132, 136, 142, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 400;
            line-height: 30px;
          }
        }
      }
    }
  }
  .dialog-wrapper1 {
    position: absolute;
    z-index: 9999;
    top: -120px;
    width: 1600px;
    height: 1000px;
    box-sizing: border-box;
    border: 1px solid rgba(230, 231, 232, 1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 1);
    .dialog-header {
      height: 48px;
      box-sizing: border-box;
      border-bottom: 1px solid rgba(240, 242, 244, 1);
      display: flex;
      justify-content: space-between;
      .header-left {
        display: flex;
        .icon {
          width: 20px;
          height: 20px;
          margin-left: 14px;
          margin-top: 14px;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .title {
          margin-left: 11px;
          margin-top: 16px;
          height: 14px;
          color: rgba(95, 101, 108, 1);
          font-family: Microsoft YaHei;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
        }
      }
      .header-right {
        width: 16px;
        height: 16px;
        margin-top: 16px;
        margin-right: 16px;
        cursor: pointer;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
    .dialog-info {
      display: flex;
      width: 1552px;
      height: 64px;
      margin: 12px auto;
      .info-box1 {
        span {
          color: rgba(95, 101, 108, 1);
          font-family: Microsoft YaHei;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
        }
      }
      .info-box2 {
        margin-left: 24px;
        span {
          color: rgba(95, 101, 108, 1);
          font-family: Microsoft YaHei;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
        }
      }
      .info-box3 {
        display: flex;
        .icon1 {
          margin-left: 25px;
          margin-top: 8px;
          width: 14px;
          height: 14px;
          border-radius: 4px;
          border: 1px solid #333;
        }
        .icon2 {
          margin-left: 25px;
          margin-top: 8px;
          width: 18px;
          height: 18px;
          border-radius: 4px;
          img {
            width: 18px;
            height: 18px;
          }
        }
        .text {
          margin-left: 9px;
          margin-top: 9px;
          color: rgba(95, 101, 108, 1);
          font-family: Microsoft YaHei;
          font-size: 14px;
          font-weight: 400;
          line-height: 14px;
        }
      }
      .info-box4 {
        margin-left: 500px;
        margin-top: 5px;
        position: relative;
        .icon {
          position: absolute;
          right: 5px;
          top: 5px;
          width: 16px;
          height: 16px;
          cursor: pointer;
          img {
            width: 100%;
            height: 100%;
          }
        }
      }
    }
    .dialog-main {
      height: 750px;
      width: 1505px;
      margin: 0 auto;
      border-bottom: 1px solid #e9e9e9;
      .dialog-main-header {
        width: 1505px;
        height: 54px;
        display: flex;
        background: rgba(59, 65, 75, 1);
        color: #fff;
        font-family: Microsoft YaHei;
        font-size: 16px;
        font-weight: 700;
        line-height: 54px;
        .dialog-main-header-left {
          flex: 1;
          padding-left: 16px;
        }
        .dialog-main-header-right {
          flex: 1;
        }
      }
      .dialog-main-item {
        width: 1505px;
        display: flex;
        padding: 16px;
        height: 139px;
        box-sizing: border-box;
        .dialog-main-left {
          flex: 1;
          .dialog-main-item-title {
            color: rgba(59, 65, 75, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 700;
            line-height: 30px;
            display: flex;
            .title-left {
              width: 96px;
            }

            .title-right {
              flex: 1;
            }
          }
          .dialog-main-item-content {
            margin-left: 96px;
            color: rgba(132, 136, 142, 1);
            font-family: Microsoft YaHei;
            font-size: 14px;
            font-weight: 400;
            line-height: 18px;
          }
        }
        .dialog-main-right {
          flex: 1;
          .dialog-main-item-title {
            color: rgba(59, 65, 75, 1);
            font-family: Microsoft YaHei;
            font-size: 16px;
            font-weight: 700;
            line-height: 30px;
            display: flex;
            .title-left {
              width: 96px;
            }

            .title-right {
              flex: 1;
            }
          }
          .dialog-main-item-content {
            margin-left: 96px;
            color: rgba(132, 136, 142, 1);
            font-family: Microsoft YaHei;
            font-size: 14px;
            font-weight: 400;
            line-height: 18px;
          }
        }
      }
      .dialog-main-item:nth-child(2n-1) {
        border-radius: 4px;
        background: rgba(248, 249, 250, 1);
      }
    }
    .dialog-footer {
      height: 100px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}
</style>
