/* ================== 全局基础 ================== */
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background-color: #f5f6f7;
  color: #333;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

a:hover {
  color: #007bff;
}

/* ================== Header ================== */
.header {
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  box-sizing: border-box;
}

.siteTop {
  width: 100%;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.sTLeft a {
  color: #333;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
}

.sTLeft a i {
  margin-right: 6px;
  color: #007bff;
}

.sTRight {
  font-size: 14px;
}

.wd {
  max-width: 892px;
  margin: 0 auto;
}

/* ================== 文件信息 ================== */
.detail-info-title {
  max-width: 900px;
  margin: 16px auto;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-sizing: border-box;
}

.detail-item-title {
  font-size: 14px;
  color: #555;
}

.detail-item-title .value {
  color: #222;
  font-weight: 500;
}

/* ================== 提示框 ================== */
.preview-tip {
  max-width: 900px;
  margin: 0 auto 16px;
  padding: 10px 16px;
  background: #fff8e6;
  border: 1px solid #ffd27f;
  border-left: 4px solid #ff9800;
  border-radius: 6px;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.preview-tip strong {
  color: #e65100;
}

/* ================== 标题 ================== */
.title {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: left;
}

h1 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}

/* ================== 搜索区 ================== */
.related-section {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.search-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 500px;
  margin: 20px auto;
  padding: 0 10px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.search-box button {
  padding: 8px 16px;
  font-size: 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.search-box button:hover {
  background-color: #45a049;
}

/* ================== 相关列表 ================== */
.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.related-item {
  background-color: #f9f9f9;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #eee;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.related-item:hover {
  background-color: #eef5ff;
  transform: translateY(-2px);
  border-color: #cfe0ff;
}

.related-item a {
  color: #333;
  font-weight: 500;
  font-size: 16px;
}

/* ================== Footer ================== */
footer.site-footer {
  background-color: #f8f9fa;
  color: #555;
  padding: 24px 16px;
  border-top: 1px solid #e0e0e0;
  margin-top: 40px;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
}

.footer-right a {
  color: #007bff;
  margin-left: 10px;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* ================== PDF 容器与加载 ================== */
#page-wrapper {
  position: relative;
}

/* 遮罩 */
#page-wrapper .loading-mask {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(255,255,255,0.9);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #555;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* PDF 内容占位，初始隐藏 */
#page-container {
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
}

#page-wrapper.loaded #page-container {
  opacity: 1;
  height: auto;
  overflow: visible;
}

#page-wrapper.loaded .loading-mask {
  opacity: 0;
  pointer-events: none;
}

/* 占位符 */
#pdf-placeholder {
  width: 100%;
  max-width: 892px;
  height: 600px;
  background: #f0f0f0;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 18px;
  margin: 0 auto;
}

/* ================== PDF 页面基础结构 ================== */
.pf {
  position: relative;
  background-color: white;
  overflow: hidden;
  margin: 13px auto;
  border: 0;
  box-shadow: 1px 1px 3px 1px #333;
  border-collapse: separate;
}

.pc {
  position: absolute;
  border: 0;
  padding: 0;
  margin: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
  transform-origin: 0 0;
  -ms-transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
}

.bf, .bi, .c, .t, .d {
  position: absolute;
  margin: 0;
  border: 0;
  padding: 0;
}

.t {
  white-space: pre;
  font-size: 1px;
  transform-origin: 0 100%;
  unicode-bidi: bidi-override;
  -moz-font-feature-settings: "liga" 0;
}

.t span { position: relative; unicode-bidi: bidi-override; }
._ { display: inline-block; color: transparent; z-index: -1; }

::selection { background: rgba(127,255,255,0.4); }
::-moz-selection { background: rgba(127,255,255,0.4); }

/* ================== Zoom 控制 ================== */
#zoom-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #f5f5f2;
  padding: 12px 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  font-family: Arial, sans-serif;
  z-index: 100;
}

#zoom-controls button,
#zoom-controls a.action-btn {
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

#zoom-controls button {
  background: #fff;
  color: #555;
  padding: 10px 14px;
  min-width: 30px;
}

#zoom-controls button:hover {
  background: #e0e0dc;
  transform: translateY(-1px);
}

#zoom-controls .action-btn {
  background: #ff6b6b;
  color: #fff;
  padding: 10px 14px;
  min-width: 40px;
  text-align: center;
}

#zoom-controls .action-btn:hover {
  background: #ff5252;
}

#zoom-controls .download-btn {
  background: #4CAF50;
}

#zoom-controls .download-btn:hover {
  background: #45a049;
}

/* ================== 响应式 ================== */
@media (max-width: 600px) {
  .search-box {
    width: 100%;
    max-width: 100%;
    gap: 6px;
  }

  .search-box input { font-size: 15px; padding: 7px 10px; }
  .search-box button { font-size: 15px; padding: 7px 12px; }

  #zoom-controls { padding: 6px 0; gap: 10px; }
  #zoom-controls button { padding: 8px 12px; font-size: 13px; }
}

@media (min-width: 601px) {
  #zoom-controls button {
    padding: 6px 16px;
    font-size: 14px;
  }
}