/* ===== 蓝夹缬检索页 ===== */
/* 以 "检索拓片" 为意象：靛蓝底 + 宣纸卡片 + 雕版检索框 */

.container {
  flex: 1;
  width: calc(100% - 60px);
  margin-left: 60px;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.container.blue-jiaxie-pattern {
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* 靛蓝光晕 */
.container.blue-jiaxie-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(33, 93, 163, 0.16), transparent 30%),
    radial-gradient(circle at bottom left, rgba(15, 68, 126, 0.14), transparent 32%);
  pointer-events: none;
}

/* 半透明暖白面板，露出下方深蓝纹样 */
.container.blue-jiaxie-pattern::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(248, 246, 242, 0.94), rgba(240, 245, 252, 0.92));
  box-shadow: inset 0 0 0 1px rgba(31, 67, 116, 0.10);
  pointer-events: none;
  z-index: 0;
}

/* 检索号/区块定位 */
.service-status, .search-container,
.results-container-wrapper, .modal,
.heritage-note { position: relative; z-index: 1; }

/* ===== 服务状态徽标 ===== */
.service-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(248, 246, 242, 0.85);
  border: 1px solid rgba(23, 54, 95, 0.12);
  box-shadow: 0 10px 24px rgba(23, 54, 95, 0.08);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.service-status.jiaxie-badge::before { display: none; }

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-online { background: #39b86d; box-shadow: 0 0 0 6px rgba(57, 184, 109, 0.14); }
.status-offline { background: #d35b5b; box-shadow: 0 0 0 6px rgba(211, 91, 91, 0.14); }

/* ===== 修复： heritage-note 颜色 ===== */
/* 之前是 rgba(244,240,230,0.92) 在白底上不可见 */
.heritage-note {
  margin: -10px 0 20px;
  color: var(--ink-4);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ===== 检索容器 ===== */
.search-container { margin-bottom: 22px; }

/* 输入面板与结果面板：宣纸质感 + 雕版花框 */
.input-panel, .results-panel {
  background: rgba(250, 248, 244, 0.80);
  border: 1px solid rgba(31, 67, 116, 0.14);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 36px rgba(14, 38, 74, 0.08);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

/* 织物纹理 + 四角钉 */
.input-panel::before, .results-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20px 20px, rgba(31, 67, 116, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at calc(100% - 20px) 20px, rgba(31, 67, 116, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at 20px calc(100% - 20px), rgba(31, 67, 116, 0.07) 0 1px, transparent 1px),
    radial-gradient(circle at calc(100% - 20px) calc(100% - 20px), rgba(31, 67, 116, 0.07) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(244, 240, 230, 0.30), rgba(244, 240, 230, 0.15));
  background-size: 28px 22px, 28px 22px, 28px 22px, 28px 22px, auto;
  opacity: 0.85;
}

/* 雕版虚线内框 */
.input-panel::after, .results-panel::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(31, 67, 116, 0.14);
  pointer-events: none;
  opacity: 0.7;
}

.input-panel > *, .results-panel > * { position: relative; z-index: 1; }

/* ===== 面板标题：靛蓝方块 + 木刻圆点 ===== */
.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 22px;
}

.panel-title::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ink-3), var(--ink-4));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.panel-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(119, 64, 26, 0.70);
  box-shadow: 0 0 0 4px rgba(119, 64, 26, 0.12);
}

/* ===== 表单组 ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
}

.form-group input, .form-group select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid #cad8ea;
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.94);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--ink-4);
  box-shadow: 0 0 0 4px rgba(47, 105, 173, 0.12);
  background: #fff;
}

/* ===== 按钮 ===== */
.reference-dropzone {
  min-height: 148px;
  padding: 12px;
  border: 1px dashed #9fb5cf;
  border-radius: 16px;
  background: rgba(244, 248, 253, 0.86);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}

.reference-dropzone input { display: none; }

.reference-placeholder {
  color: #60758f;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.reference-dropzone img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.btn {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ink-3), var(--ink-4));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 14px 24px rgba(29, 79, 145, 0.22);
}

.btn + .btn { margin-top: 12px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-success {
  background: linear-gradient(135deg, #5d3718, #8f5930);
  box-shadow: 0 14px 24px rgba(119, 64, 26, 0.22);
}

/* ===== 加载 ===== */
.loading {
  display: none;
  margin-top: 18px;
  padding: 20px;
  border-radius: 18px;
  text-align: center;
  background: rgba(238, 244, 251, 0.9);
  color: var(--text-soft);
}

.spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid rgba(52, 110, 179, 0.16);
  border-top-color: var(--ink-4);
  animation: spin 0.9s linear infinite;
}

/* ===== 结果容器 ===== */
.results-container-wrapper { min-height: 420px; }
.results-panel { min-height: 100%; }

.results-container {
  position: relative;
  min-height: 320px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}

/* 雁荡山暗纹 */
.results-container::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -34px;
  width: 220px;
  height: 220px;
  background: url("../../bgimg/雁荡山.png") center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.placeholder-text {
  grid-column: 1 / -1;
  min-height: 300px;
  border: 1px dashed #bfd0e5;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(245, 249, 254, 0.95), rgba(238, 244, 251, 0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  line-height: 1.8;
}

/* ===== 结果卡片 ===== */
.result-item {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d9e3ef;
  box-shadow: 0 10px 20px rgba(23, 54, 95, 0.08);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
}

.result-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14px 14px, rgba(31, 67, 116, 0.10) 0 1px, transparent 1px),
    radial-gradient(circle at 14px 14px, rgba(119, 64, 26, 0.06) 0 2px, transparent 2px),
    linear-gradient(90deg, rgba(31, 67, 116, 0.06) 0 12px, transparent 12px calc(100% - 12px), rgba(31, 67, 116, 0.06) calc(100% - 12px) 100%),
    linear-gradient(0deg, rgba(31, 67, 116, 0.04) 0 12px, transparent 12px calc(100% - 12px), rgba(31, 67, 116, 0.04) calc(100% - 12px) 100%);
  background-size: 24px 18px, 40px 30px, auto, auto;
  opacity: 0.65;
  mix-blend-mode: multiply;
}

.result-item:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 67, 116, 0.30);
  box-shadow: 0 18px 30px rgba(23, 54, 95, 0.14);
}

.result-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #dbe6f3, #eef4fb);
}

.result-info { padding: 14px 14px 16px; }

.result-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  word-break: break-all;
  margin-bottom: 8px;
}

.result-tags, .result-similarity, .result-match { font-size: 13px; color: #60758f; }
.result-similarity { margin-top: 8px; color: var(--ink-3); font-weight: 700; }
.result-match {
  margin-top: 6px;
  line-height: 1.45;
  color: #4f6680;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.more-results-info { grid-column: 1 / -1; margin-top: -4px; }

/* ===== 统计信息 ===== */
.image-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 18px;
}

.info-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(248, 246, 242, 0.92);
  border: 1px solid rgba(31, 67, 116, 0.10);
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-2);
}

#clearBtn { max-width: 220px; }

/* ===== 图片预览模态框 ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 48, 0.72);
  backdrop-filter: blur(6px);
  z-index: 2000;
  padding: 28px;
}

.modal-content {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 28px 64px rgba(4, 12, 48, 0.34);
}

.close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 34px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbe6f3, #eef4fb);
}

.modal-info {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: #f5f8fc;
  color: var(--text-main);
  line-height: 1.8;
  word-break: break-all;
}

.modal-info h3 { margin-bottom: 10px; color: var(--ink-2); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .image-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  body.blue-jiaxie-theme { padding: 16px; }
  .container { width: 100%; margin-left: 0; padding: 20px; border-radius: 20px; }
  .service-status { width: 100%; border-radius: 18px; }
  .panel-title { font-size: 20px; }
  .results-container { grid-template-columns: 1fr; }
  .results-container::after { width: 160px; height: 160px; right: 0; bottom: -24px; }
  .image-info { grid-template-columns: 1fr; }
  #clearBtn { max-width: none; }
  .modal { padding: 14px; }
  .modal-content { padding: 18px; }
}
