/* EXIF 查看/编辑页专属样式 */

.page-exif {
  max-width: 1180px;
}

.page-exif.is-editing {
  max-width: 1280px;
  padding-top: 12px;
  padding-bottom: 16px;
}

.page-exif.is-editing .header,
.page-exif.is-editing .seo-content,
.page-exif.is-editing .footer {
  display: none !important;
}

.page-exif.is-editing .panel {
  padding: 14px;
}

.exif-workspace[hidden] {
  display: none !important;
}

.exif-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 4px;
}

.exif-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exif-stage {
  height: min(48vh, 480px);
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #e8edf3 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #e8edf3 25%, transparent 25%) 0 8px / 16px 16px,
    linear-gradient(45deg, transparent 75%, #e8edf3 75%) 8px -8px / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #e8edf3 75%) -8px 0 / 16px 16px,
    #f4f7fb;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.exif-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(24, 33, 43, 0.12);
}

.exif-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.exif-meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.exif-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.exif-meta em.dirty {
  font-style: normal;
  color: #b45309;
  font-weight: 600;
}

.exif-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.exif-hl-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.exif-hl-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.exif-hl-value {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.exif-gps-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.85rem;
  font-weight: 600;
}

.exif-gps-banner[hidden] {
  display: none !important;
}

.exif-gps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.exif-gps-actions a,
.btn-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.exif-size-stats {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.exif-size-stats[hidden] {
  display: none !important;
}

.exif-size-stats strong {
  color: var(--ink);
}

.exif-hl-item.is-sensitive {
  border-color: rgba(234, 88, 12, 0.35);
  background: #fff7ed;
}

.exif-hl-empty {
  padding: 14px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
}

.exif-hl-label .priv,
.exif-row-label .priv,
.batch-meta .priv {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  vertical-align: middle;
}

.exif-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.exif-toolbar input[type="search"] {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink);
  min-width: 0;
}

.exif-toolbar input[type="search"]:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.exif-row.is-sensitive {
  background: #fffaf5;
}

.exif-row-value-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.exif-row-value-wrap .exif-row-value {
  flex: 1;
  min-width: 0;
}

.exif-copy {
  appearance: none;
  border: none;
  background: #eef2f6;
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.68rem;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

.exif-copy:hover {
  color: var(--ink);
  background: #e2e8f0;
}

.field-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow: auto;
}

.batch-empty {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  background: #f8fafc;
  border-radius: 10px;
}

.batch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.78rem;
  background: #fff;
}

.batch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.batch-meta {
  color: var(--muted);
  white-space: nowrap;
}

.batch-remove {
  appearance: none;
  border: none;
  background: #eef2f6;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
}

.batch-remove:hover {
  color: var(--ink);
}

.btn-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  margin: 0;
}

.exif-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.exif-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: calc(min(48vh, 480px) + 220px);
  overflow: hidden;
}

.exif-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.exif-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.side-block {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.side-block h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.seg-btn:hover {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--ink);
}

.seg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.field:last-child {
  margin-bottom: 0;
}

.field input[type="text"] {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.88rem;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
}

.field input[type="text"]:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.warn-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.warn-box[hidden] {
  display: none !important;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: pointer;
}

.check-inline input {
  accent-color: var(--accent);
}

.exif-tag-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.exif-tag-head h3 {
  margin: 0;
}

.exif-tag-head span {
  font-size: 0.75rem;
  color: var(--muted);
}

.exif-tag-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(42vh, 420px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.exif-group {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.exif-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.exif-row-label {
  color: var(--muted);
  word-break: break-word;
}

.exif-row-value {
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.exif-tag-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.exif-tag-empty[hidden] {
  display: none !important;
}

.side-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

#btn-save-edit[hidden] {
  display: none !important;
}

.btn-block {
  width: 100%;
}

.side-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel-tab[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .exif-layout {
    grid-template-columns: 1fr;
  }

  .exif-sidebar {
    max-height: none;
  }

  .exif-stage {
    height: min(40vh, 340px);
  }

  .exif-tag-list {
    max-height: 320px;
  }
}
