* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", sans-serif; background: #f0f2f5; padding: 20px; color: #333; }
h1 { color: #2F5496; margin-bottom: 16px; font-size: 22px; }
.card { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.card h2 { font-size: 15px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #548235; color: #548235; }
.card.fwd h2 { border-bottom-color: #BF8F00; color: #BF8F00; }
.row { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
label { font-weight: bold; min-width: 80px; }
input[type=number] { width: 80px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
input[type=text] { flex: 1; padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
button { padding: 8px 20px; background: #2F5496; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
button:hover { background: #1e3a6b; }
button.green { background: #548235; } button.green:hover { background: #3d6228; }
button.orange { background: #BF8F00; } button.orange:hover { background: #967000; }
.result { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 10px; border: 1px solid #ddd; text-align: center; }
th { background: #2F5496; color: #fff; }
tr:nth-child(even) { background: #f8f9fa; }
.hint { color: #888; font-size: 12px; margin-top: 6px; }
.match-list { max-height: 180px; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; margin-top: 4px; }
.match-list div { padding: 5px 10px; cursor: pointer; font-size: 13px; }
.match-list div:hover { background: #e7f0ff; }
.match-list div.sel { background: #2F5496; color: #fff; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-left: 6px; }
.badge.ok { background: #d4edda; color: #155724; }
.badge.ng { background: #f8d7da; color: #721c24; }
.empty { color: #999; padding: 12px; text-align: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  10%,30%,50%,70%,90% { transform: translateX(-6px); }
  20%,40%,60%,80% { transform: translateX(6px); }
}
.shake { animation: shake 0.5s; }

/* ==================== 作品主题皮肤 v0.21 ====================
   作用域限定在五个 panel 容器内；卡片正文保持浅底深字，不压字号。 */

#p5rPanel, #p4gPanel, #p3rPanel, #p3pPanel, #smt5vPanel {
  padding: 22px 18px 26px;
  margin-bottom: 10px;
}
#p5rPanel h1, #p4gPanel h1, #p3rPanel h1, #p3pPanel h1, #smt5vPanel h1 {
  display: inline-block;
}

/* ---------- P5R：红黑拼贴 / 斜切 ---------- */
#p5rPanel {
  background:
    repeating-linear-gradient(118deg, rgba(214,0,0,.10) 0 10px, rgba(0,0,0,0) 10px 34px),
    radial-gradient(circle at 12% 0%, #262626 0, #0b0b0b 62%, #050505 100%);
  border-radius: 4px;
}
#p5rPanel h1 {
  font-family: "Arial Black", Impact, "Microsoft YaHei", sans-serif;
  font-size: 28px; letter-spacing: .01em; color: #fff !important;
  padding: 4px 18px 6px 12px;
  background: linear-gradient(100deg, #111 0 58%, #d40000 58% 100%);
  text-shadow: 3px 3px 0 rgba(0,0,0,.55);
  transform: skewX(-6deg);
  border-radius: 2px;
}
#p5rPanel .card {
  background: #fffdf6; border: 2px solid #111; border-radius: 2px;
  box-shadow: 6px 6px 0 #d40000;
}
#p5rPanel .card h2 {
  color: #fff !important; background: #111 !important; border: 0 !important;
  display: inline-block; padding: 3px 12px; transform: skewX(-7deg);
  letter-spacing: .05em; border-radius: 1px;
}
#p5rPanel button {
  background: #d40000; border: 2px solid #111; border-radius: 2px;
  font-weight: bold; box-shadow: 3px 3px 0 #111;
}
#p5rPanel button:hover { background: #ff2b2b; }
#p5rPanel th { background: #111; border-color: #111; }
#p5rPanel .match-list { border: 2px solid #111; border-radius: 2px; }
#p5rPanel .match-list div.sel { background: #d40000; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }
#p5rPanel .match-list div:not(.sel):not([onclick*=More]):hover { background: #ffe8e8; }
#p5rPanel .match-list div.sel:hover { background: #a80000; color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }

/* ---------- P4G：电视黄 / 扫描线 ---------- */
#p4gPanel {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, rgba(0,0,0,0) 1px 3px),
    linear-gradient(155deg, #fffce8 0, #fff2b5 55%, #ffe066 100%);
  border-radius: 14px;
}
#p4gPanel h1 {
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  font-size: 26px; letter-spacing: .08em; color: #141414 !important;
  background: #ffd400; padding: 5px 18px 5px 14px;
  border-left: 10px solid #1b1b1b; border-radius: 6px;
  box-shadow: 0 4px 0 #c9a300;
}
#p4gPanel .card {
  background: #ffffff; border: 2px solid #e8c200; border-radius: 12px;
  box-shadow: 0 4px 0 #efd27a;
}
#p4gPanel .card h2 {
  color: #141414 !important; border-bottom: 2px dashed #1b1b1b !important;
  letter-spacing: .03em;
}
#p4gPanel button { background: #1b1b1b; color: #ffd400; border-radius: 999px; }
#p4gPanel button:hover { background: #000; color: #fff; }
#p4gPanel th { background: #ffd400; color: #141414; border-color: #e0b900; }
#p4gPanel .match-list { border: 2px solid #e8c200; border-radius: 10px; background: #fffef7; }
#p4gPanel .match-list div.sel { background: #ffd400; color: #111; font-weight: 600; box-shadow: inset 3px 0 0 #1b1b1b; }
#p4gPanel .match-list div:not(.sel):not([onclick*=More]):hover { background: #fff6cf; }
#p4gPanel .match-list div.sel:hover { background: #f0c000; color: #111; box-shadow: inset 3px 0 0 #1b1b1b; }

/* ---------- P3R：深夜蓝 / 月光 / 青色 HUD ---------- */
#p3rPanel {
  background:
    radial-gradient(circle at 92% 3%, rgba(96,206,255,.30) 0 74px, rgba(0,0,0,0) 75px),
    radial-gradient(circle at 92% 3%, rgba(0,0,0,0) 0 100px, rgba(120,214,255,.13) 101px 103px, rgba(0,0,0,0) 104px),
    linear-gradient(180deg, rgba(0,0,0,0) 0 62%, rgba(86,186,255,.11) 62% 62.25%, rgba(0,0,0,0) 62.25%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(0,0,0,0) 1px 64px),
    radial-gradient(ellipse at 50% -18%, #2f7acd 0, #0d2450 46%, #04070f 100%);
  border-radius: 6px;
}
#p3rPanel h1 {
  font-family: "Bahnschrift", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 27px; font-weight: 800; letter-spacing: .16em; color: #fff !important;
  padding: 6px 18px 10px 18px;
  background: linear-gradient(90deg, rgba(0,126,240,.70) 0, rgba(0,126,240,.10) 60%, rgba(0,0,0,0) 100%);
  border-left: 5px solid #35c3ff; border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  text-shadow: 0 0 16px rgba(90,190,255,.85);
}
#p3rPanel .card {
  background: linear-gradient(180deg, #fcfeff 0, #eaf3ff 100%);
  border: 1px solid #74b2ec; border-top: 3px solid #2f8fe0; border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 10px 26px rgba(3,14,38,.42), 0 0 24px rgba(60,150,255,.16);
}
#p3rPanel .card h2 {
  color: #fff !important;
  background: linear-gradient(90deg, #0b2e63 0, #08203f 100%);
  border-bottom: 0 !important; border-left: 4px solid #35c3ff !important;
  padding: 7px 12px 7px 10px; letter-spacing: .08em; border-radius: 2px;
}
#p3rPanel button {
  background: linear-gradient(180deg, #0e3c86, #07204a);
  border: 1px solid #4fa7e8; border-radius: 2px; letter-spacing: .08em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(140,215,255,.32);
}
#p3rPanel button:hover {
  background: linear-gradient(180deg, #175bb8, #0c3572); color: #c8ecff !important;
  box-shadow: inset 0 1px 0 rgba(190,235,255,.6), inset 0 0 12px rgba(70,170,255,.35);
}
#p3rPanel th { background: #0a2a5c; border-color: #061a38; color: #bfe9ff; letter-spacing: .04em; }
#p3rPanel td { border-color: #d6e6f8; }
#p3rPanel input, #p3rPanel select, #p3rPanel textarea {
  background: #fff; border: 1px solid #9bc0e6; border-radius: 2px;
}
#p3rPanel input:focus, #p3rPanel select:focus, #p3rPanel textarea:focus {
  border-color: #35c3ff; outline: none; box-shadow: 0 0 0 2px rgba(53,195,255,.22);
}
#p3rPanel .match-list { border: 1px solid #74b2ec; border-radius: 4px; background: #fbfdff; }
#p3rPanel .match-list div.sel { background: #0b2e63; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }
#p3rPanel .match-list div:not(.sel):not([onclick*=More]):hover { background: #e6f0ff; }
#p3rPanel .match-list div.sel:hover { background: #061f45; color: #fff; box-shadow: inset 3px 0 0 rgba(120,220,255,.95); }
/* P3R 结果块：把模板带来的淡黄/橙改成深夜蓝玻璃，去掉 P4G 味 */
#p3rPanel .result > div[style*="background:#fffbe6"] {
  background: linear-gradient(180deg, #f7fbff, #e4efff) !important;
  border: 1px solid #74b2ec !important; border-left: 3px solid #2f8fe0 !important;
  border-radius: 3px !important;
  box-shadow: 0 6px 18px rgba(3,20,50,.16);
}
#p3rPanel [style*="color:#B58A00"] { color: #0a3f7d !important; }
#p3rPanel #p3rRSel, #p3rPanel #p3rFSel { color: #0a66b8 !important; letter-spacing: .02em; }
#p3rPanel .result > div[style*="background:#fffbe6"] > div[style*="font-size:15px"] b { color: #061f45; }

/* ---------- P3P：掌机粉蓝 / 圆点 ---------- */
#p3pPanel {
  background:
    radial-gradient(circle at 12px 12px, rgba(255,255,255,.75) 0 2px, rgba(0,0,0,0) 2.5px) 0 0 / 22px 22px,
    linear-gradient(150deg, #ffe9f3 0, #e9f0ff 52%, #f6e6ff 100%);
  border-radius: 18px;
}
#p3pPanel h1 {
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  font-size: 26px; letter-spacing: .1em; color: #fff !important;
  background: linear-gradient(90deg, #e56aa8, #8f7bd8);
  padding: 6px 22px; border-radius: 999px;
  box-shadow: 0 5px 0 rgba(150,90,170,.32);
}
#p3pPanel .card {
  background: #ffffff; border: 1px solid #e9c7e4; border-radius: 16px;
  box-shadow: 0 4px 12px rgba(180,120,190,.18);
}
#p3pPanel .card h2 {
  color: #b03a86 !important; border-bottom: 2px dashed #e9a9d4 !important;
}
#p3pPanel button { background: linear-gradient(180deg,#ef7fb8,#d1519a); border-radius: 999px; }
#p3pPanel button:hover { background: linear-gradient(180deg,#f392c3,#c0458d); }
#p3pPanel th { background: #b03a86; border-color: #8d2a68; }
#p3pPanel .match-list div.sel { background: #b03a86; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }
#p3pPanel .match-list div:not(.sel):not([onclick*=More]):hover { background: #ffeaf5; }
#p3pPanel .match-list div.sel:hover { background: #8d2a68; color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }

/* ---------- SMT5V：废墟紫霓虹 ---------- */
#smt5vPanel {
  background:
    repeating-linear-gradient(135deg, rgba(139,92,246,.13) 0 2px, rgba(0,0,0,0) 2px 26px),
    radial-gradient(circle at 82% 0%, #2c1a4a 0, #0b0712 62%, #050308 100%);
  border-radius: 2px;
}
#smt5vPanel h1 {
  font-family: Impact, "Microsoft YaHei", sans-serif;
  font-size: 30px; letter-spacing: .16em; color: #f3ecff !important;
  padding-left: 14px; border-left: 6px solid #8b5cf6;
  text-shadow: 0 0 12px rgba(160,110,255,.95), 0 0 30px rgba(90,40,170,.7);
}
#smt5vPanel .card {
  background: #f7f4fb; border: 1px solid #6b4aa8; border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(139,92,246,.16), 0 8px 20px rgba(10,0,30,.38);
}
#smt5vPanel .card h2 {
  color: #f1e8ff !important; background: linear-gradient(90deg,#3a2166,#1a1030) !important;
  border: 0 !important; padding: 3px 12px; letter-spacing: .06em;
}
#smt5vPanel button { background: #3a2166; border: 1px solid #8b5cf6; border-radius: 2px; letter-spacing: .05em; }
#smt5vPanel button:hover { background: #552f96; }
#smt5vPanel th { background: #2a1740; border-color: #4a2a70; }
#smt5vPanel .match-list { border: 1px solid #6b4aa8; border-radius: 2px; }
#smt5vPanel .match-list div.sel { background: #552f96; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }
#smt5vPanel .match-list div:not(.sel):not([onclick*=More]):hover { background: #efe8ff; }
#smt5vPanel .match-list div.sel:hover { background: #3a2166; color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.9); }

/* ---------- 选中行内的次级文字（等级/阿尔卡纳）：默认 .6 透明，深底上会糊掉 ---------- */
#p5rPanel .match-list div.sel small { opacity: 1 !important; color: #ffdede; }
#p4gPanel .match-list div.sel small { opacity: 1 !important; color: #333; }
#p3rPanel .match-list div.sel small { opacity: 1 !important; color: #dbe8ff; }
#p3pPanel .match-list div.sel small { opacity: 1 !important; color: #ffe3f1; }
#smt5vPanel .match-list div.sel small { opacity: 1 !important; color: #e9dcff; }

/* ---------- 表格斑马纹：按作微调，避免灰蓝底与主题冲突 ---------- */
#p5rPanel tr:nth-child(even) { background: #fff3ee; }
#p4gPanel tr:nth-child(even) { background: #fffbdc; }
#p3rPanel tr:nth-child(even) { background: #edf4ff; }
#p3pPanel tr:nth-child(even) { background: #fff3f9; }
#smt5vPanel tr:nth-child(even) { background: #f5f0fc; }

/* ---------- 选中标记：左侧竖条 + 右侧对勾，鼠标移开也认得出 ---------- */
#p5rPanel .match-list div.sel,
#p4gPanel .match-list div.sel,
#p3rPanel .match-list div.sel,
#p3pPanel .match-list div.sel,
#smt5vPanel .match-list div.sel {
  position: relative;
  padding-right: 36px;
}
#p5rPanel .match-list div.sel::after,
#p4gPanel .match-list div.sel::after,
#p3rPanel .match-list div.sel::after,
#p3pPanel .match-list div.sel::after,
#smt5vPanel .match-list div.sel::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
#p5rPanel .match-list div.sel::after { color: #fff; }
#p4gPanel .match-list div.sel::after { color: #111; }
#p3rPanel .match-list div.sel::after { color: #fff; }
#p3pPanel .match-list div.sel::after { color: #fff; }
#smt5vPanel .match-list div.sel::after { color: #fff; }

/* ---------- 悬停未选中行：给一道浅竖条，和选中态区分开（排除「显示更多」条） ---------- */
#p5rPanel .match-list div:not(.sel):not([onclick*=More]):hover,
#p4gPanel .match-list div:not(.sel):not([onclick*=More]):hover,
#p3rPanel .match-list div:not(.sel):not([onclick*=More]):hover,
#p3pPanel .match-list div:not(.sel):not([onclick*=More]):hover,
#smt5vPanel .match-list div:not(.sel):not([onclick*=More]):hover {
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, .18);
}

/* ---------- 「查看更多 / 显示更多」：各作做成可点的条，不再是一行小字 ---------- */
#p5rPanel button[onclick^="showMore"]:hover { background: #111 !important; color: #fff !important; }

#p4gPanel div[onclick^="p4gMore"] {
  width: fit-content; margin: 10px auto 2px; padding: 6px 18px !important;
  color: #141414 !important; font-size: 13px !important; font-weight: 700;
  letter-spacing: .04em; background: #ffd400;
  border: 2px solid #1b1b1b; border-radius: 6px;
  box-shadow: 4px 4px 0 #1b1b1b;
}
#p4gPanel div[onclick^="p4gMore"]::before { content: "▼  "; }
#p4gPanel div[onclick^="p4gMore"]:hover {
  background: #141414 !important; color: #ffd400 !important; box-shadow: 2px 2px 0 #1b1b1b;
}

#p3rPanel div[onclick^="p3rMore"] {
  width: fit-content; margin: 10px auto 2px; padding: 6px 20px !important;
  color: #e6f1ff !important; font-size: 13px !important; letter-spacing: .1em;
  background: linear-gradient(180deg, rgba(31,72,140,.95), rgba(8,22,52,.95));
  border: 1px solid #6fa6e8; border-radius: 3px;
  box-shadow: 0 0 12px rgba(90,150,255,.35), inset 0 1px 0 rgba(255,255,255,.16);
}
#p3rPanel div[onclick^="p3rMore"]::before { content: "▸  "; }
#p3rPanel div[onclick^="p3rMore"]:hover {
  border-color: #cfe6ff; box-shadow: 0 0 20px rgba(120,180,255,.8), inset 0 1px 0 rgba(255,255,255,.22);
}

#p3pPanel div[onclick^="p3pMore"] {
  width: fit-content; margin: 10px auto 2px; padding: 7px 22px !important;
  color: #4a0e30 !important; font-size: 13px !important; font-weight: 700;
  background: linear-gradient(180deg, #ffbcd8, #f08cbb) !important;
  border-radius: 999px;
  box-shadow: 0 4px 0 #c85a90, 0 8px 14px rgba(200,90,150,.22);
}
#p3pPanel div[onclick^="p3pMore"]::before { content: "✦  "; }
#p3pPanel div[onclick^="p3pMore"]:hover {
  color: #4a0e30 !important;
  background: linear-gradient(180deg, #ffa9cc, #e56fa6) !important;
  box-shadow: 0 2px 0 #b04a7c, 0 5px 10px rgba(200,90,150,.28);
  transform: translateY(2px);
}

#smt5vPanel div[onclick^="smt5vMore"] {
  width: fit-content; margin: 10px auto 2px; padding: 6px 24px !important;
  color: #e4d4ff !important; font-size: 13px !important; letter-spacing: .12em;
  background: #1a1029;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 12px);
  box-shadow: inset 0 0 0 1px #8b5cf6;
}
#smt5vPanel div[onclick^="smt5vMore"]::before { content: "◆  "; }
#smt5vPanel div[onclick^="smt5vMore"]:hover {
  background: #3a2166 !important; box-shadow: inset 0 0 0 1px #c4a6ff;
}


/* ---------- 语言层 v0.22 ---------- */
#langTabs label { font-size: 13px; color: #5d677d; letter-spacing: .5px; }

/* ==================================================================
   P5R 视觉强化层 v0.27.8
   设计依据：红黑白三色体系 / 网点印刷质感 / 硬边偏移阴影（纸片）
   作用域：仅 P5R。凡是共用外壳（body / 顶栏 / 页脚）的样式，全部挂在
          body:has(#p5rPanel 可见) 条件下，切到 P4G / P3R / P3P / SMT5V /
          关于页时自动失效，其余四作维持原样，一个像素都不动。
   约束：纯样式，零新增文本节点，不改任何布局属性（display / flex / margin）。
   ================================================================== */

/* ---------- 1. P5R 页：纸感底（米白 + 网点 + 极淡斜纹） ---------- */
body:has(#p5rPanel:not([style*="none"])) {
  background:
    radial-gradient(circle at 3px 3px, rgba(17,17,17,.055) 0 1.1px, rgba(0,0,0,0) 1.5px) 0 0 / 14px 14px,
    repeating-linear-gradient(114deg, rgba(17,17,17,.022) 0 9px, rgba(0,0,0,0) 9px 30px),
    #f4f2ed;
}

/* ---------- 2. P5R 页：顶栏黑红双线 + 方角控件 ---------- */
body:has(#p5rPanel:not([style*="none"])) #verTabs {
  background:
    repeating-linear-gradient(112deg, rgba(17,17,17,.05) 0 8px, rgba(0,0,0,0) 8px 26px),
    #fff !important;
  border: 0 !important;
  border-bottom: 3px solid #111 !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 0 #d40000, 0 10px 18px -6px rgba(0,0,0,.18) !important;
}
body:has(#p5rPanel:not([style*="none"])) #verTabs > label[for="verSelect"] {
  border-left: 4px solid #d40000;
  padding-left: 9px;
  color: #111 !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase;
}
body:has(#p5rPanel:not([style*="none"])) #verSelect {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: 3px 3px 0 #111;
  font-weight: 800 !important;
  transition: box-shadow .15s ease;
}
body:has(#p5rPanel:not([style*="none"])) #verSelect:hover { box-shadow: 5px 5px 0 #d40000; }
body:has(#p5rPanel:not([style*="none"])) #verSelect:focus {
  outline: none !important;
  border-color: #d40000 !important;
  box-shadow: 3px 3px 0 #d40000, inset 0 -3px 0 #d40000;
}
body:has(#p5rPanel:not([style*="none"])) #langTabs > label {
  border-left: 3px solid #111;
  padding-left: 8px;
  color: #111 !important;
  font-weight: 800 !important;
  letter-spacing: .1em !important;
}
body:has(#p5rPanel:not([style*="none"])) #langSelect {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #111 !important;
  font-weight: 800 !important;
  box-shadow: 3px 3px 0 #111;
}
body:has(#p5rPanel:not([style*="none"])) #langSelect:focus {
  outline: none !important;
  border-color: #111 !important;
  box-shadow: 3px 3px 0 #111, inset 0 -3px 0 #111;
}
body:has(#p5rPanel:not([style*="none"])) #verTabs > button {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #111 !important;
  font-weight: 800 !important;
  letter-spacing: .03em;
  box-shadow: 3px 3px 0 #111;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .12s ease;
}
body:has(#p5rPanel:not([style*="none"])) #verTabs > button:hover {
  background: #111 !important;
  color: #fff !important;
  box-shadow: 3px 3px 0 #d40000;
}
body:has(#p5rPanel:not([style*="none"])) #verTabs > button:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

/* ---------- 3. P5R 面板：网点纸卡 + 标题红三角 ---------- */
#p5rPanel .card {
  background:
    radial-gradient(circle at 4px 4px, rgba(17,17,17,.05) 0 1px, rgba(0,0,0,0) 1.4px) 0 0 / 13px 13px,
    #fffdf6 !important;
}
#p5rPanel .card h2 { position: relative; }
#p5rPanel .card h2::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  width: 15px;
  background: #d40000;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
}

/* ---------- 4. P5R 输入框 / 下拉：黑硬边、零圆角 ---------- */
#p5rPanel input[type="text"],
#p5rPanel input[type="number"],
#p5rPanel select,
#p5rPanel textarea {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  transition: border-color .12s ease, box-shadow .12s ease;
}
#p5rPanel input[type="text"]:focus,
#p5rPanel input[type="number"]:focus,
#p5rPanel select:focus,
#p5rPanel textarea:focus {
  border-color: #d40000 !important;
  outline: none !important;
  box-shadow: 3px 3px 0 rgba(212,0,0,.30);
}

/* ---------- 5. P5R 按钮纸片按压（硬阴影随位移收缩） ---------- */
#p5rPanel button {
  transition: transform .12s cubic-bezier(.2,.7,.3,1), box-shadow .12s ease;
}
#p5rPanel button:hover { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 #111; }
#p5rPanel button:active { transform: translate(3px, 3px); box-shadow: none; }

/* ---------- 6. P5R 表格行悬停 ---------- */
#p5rPanel th { letter-spacing: .05em; }
#p5rPanel tbody tr:hover { background: #ffe8e8; }

/* ---------- 6b. P5R 候选列表：黑硬边方框 ---------- */
#p5rPanel .match-list {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
}

/* ---------- 7. P5R 滚动条：细硬边 ---------- */
#p5rPanel .match-list { scrollbar-width: thin; scrollbar-color: #111 #fffdf6; }
#p5rPanel .match-list::-webkit-scrollbar { width: 10px; height: 10px; }
#p5rPanel .match-list::-webkit-scrollbar-track { background: #fffdf6; }
#p5rPanel .match-list::-webkit-scrollbar-thumb { background: #111; border: 2px solid #fffdf6; border-radius: 0; }
#p5rPanel .match-list::-webkit-scrollbar-thumb:hover { background: #d40000; }

/* ---------- 8. P5R 页：页脚黑底白字硬条 ---------- */
body:has(#p5rPanel:not([style*="none"])) #pageFooter {
  background: #111 !important;
  color: #f2ede2 !important;
  padding: 10px 16px !important;
  letter-spacing: .05em;
  border-bottom: 3px solid #d40000;
  box-shadow: 4px 4px 0 #d40000;
}

/* ---------- 9. 减弱动效偏好（仅 P5R） ---------- */
@media (prefers-reduced-motion: reduce) {
  body:has(#p5rPanel:not([style*="none"])) #verSelect,
  body:has(#p5rPanel:not([style*="none"])) #verTabs > button,
  #p5rPanel button {
    transition: none !important;
  }
  body:has(#p5rPanel:not([style*="none"])) #verTabs > button:active,
  #p5rPanel button:hover,
  #p5rPanel button:active {
    transform: none !important;
  }
}

/* ==================================================================
   P5R 金红黑皮肤 v0.27.9（第二套皮肤，可来回切换）
   依据：P5R 官方站 persona.atlus.com/p5r —— 近黑底 · 香槟金 · 深红 · 白字
   作用域：body.p5r-skin-royal 与 P5R 面板同时成立时才生效；
          切到其他四作 / 关于页时两套皮肤互不干扰，维持原样。
   可读性：结构性深底（标题条 / 表头 / 按钮 / 顶栏 / 页脚）一律白字或金字，
          对比度 ≥ 7:1；内容卡片仍是暖金浅底 + 深字，明度与原米白卡接近，
          保证长时间阅读不刺眼、不出现深底深字或浅底白字。
   ================================================================== */

/* ---------- R1. 页面底：近黑暖调 + 极淡金斜纹 ---------- */
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) {
  background:
    radial-gradient(circle at 3px 3px, rgba(226,196,131,.09) 0 1px, rgba(0,0,0,0) 1.4px) 0 0 / 16px 16px,
    repeating-linear-gradient(114deg, rgba(226,196,131,.03) 0 9px, rgba(0,0,0,0) 9px 32px),
    #0c0906;
}

/* ---------- R2. P5R 面板：黑金渐变，顶部金晕 ---------- */
body.p5r-skin-royal #p5rPanel {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(226,196,131,.17) 0%, rgba(226,196,131,0) 60%),
    repeating-linear-gradient(118deg, rgba(226,196,131,.05) 0 10px, rgba(0,0,0,0) 10px 34px),
    radial-gradient(circle at 12% 0%, #1e1811 0, #0e0b07 62%, #070504 100%);
  box-shadow: inset 0 0 0 1px rgba(168,132,61,.30);
}

/* ---------- R3. 主标题：黑底烫金字 + 右侧深红块 ---------- */
body.p5r-skin-royal #p5rPanel h1 {
  color: #f6e7bd !important;
  background: linear-gradient(100deg, #0f0b06 0 58%, #7d0c12 58% 100%) !important;
  border-left: 6px solid #e2c483;
  padding-left: 14px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6) !important;
}

/* ---------- R4. 内容卡：暖金纸 + 金细边 + 深红硬影 ---------- */
body.p5r-skin-royal #p5rPanel .card {
  background:
    radial-gradient(circle at 4px 4px, rgba(184,144,74,.07) 0 1px, rgba(0,0,0,0) 1.4px) 0 0 / 13px 13px,
    #fbf6e9 !important;
  border: 1px solid #b8904a !important;
  box-shadow: 6px 6px 0 #7d0c12, inset 0 1px 0 #fff !important;
}

/* ---------- R5. 卡片小标题：金底黑字 ---------- */
body.p5r-skin-royal #p5rPanel .card h2 {
  color: #14100a !important;
  background: linear-gradient(100deg, #ecd79c, #bb9250) !important;
  border: 0 !important;
  box-shadow: 2px 2px 0 #7d0c12;
}
body.p5r-skin-royal #p5rPanel .card h2::after { background: #c4171f !important; }

/* ---------- R6. 输入框：浅金底深字，金边，聚焦金晕 ---------- */
body.p5r-skin-royal #p5rPanel input[type="text"],
body.p5r-skin-royal #p5rPanel input[type="number"],
body.p5r-skin-royal #p5rPanel select,
body.p5r-skin-royal #p5rPanel textarea {
  border: 1px solid #b8904a !important;
  background: #fdf9ee !important;
  color: #1c1710 !important;
}
body.p5r-skin-royal #p5rPanel input[type="text"]:focus,
body.p5r-skin-royal #p5rPanel input[type="number"]:focus,
body.p5r-skin-royal #p5rPanel select:focus,
body.p5r-skin-royal #p5rPanel textarea:focus {
  border-color: #8f1016 !important;
  box-shadow: 0 0 0 3px rgba(226,196,131,.45) !important;
}

/* ---------- R7. 按钮：深红底 + 金边 + 米白字 ---------- */
body.p5r-skin-royal #p5rPanel button {
  background: #8f1016 !important;
  border: 1px solid #c9a45e !important;
  color: #fff2df !important;
  box-shadow: 3px 3px 0 #000 !important;
}
body.p5r-skin-royal #p5rPanel button:hover {
  background: #b3161d !important;
  box-shadow: 5px 5px 0 #000 !important;
}

/* ---------- R8. 表格：黑底金字的表头，暖金斑马行 ---------- */
body.p5r-skin-royal #p5rPanel th {
  background: #1a140c !important;
  color: #ecd79c !important;
  border-color: #55441f !important;
}
body.p5r-skin-royal #p5rPanel td { border-color: #ddceb2; }
body.p5r-skin-royal #p5rPanel tr:nth-child(even) { background: #f4e8d0 !important; }
body.p5r-skin-royal #p5rPanel tbody tr:hover { background: #efe0c0 !important; }

/* ---------- R9. 候选列表：暖金纸底，选中行深红 ---------- */
body.p5r-skin-royal #p5rPanel .match-list {
  background: #fbf6e9 !important;
  border: 1px solid #b8904a !important;
  border-radius: 2px !important;
}
body.p5r-skin-royal #p5rPanel .match-list div:not(.sel):not([onclick*=More]):hover {
  background: #f0dfbd !important;
}
body.p5r-skin-royal #p5rPanel .match-list div.sel {
  background: #8f1016 !important;
  color: #fff2df !important;
  box-shadow: inset 3px 0 0 #e2c483 !important;
}
body.p5r-skin-royal #p5rPanel .match-list { scrollbar-color: #8f1016 #fbf6e9; }
body.p5r-skin-royal #p5rPanel .match-list::-webkit-scrollbar-track { background: #fbf6e9; }
body.p5r-skin-royal #p5rPanel .match-list::-webkit-scrollbar-thumb {
  background: #8f1016; border: 2px solid #fbf6e9; border-radius: 0;
}

/* ---------- R10. 浅卡上的辅助文字：压深以保对比 ---------- */
body.p5r-skin-royal #p5rPanel .hint { color: #7b6d52 !important; }
body.p5r-skin-royal #p5rPanel .empty { color: #6f6449 !important; }

/* ---------- R11. 顶栏：黑金底，控件深底金字 ---------- */
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verTabs {
  background:
    repeating-linear-gradient(112deg, rgba(226,196,131,.045) 0 8px, rgba(0,0,0,0) 8px 26px),
    linear-gradient(100deg, #13100a, #1a1510) !important;
  border: 0 !important;
  border-bottom: 2px solid #a8843d !important;
  border-radius: 0 !important;
  box-shadow: 0 4px 0 #7d0c12, 0 10px 18px -6px rgba(0,0,0,.55) !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verTabs > label[for="verSelect"] {
  border-left-color: #c4171f !important;
  color: #e2c483 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verSelect {
  border-color: #a8843d !important;
  background: #171208 !important;
  color: #ecd79c !important;
  box-shadow: 3px 3px 0 #000 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verSelect:hover {
  box-shadow: 5px 5px 0 #000 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verSelect:focus {
  border-color: #e2c483 !important;
  box-shadow: 3px 3px 0 #000, inset 0 -3px 0 #e2c483 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #langTabs > label {
  border-left-color: #a8843d !important;
  color: #e2c483 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #langSelect {
  border-color: #a8843d !important;
  background: #171208 !important;
  color: #f4ead3 !important;
  box-shadow: 3px 3px 0 #000 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #langSelect:focus {
  border-color: #e2c483 !important;
  box-shadow: 3px 3px 0 #000, inset 0 -3px 0 #e2c483 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verTabs > button {
  border-color: #a8843d !important;
  background: #171208 !important;
  color: #f0e6d0 !important;
  box-shadow: 3px 3px 0 #000 !important;
}
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #verTabs > button:hover {
  background: #8f1016 !important;
  color: #fff2df !important;
  box-shadow: 3px 3px 0 #a8843d !important;
}

/* ---------- R12. 页脚：黑底米白字 + 深红压线 ---------- */
body.p5r-skin-royal:has(#p5rPanel:not([style*="none"])) #pageFooter {
  background: #0e0a06 !important;
  color: #d5c8ac !important;
  border-bottom: 3px solid #8f1016;
  box-shadow: 4px 4px 0 rgba(226,196,131,.30);
}

/* ---------- R13. 换肤按钮：标题行右侧，单击在两套皮肤间来回切 ---------- */
#p5rHeadRow {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin: 6px 0 18px;
}
#p5rHeadRow > h1 { margin: 0; }
#p5rSkinToggle {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px !important;
  font-size: 12.5px !important; line-height: 1.2;
  letter-spacing: .02em;
}
#p5rSkinToggle .sw { display: none; gap: 2px; }
#p5rSkinToggle .sw[data-skin-sw="classic"] { display: inline-flex; }
#p5rSkinToggle .sw i {
  display: block; width: 10px; height: 12px; border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.30), 0 0 0 1px rgba(255,255,255,.45);
}
#p5rSkinToggle .skin-lbl {
  font-weight: 600; letter-spacing: .1em;
  color: #fff3e0 !important;
}
#p5rSkinToggle .skin-name {
  display: none; font-weight: 900; letter-spacing: .04em;
  color: #fff !important;
}
#p5rSkinToggle .skin-name[data-skin-name="classic"] { display: inline; }
body.p5r-skin-royal #p5rSkinToggle .sw[data-skin-sw="classic"],
body.p5r-skin-royal #p5rSkinToggle .skin-name[data-skin-name="classic"] { display: none !important; }
body.p5r-skin-royal #p5rSkinToggle .sw[data-skin-sw="royal"] { display: inline-flex !important; }
body.p5r-skin-royal #p5rSkinToggle .skin-name[data-skin-name="royal"] { display: inline !important; }

