/* =========================
   基础样式重置
   ========================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #2c3e50;
  background: linear-gradient(135deg, #f0f4ff 0%, #fef4ff 100%);
  min-height: 100vh;
  line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =========================
   顶部标题
   ========================= */
.site-header {
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: #fff;
  padding: 36px 0 28px;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.2);
}
.logo { font-size: 32px; letter-spacing: 1px; margin-bottom: 6px; }
.subtitle { opacity: 0.92; font-size: 15px; }

/* =========================
   Tab 导航
   ========================= */
.tabs {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  position: sticky; top: 0; z-index: 20;
  overflow-x: auto;
}
.tabs .container {
  display: flex; flex-wrap: nowrap;
  gap: 4px; padding: 10px 20px;
}
.tab-btn {
  flex: 1; min-width: 160px;
  padding: 12px 18px;
  border: none; background: transparent; cursor: pointer;
  font-size: 15px; color: #555;
  border-radius: 10px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tab-btn:hover { background: #f3f4ff; color: #6366f1; }
.tab-btn.active {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

/* =========================
   主区域 panel
   ========================= */
main { padding: 30px 0 60px; }
.panel { display: none; animation: fadein 0.3s ease; }
.panel.active { display: block; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel h2 {
  font-size: 22px; margin-bottom: 20px;
  color: #312e81;
  padding-left: 12px;
  border-left: 4px solid #a855f7;
}

/* =========================
   通用元素
   ========================= */
label {
  display: block;
  font-size: 14px; font-weight: 600;
  color: #475569; margin-bottom: 6px; margin-top: 12px;
}
.mt { margin-top: 16px; }

textarea, input[type="text"], input[type="number"],
input[type="datetime-local"], input[type="file"], select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 160px; font-family: "Consolas", "Monaco", monospace; }
input[type="range"] { padding: 0; width: 100%; }
textarea:focus, input:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
input[type="file"] {
  padding: 8px; cursor: pointer;
  background: #f8fafc;
}

/* =========================
   按钮
   ========================= */
.btn-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.btn {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  border: 1.5px solid #cbd5e1; background: #fff; color: #334155;
  border-radius: 8px; cursor: pointer;
  transition: all 0.2s;
}
.btn:hover:not(:disabled) {
  background: #f1f5f9; border-color: #94a3b8; transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-color: transparent; color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
.btn.danger {
  color: #dc2626; border-color: #fecaca;
}
.btn.danger:hover:not(:disabled) { background: #fee2e2; }

/* =========================
   布局：row/col, card, grid
   ========================= */
.row {
  display: flex; flex-wrap: wrap; gap: 20px;
}
.row .col { flex: 1; min-width: 260px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  border: 1px solid #f1f5f9;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card-grid .card.full { grid-column: 1 / -1; }
.card h3 { font-size: 17px; margin-bottom: 12px; color: #4c1d95; }

/* =========================
   Badge
   ========================= */
.badge {
  display: inline-block;
  font-size: 12px; padding: 2px 10px;
  border-radius: 999px; margin-left: 6px;
}
.badge.ok    { background: #dcfce7; color: #166534; }
.badge.error { background: #fee2e2; color: #991b1b; }

/* =========================
   Format list（时间戳）
   ========================= */
.format-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.format-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}
.format-item span:first-child { color: #64748b; font-weight: 500; }
.format-item span:last-child  { color: #1e293b; font-family: Consolas, monospace; }

/* =========================
   图片对比
   ========================= */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.compare-item {
  text-align: center;
  padding: 16px;
  background: #fafafa;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}
.compare-item h4 {
  font-size: 14px; margin-bottom: 10px; color: #475569;
}
.compare-item img {
  max-width: 100%; max-height: 260px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
}
.compare-item p {
  margin-top: 10px; font-size: 13px; color: #475569;
}
.compare-item img[src=""], .compare-item img:not([src]) {
  display: none;
}

/* =========================
   二维码
   ========================= */
.qr-box {
  min-height: 60px;
  display: flex; justify-content: center; align-items: center;
}
.qr-box img, .qr-box canvas {
  max-width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.drop-zone {
  margin-top: 10px;
  padding: 22px;
  border: 2px dashed #a5b4fc;
  border-radius: 10px;
  text-align: center;
  color: #6366f1;
  background: #eef2ff;
  font-size: 14px;
  transition: all 0.2s;
}
.drop-zone.dragover {
  background: #c7d2fe;
  border-color: #6366f1;
}

/* =========================
   二维码解析安全提示
   ========================= */
.warning-tip {
  margin: 14px 0 4px;
  padding: 10px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 13px;
  border-radius: 8px;
  line-height: 1.5;
}

/* =========================
   Footer
   ========================= */
.site-footer {
  text-align: center;
  padding: 32px 0 40px;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  margin-top: 20px;
}
.site-footer small {
  display: block;
  font-size: 13px;
  margin: 8px 0 0;
}
.footer-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}
.footer-tag {
  display: inline-block;
  font-weight: 700;
  color: #312e81;
  padding: 2px 10px;
  background: #eef2ff;
  border-radius: 6px;
}
.footer-line a {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-line a:hover { color: #a855f7; text-decoration: underline; }
.contact-line {
  margin-top: 1.5em;
  display: flex;
  justify-content: center;
}
/* 友情链接：突出显示 */
.friend-line {
  font-size: 16px;
}
.friend-line .footer-tag {
  color: #fff;
  background: #dc2626;
}

/* =========================
   响应式
   ========================= */
@media (max-width: 720px) {
  .logo { font-size: 24px; }
  .subtitle { font-size: 13px; }
  .tab-btn { min-width: 140px; font-size: 13px; padding: 10px 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .panel h2 { font-size: 18px; }
  .footer-blocks { gap: 20px; text-align: center; }
  .footer-line { flex-wrap: wrap; justify-content: center; white-space: normal; }
}
