html {
  background-color: #f7f3f0;
}

body {
  font-family:
    "Inter",
    "Microsoft YaHei UI",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  width: 100%;
  margin: 0;
  background-color: #f7f3f0;
  color: #374151;
}

.content {
  padding: 16px;
  background-color: #f7f3f0;
}

.card {
  border: 1px solid #e5e1da;
  border-radius: 16px;
  margin-bottom: 20px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.card-header {
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f0e9;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 16px 20px;
}

.step {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

.drop-zone {
  position: relative;
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 50px 20px;
  text-align: center;
  background-color: #fcfaf8;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-zone:hover {
  border-color: #c66b47;
  background-color: #fff9f5;
}

.drop-zone.dragover {
  border-color: #c66b47;
  background-color: #fff4ed;
}

.drop-zone p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  pointer-events: none;
  font-weight: 500;
}

.drop-icon {
  color: #94a3b8;
  transition: all 0.3s ease;
  pointer-events: none;
}

.drop-zone:hover .drop-icon {
  color: #c66b47;
  transform: translateY(-4px);
}

#file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

button {
  background-color: #c66b47;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 2px 4px rgba(198, 107, 71, 0.2);
}

button:hover:not(:disabled) {
  background-color: #af5c3a;
  box-shadow: 0 4px 6px rgba(198, 107, 71, 0.3);
}

button:disabled {
  background-color: #e5e1da;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

.header-btn {
  background-color: #c66b47;
  color: white;
  border: 1px solid #c66b47;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(198, 107, 71, 0.2);
  height: 28px;
  box-sizing: border-box;
  white-space: nowrap;
}

.header-btn:hover {
  background-color: #af5c3a;
  border-color: #af5c3a;
  transform: translateY(-1px);
}

.header-btn:active {
  transform: scale(0.98);
}

.delete-btn {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #ffe4e6;
  padding: 0;
  min-width: 28px;
  height: 28px;
  justify-content: center;
}

.primary-action-btn {
  display: inline-block;
  background-color: #c66b47 !important;
  color: white !important;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(198, 107, 71, 0.2);
  white-space: nowrap;
}

.primary-action-btn:hover {
  background-color: #af5c3a !important;
  transform: translateY(-1px);
}

.delete-btn:hover {
  background-color: #ffe4e6;
  border-color: #fecdd3;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 4px 0;
}

.stat-item {
  background: #fbf9f6;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid #f3f0e9;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: #ffffff;
  border-color: #c66b47;
  transform: translateY(-2px);
}

.stat-label {
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#stat-matched, #stat-ratio {
  color: #10b981;
}

#stat-price, #stat-avg {
  color: #c66b47;
}

#result-summary {
  border-left: 5px solid #c66b47;
  background: #fffdfc;
}

.compare-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f3eee4;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e5e1da;
  font-size: 11px;
}

.compare-badge .new {
  color: #10b981;
  font-weight: 700;
}

.compare-badge .lost {
  color: #ef4444;
  font-weight: 700;
}

.compare-badge .sep {
  color: #d1ccc0;
}

.custom-dropdown {
  position: relative;
  font-family: inherit;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f3eee4;
  border-radius: 10px;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e1da;
}

.dropdown-header:hover {
  background: #ebe5d9;
  border-color: #d1ccc0;
}

.dropdown-header span {
  font-weight: 700;
  font-size: 13px;
  color: #374151;
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.dropdown-header svg {
  color: #94a3b8;
  transition: transform 0.2s;
}

.custom-dropdown.open .dropdown-header svg {
  transform: rotate(180deg);
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 250px;
  max-height: 360px;
  background: #ffffff;
  border: 1px solid #e5e1da;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  animation: dropdownShow 0.2s ease-out;
}

.dropdown-list::-webkit-scrollbar {
  width: 8px;
}

.dropdown-list::-webkit-scrollbar-track {
  background: #f8f7f3;
  border-radius: 999px;
}

.dropdown-list::-webkit-scrollbar-thumb {
  background: #d8d0c4;
  border-radius: 999px;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #c7bcad;
}

@keyframes dropdownShow {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-dropdown.open .dropdown-list {
  display: block;
}

.dropdown-item {
  padding: 12px 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f8f7f3;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #fbf9f6;
}

.dropdown-item .site-name {
  font-weight: 700;
  font-size: 13px;
  color: #111827;
}

.dropdown-item .site-meta {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dropdown-item .site-meta span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

.dropdown-item.active {
  background: #fff9f5;
  border-left: 3px solid #c66b47;
}

#summary-title {
  color: #111827;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.log-card {
  border: 1px solid #e5e1da;
  border-radius: 16px;
  background: #ffffff;
  margin-top: 24px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.log-header {
  background: #fbf9f6;
  color: #111827;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid #f3f0e9;
  display: flex;
  align-items: center;
}

.log-body {
  padding: 14px 20px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  height: 160px;
  overflow-y: auto;
  line-height: 1.7;
  background-color: #fcfaf8;
  color: #4b5563;
}

.log-body div {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(243, 238, 228, 0.5);
  padding-bottom: 4px;
}

.log-body div:last-child {
  border-bottom: none;
}

.status-ok {
  color: #10b981;
  font-weight: 700;
}

.status-err {
  color: #ef4444;
  font-weight: 700;
}

.status-loading {
  color: #9ca3af;
}

/* 侧边栏模式下的特殊样式 */
.sidebar-close-btn, .sidebar-refresh-btn {
  position: fixed;
  top: 12px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: white;
  color: #c66b47;
  border: 1px solid #c66b47;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(198, 107, 71, 0.15);
  z-index: 99999;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.sidebar-close-btn {
  right: 12px;
}

.sidebar-refresh-btn {
  right: 50px; /* 增加一点间距 */
}

.sidebar-close-btn:hover, .sidebar-refresh-btn:hover {
  background: #fdf6f0;
  color: #c66b47;
  border-color: #c66b47;
}

.sidebar-close-btn:hover {
  transform: rotate(90deg);
}

.sidebar-refresh-btn:hover {
  transform: scale(1.1);
}

.sidebar-refresh-btn.spinning svg, .card-refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.card-refresh-btn {
  background: none;
  border: none;
  padding: 4px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: none;
  width: auto;
}

.card-refresh-btn:hover {
  color: #c66b47;
  transform: rotate(180deg);
  background: none;
  box-shadow: none;
}



/*   Tabs  */
.op-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid #f3f0e9; padding-bottom: 0px; }
.op-tab { padding: 8px 16px; font-size: 13px; font-weight: 600; color: #9ca3af; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.op-tab:hover { color: #c66b47; }
.op-tab.active { color: #c66b47; border-bottom-color: #c66b47; }

.site-metric-pill { display: inline-flex; overflow: hidden; border-radius: 4px; border: 1px solid #e5e7eb; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; } .site-metric-pill .pill-label { background: #f3f4f6; color: #6b7280; padding: 2px 6px; font-weight: 600; border-right: 1px solid #e5e7eb; } .site-metric-pill .pill-value { background: #ffffff; color: #374151; padding: 2px 6px; font-weight: 700; }
