/* ===================================================
   法规页 · 档案抽屉
   ---------------------------------------------------
   一只金属档案柜的抽屉：前脸带把手与锁孔，腔体里是一叠
   索引卡。每张卡左侧一条书脊色标（= 文件类型），卡面压出
   编号与日期戳，点开像把卡抽出来。
   全部纯 CSS，无图片。
   =================================================== */

.cabinet { margin-top: 2px; }

/* ---------------- 抽屉前脸 ---------------- */
.cab-lid {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 20px 34px 18px 24px;
  border-radius: 12px 12px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #2b3240 0%, #232a37 44%, #191e27 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .15),
    inset 0 -1px 0 rgba(0, 0, 0, .55),
    0 5px 12px rgba(0, 0, 0, .38);
}
/* 前脸下沿一道细窄的暗沟，抽屉与腔体的接缝 */
.cab-lid::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .18));
}

.cab-h {
  font-size: 20px; font-weight: 600; letter-spacing: .01em; color: #eef2fa;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .72), 0 -1px 0 rgba(255, 255, 255, .09);
}
.cab-p { margin-top: 5px; font-size: 12.5px; color: #8d97aa; }

/* 前脸右侧：牛皮纸标签 + 锁孔 + 把手 */
.cab-hardware { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }

.cab-tag {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 11px 4px;
  border-radius: 3px;
  transform: rotate(-1.4deg);
  background: linear-gradient(180deg, #e9dcbb 0%, #dcc99e 62%, #cfba8c 100%);
  color: #5d4c2e;
  font-size: 11px; letter-spacing: .03em; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(0, 0, 0, .14);
}
.cab-tag b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cab-tag i { font-style: normal; opacity: .72; }

/* 锁孔：一颗黄铜圆盘，中间一道竖槽 */
.cab-lock {
  position: relative; width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #a08f63, #564a35 60%, #2e281e 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.cab-lock::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 2.5px; height: 8px;
  margin: -4px 0 0 -1.25px; border-radius: 1px;
  background: #14161c; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .1);
}

/* 金属拉手：一根短粗横条，两端各压一颗圆底座，像被拧在抽屉面上 */
.cab-handle {
  position: relative; width: 88px; height: 14px; border-radius: 7px;
  background:
    radial-gradient(70% 130% at 50% -10%, rgba(255, 255, 255, .22), transparent 72%),
    linear-gradient(180deg, #78839a 0%, #4a5464 34%, #2b323d 74%, #1e232c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -2px 3px rgba(0, 0, 0, .48),
    0 3px 5px rgba(0, 0, 0, .62);
}
.cab-handle::before, .cab-handle::after {
  content: ''; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #909bb0, #4a5464 58%, #232933 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .7), inset 0 0 0 .5px rgba(0, 0, 0, .3);
}
.cab-handle::before { left: -7px; }
.cab-handle::after { right: -7px; }

/* ---------------- 抽屉腔体 ---------------- */
.cab-in {
  padding: 13px 13px 15px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #0b0d12 0%, #090b0f 100%);
  box-shadow:
    inset 0 11px 24px rgba(0, 0, 0, .8),
    inset 16px 0 20px -16px rgba(0, 0, 0, .95),
    inset -16px 0 20px -16px rgba(0, 0, 0, .95),
    inset 0 0 0 1px rgba(255, 255, 255, .035);
}

/* 检索槽：凹进腔体里的两道槽 */
.cab-tools { display: flex; gap: 9px; margin-bottom: 10px; }
.cab-q {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 12px;
  border: 1px solid #1b2130; border-radius: 6px;
  background: #090c11; color: var(--tx);
  font-family: inherit; font-size: 13px;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .16s, box-shadow .16s;
}
.cab-q::placeholder { color: #4b5466; }
.cab-q:focus {
  outline: none; border-color: #2c4670;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .85), 0 0 0 3px rgba(79, 143, 247, .13);
}
.cab-sel {
  flex: 0 0 132px; height: 34px; padding: 0 9px;
  border: 1px solid #1b2130; border-radius: 6px;
  background: #090c11; color: var(--tx-2);
  font-family: inherit; font-size: 12.5px;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .04);
}
.cab-sel:focus { outline: none; border-color: #2c4670; }

/* 类型标签：凸起的小铁片，选中就被按下去 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 11px; }
.tab {
  height: 25px; padding: 0 10px;
  border: 0; border-radius: 3px;
  font-size: 11.5px; color: #8993a6; letter-spacing: .01em;
  background: linear-gradient(180deg, #252c39 0%, #1a1f29 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .085),
    0 1px 2px rgba(0, 0, 0, .6);
  transition: color .14s, box-shadow .14s, background .14s;
}
.tab:hover { color: var(--tx); background: linear-gradient(180deg, #2b3341 0%, #1e242f 100%); }
.tab.on {
  color: #b9d2fa;
  background: linear-gradient(180deg, #161b24 0%, #1d2330 100%);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, .9),
    0 0 0 1px rgba(79, 143, 247, .26);
}

/* ---------------- 卡纸堆 ---------------- */
.cab-list { counter-reset: law; display: flex; flex-direction: column; gap: 3px; }

.lawcard {
  counter-increment: law;
  position: relative;
  border-radius: 4px;
  background: linear-gradient(180deg, #1a1f29 0%, #151a23 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    0 1px 0 rgba(0, 0, 0, .6);
  transition: background .18s, box-shadow .2s, transform .2s;
}
/* 卡纸的边缘：下一张卡露出的那一线厚度 */
.lawcard::after {
  content: ''; position: absolute; left: 1px; right: 1px; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .11) 18%, rgba(255, 255, 255, .08) 82%, transparent);
  pointer-events: none;
}
.lawcard:hover {
  background: linear-gradient(180deg, #20262f 0%, #181d26 100%);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 5px 13px rgba(0, 0, 0, .52);
}
.lawcard.is-open {
  transform: none;
  background: linear-gradient(180deg, #1e2533 0%, #181d27 100%);
  box-shadow:
    inset 0 0 0 1px rgba(79, 143, 247, .13),
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 9px 22px rgba(0, 0, 0, .58);
}

/* 书脊：左侧一条 4px 色标，颜色 = 文件类型 */
.lc-spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 2px 0 0 2px;
  background: #4a5262;
  transition: box-shadow .18s;
}
.lc-spine::after {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, .12), transparent 48%);
}
.lawcard.is-open .lc-spine { box-shadow: 0 0 14px 0 currentColor, inset 0 0 0 1px rgba(255, 255, 255, .12); }

.lc-sum {
  display: flex; align-items: center; gap: 11px;
  min-height: 44px; padding: 7px 12px 7px 17px;
  cursor: pointer; list-style: none;
}
.lc-sum::-webkit-details-marker { display: none; }

/* 压印编号 */
.lc-no {
  flex: 0 0 auto;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px; letter-spacing: .06em; color: #5b6477;
  font-variant-numeric: tabular-nums;
}
.lc-no::before { content: counter(law, decimal-leading-zero); }

/* 标题 + 目录式引导点线，把标题与右侧信息之间的空白填掉 */
.lc-t {
  display: flex; align-items: center; flex: 1 1 auto; min-width: 0;
  font-size: 14.5px; font-weight: 500; line-height: 1.45; color: var(--tx);
}
.lc-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-dots {
  flex: 1 1 auto; min-width: 12px; height: 8px; margin: 3px 12px 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .13) 1px, transparent 1.2px);
  background-size: 7px 8px;
  background-repeat: repeat-x;
  background-position: 0 50%;
}
.lawcard.is-open .lc-t { color: #a8c8fb; }
.lawcard.is-open .lc-dots {
  background-image: radial-gradient(circle, rgba(79, 143, 247, .26) 1px, transparent 1.2px);
}

/* 元信息：类型 · 机关 · 文号，一行读完 */
.lc-m {
  flex: 0 1 auto; min-width: 0; max-width: 40%;
  font-size: 11.5px; color: #5d6678; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-m .lc-ty { color: #7a8499; }
.lc-m .lc-sep { opacity: .45; margin: 0 3px; }

/* 日期戳：一圈虚线，像盖上去的 */
.lc-d {
  flex: 0 0 auto;
  padding: 0 6px 1px;
  font-size: 10.5px; letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
  color: #a1967a;
  border: 1px solid rgba(190, 170, 120, .26);
  border-radius: 3px;
  background: rgba(190, 170, 120, .045);
}

.lc-ar {
  flex: 0 0 auto; width: 12px; text-align: center;
  font-size: 13px; line-height: 1; color: #495264;
  transition: transform .2s, color .2s;
}
.lawcard.is-open .lc-ar { transform: rotate(90deg); color: var(--blue); }

/* 抽出来的那张卡：正文区凹进去 */
.lc-body {
  display: none;
  margin: 0 12px 0 16px;
  padding: 12px 2px 15px 40px;
  border-top: 1px solid rgba(255, 255, 255, .055);
}
.lawcard.is-open .lc-body { display: block; }

.lc-ex {
  font-size: 12.5px; line-height: 1.72; color: #97a1b3;
  padding-bottom: 11px; margin-bottom: 11px;
  border-bottom: 1px dashed rgba(255, 255, 255, .085);
}

/* 条文要点：像在卡纸上逐条写下的摘录 */
.kp { margin: 0 0 13px; }
.kp li {
  list-style: none; position: relative;
  padding-left: 17px; margin-bottom: 7px;
  font-size: 12.5px; line-height: 1.78; color: #a4aebe;
}
.kp li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 1px;
  background: currentColor; opacity: .55;
}
.kp li:last-child { margin-bottom: 0; }

.lc-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: #6d7689;
}
.lc-foot a { color: #86b4fa; }
.lc-foot .lc-ext::after { content: ' ↗'; font-size: 10px; opacity: .8; }

/* 类型色标 */
.lawcard[data-t="部门规章"]   .lc-spine { background: #d0695f; color: #d0695f; }
.lawcard[data-t="规范性文件"] .lc-spine { background: #5b8ff7; color: #5b8ff7; }
.lawcard[data-t="管理提示"]   .lc-spine { background: #d9a63c; color: #d9a63c; }
.lawcard[data-t="管理措施"]   .lc-spine { background: #a97ee0; color: #a97ee0; }
.lawcard[data-t="行业规范"]   .lc-spine { background: #3fb894; color: #3fb894; }
.lawcard[data-t="办事指引"]   .lc-spine { background: #5fb0d4; color: #5fb0d4; }
.lawcard[data-t="行动计划"]   .lc-spine { background: #7d8798; color: #7d8798; }

/* 键盘可达 */
.cab-q:focus-visible, .cab-sel:focus-visible, .tab:focus-visible, .lc-sum:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.lc-sum:focus-visible { outline-offset: -2px; border-radius: 4px; }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 900px) {
  .cab-lid { padding: 16px 16px 15px; }
  .cab-h { font-size: 18px; }
  .cab-p { font-size: 12px; }
  .cab-handle { width: 92px; }
  .cab-in { padding: 11px 10px 13px; }
  .lc-m { max-width: 34%; }
}

@media (max-width: 700px) {
  .cab-lid { gap: 10px; padding: 14px 16px 13px; }
  .cab-tx { flex: 1 1 auto; min-width: 0; }
  /* 窄屏不摆副标题，让标题与拉手并排一行 */
  .cab-p { display: none; }
  .cab-h { font-size: 17px; }
  .cab-hardware { gap: 10px; }
  .cab-handle { width: 54px; height: 12px; }
  .cab-handle::before { left: -6px; }
  .cab-handle::after { right: -6px; }
  .cab-lock { width: 14px; height: 14px; }

  .cab-tools { flex-wrap: wrap; }
  .cab-q { flex: 1 1 100%; }
  .cab-sel { flex: 1 1 100%; }

  /* 两行：编号 + 标题 + 日期一行，元信息独占第二行 */
  .lc-sum { flex-wrap: wrap; gap: 3px 8px; padding: 9px 11px 9px 16px; }
  .lc-no { order: 0; }
  .lc-t { order: 1; flex: 1 1 60%; font-size: 13.5px; }
  .lc-tx { white-space: normal; }
  .lc-dots { display: none; }
  .lc-d { order: 2; flex: 0 0 auto; font-size: 11px; align-self: flex-start; margin-top: 2px; }
  .lc-ar { order: 3; }
  .lc-m { order: 4; flex: 1 1 100%; max-width: none; padding-left: 0; }

  .lc-body { margin: 0 11px 0 16px; padding: 11px 0 13px 26px; }
  .lc-ex, .kp li { font-size: 12.5px; }
}

@media (max-width: 380px) {
  .cab-lock, .cab-handle { display: none; }
  .cab-lid { padding: 13px 13px 12px; }
  .cab-h { font-size: 16px; }
  .cab-tag { padding: 2px 8px 3px; }
  .tab { padding: 0 8px; font-size: 11px; }

  /* 极窄：换成三列网格，标题吃掉剩余宽度，日期退到第二行右端 */
  .lc-sum {
    display: grid; align-items: start;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 4px 8px;
  }
  .lc-no { grid-row: 1; grid-column: 1; padding-top: 2px; }
  .lc-t { grid-row: 1; grid-column: 2; }
  .lc-ar { grid-row: 1; grid-column: 3; padding-top: 3px; }
  .lc-m { display: none; }
  .lc-d { grid-row: 2; grid-column: 1 / -1; justify-self: end; margin-top: 0; }
}
