/* 丁丁快传 · 全局样式（自托管，无外部 CDN 依赖） */

:root {
  --dd-blue: #2563eb;
  --dd-blue-dark: #1d4ed8;
  --dd-bg: #f5f6f8;
  --dd-card: #ffffff;
  --dd-text: #1f2933;
  --dd-muted: #64748b;
  --dd-border: #e2e8f0;
  --dd-danger: #dc2626;
  --dd-radius: 14px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--dd-bg);
  color: var(--dd-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
}

dd-page,
.dd-page {
  display: block;
  min-height: 100vh;
  padding: 28px 16px 120px;
}

.dd-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.dd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dd-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dd-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--dd-blue), #22d3ee);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  flex: none;
}

.dd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 600;
}

.dd-card {
  background: var(--dd-card);
  border-radius: var(--dd-radius);
  border: 1px solid var(--dd-border);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  padding: 22px;
}

.dd-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.dd-sub {
  margin: 0;
  color: var(--dd-muted);
  font-size: 13px;
  line-height: 1.7;
}

.dd-hint {
  color: var(--dd-muted);
  font-size: 13px;
}

.dd-dropzone {
  margin-top: 18px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--dd-radius);
  background: #f8fafc;
  padding: 36px 20px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.dd-dropzone:hover {
  border-color: var(--dd-blue);
  background: #eff6ff;
}

.dd-dropzone.is-over {
  border-color: var(--dd-blue);
  background: #dbeafe;
  transform: scale(1.01);
}

.dd-dropzone-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
}

.dd-dropzone strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.dd-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.dd-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #eef2f7;
  color: var(--dd-text);
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}

.dd-btn:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.dd-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dd-btn--primary {
  background: var(--dd-blue);
  color: #fff;
}

.dd-btn--primary:hover:not(:disabled) {
  background: var(--dd-blue-dark);
}

.dd-btn--ghost {
  background: transparent;
  border-color: var(--dd-border);
}

.dd-btn--sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.dd-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--dd-border);
}

.dd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dd-table th,
.dd-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--dd-border);
  vertical-align: middle;
}

.dd-table th {
  background: #f8fafc;
  font-size: 12px;
  color: var(--dd-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dd-table tr:last-child td {
  border-bottom: 0;
}

.dd-file-name {
  word-break: break-all;
  font-weight: 600;
}

.dd-file-meta {
  color: var(--dd-muted);
  font-size: 12px;
  margin-top: 4px;
}

.dd-progress {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  min-width: 90px;
}

.dd-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--dd-blue), #22d3ee);
  transition: width 0.2s ease;
}

.dd-progress-text {
  font-size: 12px;
  color: var(--dd-muted);
  margin-top: 4px;
}

.dd-badge--ok {
  background: #dcfce7;
  color: #15803d;
}

.dd-badge--err {
  background: #fee2e2;
  color: #b91c1c;
}

.dd-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
}

.dd-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  animation: dd-pop 0.18s ease-out;
}

@keyframes dd-pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.dd-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 10px;
  margin: 18px 0;
  padding-left: 10px;
  color: var(--dd-blue);
}

.dd-qr {
  display: grid;
  place-items: center;
  margin: 16px auto 4px;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--dd-border);
}

.dd-qr canvas,
.dd-qr img {
  display: block;
  max-width: 220px;
  height: auto;
}

.dd-input {
  width: 100%;
  border: 1px solid var(--dd-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dd-input:focus {
  border-color: var(--dd-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dd-input--code {
  letter-spacing: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

.dd-link {
  color: var(--dd-blue);
  text-decoration: none;
  font-weight: 600;
}

.dd-link:hover {
  text-decoration: underline;
}

.dd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dd-spacer {
  flex: 1 1 auto;
}

.dd-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--dd-muted);
  font-size: 14px;
}

.dd-alert {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.7;
}

.dd-alert--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.dd-fixed-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--dd-border);
  z-index: 40;
}

.dd-fixed-bottom-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.dd-overlay-drop {
  position: fixed;
  inset: 0;
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 70;
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
}

.dd-hide-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dd-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--dd-muted);
  font-size: 12px;
  line-height: 1.9;
}

.dd-footer a {
  color: var(--dd-blue);
}

@media (max-width: 640px) {
  dd-page,
  .dd-page {
    padding: 18px 12px 150px;
  }

  .dd-card {
    padding: 16px;
  }

  .dd-code {
    font-size: 28px;
    letter-spacing: 8px;
  }

  .dd-table th:nth-child(3),
  .dd-table td:nth-child(3) {
    display: none;
  }
}
