body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #222;
}

.app-header {
  padding: 16px 24px;
  background: linear-gradient(135deg, #2f54eb, #722ed1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.app-main {
  max-width: 1600px;
  margin: 16px auto 32px;
  padding: 0 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-button {
  border: 1px solid #d9d9d9;
  background: #fff;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.tab-button.active {
  background: #2f54eb;
  border-color: #2f54eb;
  color: #fff;
  box-shadow: 0 2px 6px rgba(47, 84, 235, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 16px;
  overflow: hidden;
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.form-group label {
  min-width: 180px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  flex: 1;
  min-width: 200px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
}

button {
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

button:hover {
  border-color: #2f54eb;
  color: #2f54eb;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.file-name {
  font-size: 12px;
  color: #888;
}

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 8px 0;
}

.viewer-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 180px);
  min-height: 600px;
}

@media (max-width: 900px) {
  .viewer-layout {
    grid-template-columns: 1fr;
  }
}

.viewer-left {
  border-right: 1px solid #f0f0f0;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100%;
}

@media (max-width: 900px) {
  .viewer-left {
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    padding-right: 0;
    padding-bottom: 12px;
  }
}

.thumb-list {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  padding: 6px;
  background: #fafafa;
  margin-bottom: 12px;
}

.thumb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.thumb-item:hover {
  background: #f5f5f5;
}

.thumb-item.active {
  background: #e6f7ff;
  border-color: #1890ff;
}

.thumb-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.thumb-image[src] {
  background: none;
  animation: none;
}

.thumb-meta {
  font-size: 12px;
  overflow: hidden;
}

.thumb-row {
  color: #555;
}

.thumb-url {
  color: #999;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 200px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.viewer-right {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.big-image-container {
  border-radius: 8px;
  border: 1px solid #e9ecef;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  min-height: 500px;
  overflow: hidden;
  position: relative;
}


#big-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: opacity 0.3s ease, filter 0.3s ease;
  position: relative;
  z-index: 1;
}

/* 当图片没有 src 时显示占位符 */
#big-image:not([src]),
#big-image[src=""] {
  display: none;
}

.big-image-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.big-image-placeholder .placeholder-icon {
  font-size: 72px;
  margin-bottom: 16px;
  opacity: 0.3;
  line-height: 1;
}

.big-image-placeholder .placeholder-text {
  font-size: 15px;
  color: #adb5bd;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.big-image-info {
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
  margin-top: 8px;
}

.url-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.url-row a {
  font-size: 14px;
  color: #1890ff;
  word-break: break-all;
  font-weight: 500;
}

.controls-row,
.saved-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
}

.saved-row span {
  margin-right: 8px;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
}

.log {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  font-size: 12px;
  max-height: 240px;
  overflow: auto;
}

.recognize-result h3 {
  margin: 12px 0 6px;
  font-size: 14px;
}

.vis-image-wrapper {
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  background: #fafafa;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#vis-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  z-index: 9999;
}

.zoom-overlay.active {
  display: flex;
}

.zoom-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  justify-content: flex-end;
}

.zoom-toolbar button {
  background: #fff;
}

.zoom-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
}

.zoom-container.dragging {
  cursor: grabbing;
}

#zoom-image {
  transform-origin: center center;
  max-width: none;
  max-height: none;
}

/* 图片识别功能样式 */
.recognize-layout {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 500px;
}

.recognize-left,
.recognize-right {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid #f0f0f0;
}

.recognize-right {
  border-right: none;
  border-left: 1px solid #f0f0f0;
}

.recognize-panel-title {
  font-size: 14px;
  color: #2f54eb;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
}

.recognize-image-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recognize-image-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.recognize-image-item:hover {
  background: #eef2f7;
}

.recognize-image-item.active {
  border-color: #2f54eb;
  background: #eff6ff;
}

.recognize-image-item img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
  cursor: pointer;
}

.recognize-image-item .url-text {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  word-break: break-all;
  line-height: 1.4;
}

.recognize-result-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
}

.recognize-result-area.has-image {
  justify-content: flex-start;
}

.recognize-placeholder {
  color: #999;
  font-size: 16px;
}

.recognize-loading {
  color: #2f54eb;
  font-size: 16px;
}

.recognize-result-image {
  max-width: 100%;
  max-height: calc(100vh - 250px);
  border-radius: 8px;
  cursor: zoom-in;
}

@media (max-width: 900px) {
  .recognize-layout {
    flex-direction: column;
    height: auto;
  }
  
  .recognize-left,
  .recognize-right {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid #f0f0f0;
    max-height: 500px;
  }
  
  .recognize-right {
    border-bottom: none;
  }
}


