@font-face {
  font-family: 'GovFangSong';
  src: local('FangSong'), local('STFangsong'), local('仿宋'), local('FangSong_GB2312');
  font-display: swap;
}
@font-face {
  font-family: 'GovHeiTi';
  src: local('SimHei'), local('STHeiti'), local('黑体');
  font-display: swap;
}
@font-face {
  font-family: 'GovKaiTi';
  src: local('KaiTi'), local('STKaiti'), local('楷体');
  font-display: swap;
}
@font-face {
  font-family: 'GovSong';
  src: local('STSong'), local('SimSun'), local('宋体'), local('STZhongsong');
  font-display: swap;
}
#red-letter-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; flex-direction: row; align-items: center; justify-content: center;
  z-index: 500; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow-y: auto; padding: 20px 16px;
}
#red-letter-overlay.active { display: flex; animation: fadeIn 0.3s; }
.red-letter-doc {
  background: #fbf8ef; position: relative; padding: 0; margin: auto;
  box-shadow: 0 8px 48px rgba(0,0,0,0.3);
  animation: redLetterIn 0.4s ease;
  color: #000;
  width: min(100%, 480px);
  max-height: 88vh;
  border-radius: 2px;
}
@keyframes redLetterIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.rl-page {
  padding: 28px 22px 24px 24px;
  max-height: 88vh;
  box-sizing: border-box;
  overflow-y: auto;
  font-family: 'GovFangSong','FangSong','STFangsong','仿宋','Noto Serif SC',serif;
  font-size: 16px;
  position: relative;
}
/*close button*/
.rl-close-btn {
  position: fixed; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  font-size: 20px; color: #666; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 510; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.rl-close-btn:active { transform: scale(0.9); }
.rl-top-meta {
  font-family: 'GovHeiTi','SimHei','黑体','Noto Sans SC',sans-serif;
  font-size: 12px; color: #000; margin-bottom: 4px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.rl-emblem {
  display: flex; justify-content: center; padding-top: 14px; margin-bottom: 6px;
}
.rl-emblem-ring {
  width: 52px; height: 52px; border: 2.5px solid #1a2f5a;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  position: relative; box-shadow: inset 0 0 0 3px #fbf8ef, inset 0 0 0 4.5px #1a2f5a;
}
.rl-emblem-star {
  font-size: 22px; color: #1a2f5a; line-height: 1;
}
.rl-issuer {
  text-align: center;
  font-family: 'GovSong','STSong','SimSun','宋体','Noto Serif SC',serif;
  font-size: 21px; font-weight: 700; color: #1a2f5a; line-height: 1.5;
  letter-spacing: 3px; margin-bottom: 2px;
}
.rl-issuer-en {
  text-align: center;
  font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  font-size: 10px; color: #5a6b8c; letter-spacing: 2px;
  margin-bottom: 8px;
}
.rl-doc-number {
  text-align: right;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px; color: #444; margin-bottom: 4px; padding-right: 4px;
  font-style: italic;
}
.rl-signer {
  display: flex; justify-content: space-between;
  font-family: 'GovFangSong','FangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; margin-bottom: 4px; padding: 0 4px;
}
.rl-signer .rl-signer-name { font-family: 'GovKaiTi','KaiTi','楷体','Noto Serif SC',serif; }
.rl-red-line {
  height: 2px; background: #1a2f5a; margin: 4px 0 0;
  position: relative;
}
.rl-red-line::after {
  content: ''; position: absolute; left: 0; right: 0; top: 3px;
  height: 1px; background: #1a2f5a;
}
.rl-title {
  text-align: center;
  font-family: 'GovSong','STSong','SimSun','宋体','Noto Serif SC',serif;
  font-size: 22px; font-weight: 700; color: #1a2f5a;
  line-height: 1.8; margin: 18px 0 0; padding: 0 8px;
}
.rl-title-en {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px; color: #5a6b8c; letter-spacing: 3px;
  margin: 0 0 16px;
}
.rl-recipient {
  font-family: 'GovFangSong','FangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; margin-bottom: 4px;
}
.rl-body {
  font-family: 'GovFangSong','FangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; line-height: 1.9;
  margin-bottom: 12px;
}
.rl-body p { margin: 0 0 2px; text-indent: 2em; }
.rl-body .lvl1 { font-family: 'GovHeiTi','SimHei','黑体','Noto Sans SC',sans-serif; font-weight: 600; }
.rl-body .lvl2 { font-family: 'GovKaiTi','KaiTi','楷体','Noto Serif SC',serif; }
.rl-body .lvl3, .rl-body .lvl4 { font-family: 'GovFangSong','仿宋','Noto Serif SC',serif; }
.rl-attachment {
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; text-indent: 2em; margin: 12px 0;
}
.rl-signature {
  text-align: right;
  font-family: 'GovFangSong','FangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; margin: 20px 0 8px;
  padding-right: 4em;
}
.rl-signature .rl-org { margin-bottom: 4px; }
.rl-seal {
  position: absolute; bottom: 90px; right: 32px;
  width: 72px; height: 72px; border: 3px double #3d4f73;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'GovSong','STSong','宋体','Noto Serif SC',serif;
  font-size: 11px; color: #3d4f73; font-weight: 700;
  text-align: center; line-height: 1.3; opacity: 0.8;
  transform: rotate(-8deg); pointer-events: none;
  z-index: 5;
}
.rl-seal-inner {
  width: 62px; height: 62px; border: 1px solid #3d4f73;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-direction: column; text-align: center;
}
.rl-annotation {
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; margin: 4px 0 0; text-indent: 2em;
}
.rl-footer-area { margin-top: 16px; }
.rl-footer-top { border-top: 1.5px solid #000; }
.rl-footer {
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 14px; color: #000;
  display: flex; justify-content: space-between;
  padding: 4px 0;
}
.rl-footer .rl-cc { text-indent: 1em; }
.rl-footer-bottom { border-top: 1.5px solid #000; }
.rl-footer-mid { border-top: 0.5px solid #000; }
.rl-input-section {
  background: #f4f1e8; border: 1.5px dashed #1a2f5a;
  padding: 14px 16px; margin: 16px 0 10px;
}
.rl-input-section .rl-input-prompt {
  font-family: 'GovKaiTi','KaiTi','楷体','Noto Serif SC',serif;
  font-size: 14px; color: #1a2f5a; margin-bottom: 10px; font-weight: 600;
}
.rl-input-group { margin: 8px 0; }
.rl-input-group label {
  display: block; font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; margin-bottom: 4px;
}
.rl-input-group input {
  width: 100%; padding: 8px 10px; border: 1px solid #999;
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 16px; color: #000; background: #fff;
  border-radius: 2px; box-sizing: border-box;
}
.rl-input-group input:focus { border-color: #1a2f5a; outline: none; box-shadow: 0 0 3px rgba(26,47,90,0.3); }
.rl-name-picker { margin: 4px 0; }
.rl-picker-label {
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 13px; color: #666; margin: 8px 0 4px;
}
.rl-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.rl-chip {
  display: inline-block; padding: 5px 12px;
  font-family: 'GovFangSong','仿宋','Noto Serif SC',serif;
  font-size: 15px; color: #333; background: #fff;
  border: 1px solid #ccc; border-radius: 4px;
  cursor: pointer; user-select: none; transition: all 0.15s;
}
.rl-chip:active { transform: scale(0.95); }
.rl-chip-active {
  background: #1a2f5a; color: #fff; border-color: #1a2f5a;
}
.rl-cn-doc .rl-chip-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.rl-btn {
  display: block; width: 100%; padding: 14px; margin-top: 12px;
  font-family: 'GovHeiTi','SimHei','黑体','Noto Sans SC',sans-serif;
  font-size: 16px; font-weight: 600; border: none; cursor: pointer;
  border-radius: 2px; transition: opacity 0.2s;
}
.rl-btn-primary { background: #1a2f5a; color: #fff; }
.rl-btn-primary:active { opacity: 0.85; }
.rl-btn-secondary { background: #f0f0f0; color: #333; border: 1px solid #999; }
.rl-btn-secondary:active { opacity: 0.85; }


/* ============================================================
   本土化中文：公文红头文件（GB/T 9704-2012 版式）
   承载尺寸与原联邦公函一致（min(100%,480px) 信纸容器），
   保留红头/发文字号/红色反线/标题/正文/版记的公文层级。
   ============================================================ */
.rl-cn-doc {
  width: min(100%, 480px);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 8px 48px rgba(0,0,0,0.3);
  color: #000;
  font-family: 'FangSong','仿宋','STFangsong','Noto Serif SC',serif;
}
.rl-cn-page {
  padding: 28px 24px 26px;
  box-sizing: border-box;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
/* 红头（发文机关标志）：红色，居中 */
.rl-cn-org {
  font-weight: 700;
  color: #e60012;
  text-align: center;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1.5;
}
/* 发文字号：3号仿宋（约16px），居中 */
.rl-cn-docnum {
  font-size: 14px;
  text-align: center;
  color: #000;
  margin-top: 8px;
  letter-spacing: 1px;
}
/* 红色反线（发文字号下） */
.rl-cn-redline {
  height: 2px;
  background: #e60012;
  margin-top: 6px;
  margin-bottom: 14px;
}
/* 标题：2号小标宋（约22px），居中 */
.rl-cn-title {
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
/* 主送机关 + 正文：3号仿宋（约16px） */
.rl-cn-recipient {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 8px;
}
.rl-cn-body {
  font-size: 14px;
  line-height: 1.9;
  text-align: justify;
}
.rl-cn-body p { margin: 0 0 6px; text-indent: 2em; }
/* 成文单位与日期：右对齐 */
.rl-cn-sign {
  margin-top: 16px;
  text-align: right;
  font-size: 14px;
  line-height: 1.8;
}
/* 版记：文件末页底部，黑色反线分隔 */
.rl-cn-version {
  margin-top: 20px;
  border-top: 1px solid #000;
  font-size: 12px;
  line-height: 1.8;
  color: #000;
}
.rl-cn-version-line {
  border-top: 1px solid #000;
  padding: 4px 0;
}
.rl-cn-version-line:first-child { border-top: none; }
/* 机密标记 */
.rl-cn-secret {
  position: absolute;
  top: 0; left: 0;
  font-size: 14px;
  color: #e60012;
}
/* 本土化中文红头文件内按钮：红色 */
.rl-cn-doc .rl-btn-primary { background: #c00000; color: #fff; }
