/* 法規查詢頁專用樣式 */
/* 麵包屑與頁面標題沿用案例頁的字級斷點。 */
@media (max-width: 1023px) {
  .inner-page-background nav[aria-label="麵包屑"] { font-size: 14px; }
  .inner-page-background .section-title { font-size: 24px; }
}

@media (min-width: 1024px) and (max-width: 1535px) {
  .inner-page-background nav[aria-label="麵包屑"] { font-size: 14.4px; }
  .inner-page-background .section-title { font-size: 28.8px; }
}

.law-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  /* 桌面版查詢框與表格距白色區塊左右邊界 85px。 */
  padding: 36px 85px 80px;
  border-radius: 50px;
  background: #fff;
}

.law-search {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  height: 42px;
  margin-bottom: 12px;
  padding: 8px 12px 8px 20px;
  border: 1px solid #d6e0ed;
  border-radius: 99px;
  background: #fff;
}

.law-search:focus-within {
  border: 1.5px solid #5284c5;
}

.law-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.law-search input::placeholder { color: #7e8d9a; }
.law-search button {
  display: flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.law-search button img {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: brightness(0);
  opacity: 0.55;
}

.law-table-wrap {
  overflow: hidden;
  border-radius: 15px;
}

.law-table {
  width: 100%;
  table-layout: fixed;
  /* 各儲存格自行畫線，讓底部框線能沿圓角繪製。 */
  border-collapse: separate;
  border-spacing: 0;
  color: #404040;
  font-size: 18px;
  line-height: 1.5;
}

.law-number-col { width: 80px; }
.law-date-col { width: 17%; }
.law-table th,
.law-table td {
  height: 54px;
  padding: 12px 24px;
  vertical-align: middle;
}

.law-table th {
  border-width: 0 2px 0 2px;
  border-style: solid;
  border-color: #5688c7;
  background: #5688c7;
  color: #fff;
  font-weight: 700;
}
.law-table td {
  border-width: 0 2px 2px 2px;
  border-style: solid;
  border-color: #dce6f3;
}
.law-table th:not(:last-child) { border-right: 2px solid #fff; }
/* 相鄰儲存格共用一條 2px 分隔線，避免疊成 4px。 */
.law-table th + th,
.law-table td + td { border-left: 0; }
.law-table tbody tr:last-child td:first-child,
.law-table tbody tr.is-page-last td:first-child { border-bottom-left-radius: 15px; }
.law-table tbody tr:last-child td:last-child,
.law-table tbody tr.is-page-last td:last-child { border-bottom-right-radius: 15px; }
/* 分頁隱藏的列（手機版 tr 是 display: grid，要明確蓋掉） */
.law-table tbody tr[hidden] { display: none; }
.law-table td:first-child,
.law-table td:last-child {
  font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}
.law-table time { white-space: nowrap; }
.law-table a { color: #0861b7; font-weight: 700; text-decoration: underline; overflow-wrap: anywhere; }

.law-pagination { margin-top: 24px; }
.law-pagination ol { display: flex; justify-content: center; align-items: center; gap: 10px; }
.law-pagination button,
.law-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  color: #7e8d9a;
  font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}
.law-pagination [aria-current="page"] { background: #dce6f3; color: #0861b7; }

@media (max-width: 1279px) {
  .law-panel { padding: 36px 30px 80px; }
  .law-date-col { width: 140px; }
  .law-table th, .law-table td { padding: 12px; }
}

@media (max-width: 767px) {
  .law-number-col { width: 36px; }
  .law-date-col { width: 112px; }
  .law-table { font-size: 14px; }
  .law-table th, .law-table td { padding: 12px 6px; }
}

@media (max-width: 1023px) {
  .law-panel { padding: 24px 24px 80px; border-radius: 25px; }
  .inner-page-background { background-image: none; }
}

/* 768px 以下改用日期在上、名稱在下的虛線清單。 */
@media (max-width: 768px) {
  .law-table-wrap { overflow: visible; border-radius: 0; }
  .law-table, .law-table tbody { display: block; width: 100%; }
  .law-table colgroup { display: none; }
  /* 保留表頭供輔助工具辨識欄位。 */
  .law-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .law-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 20px 12px;
    border: 0;
    border-bottom: 2px dashed #7e8d9a;
    border-radius: 0;
  }
  .law-table tbody td {
    display: block;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    font-size: 18px;
    line-height: 1.4;
    text-align: left;
  }
  .law-table tbody td:first-child { display: none; }
  .law-table tbody td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .law-table tbody td:last-child {
    grid-column: 1;
    grid-row: 1;
    color: #0861b7;
    font-size: 18px;
    text-align: left;
  }
  .law-table td a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #404040;
    text-decoration: none;
  }
}
