* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: #f5f7fb;
  color: #111827;
  padding: 24px 14px;
}

.card {
  width: min(920px, 100%);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

.subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
}

button {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  background: #111827;
  color: #fff;
}

button:hover {
  background: #1f2937;
}

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

.secondary-btn,
#copyBtn {
  background: #eef2ff;
  color: #111827;
  border: 1px solid #dbe4ff;
}

.secondary-btn:hover,
#copyBtn:hover {
  background: #e0e7ff;
}

.hidden {
  display: none;
}

.inbox-panel,
.messages-panel,
.message-detail {
  margin-top: 22px;
}

.label {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #6b7280;
}

.email-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-display {
  flex: 1;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #dbe4ff;
  background: #f8faff;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  word-break: break-all;
}

.timer-card {
  margin-top: 14px;
  border: 1px solid #dbe4ff;
  background: #f8faff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timer {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timer.warning {
  color: #b45309;
}

.timer.expired {
  color: #b91c1c;
}

.status {
  margin: 10px 0 0;
  min-height: 1.2em;
  color: #6b7280;
  font-size: 0.92rem;
}

.messages-panel {
  border-top: 1px solid #e5e7eb;
  padding-top: 18px;
}

.messages-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.message-count {
  font-size: 0.86rem;
  color: #6b7280;
}

.inbox-hint {
  margin: 0 0 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  text-align: center;
  color: #64748b;
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.message-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #111827;
}

.message-item:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.message-item.new {
  border-color: #2563eb;
}

.message-item-subject {
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 1rem;
}

.message-item-from,
.message-item-intro {
  color: #6b7280;
  font-size: 0.88rem;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 14px;
  background: #eef2ff;
  color: #111827;
  border: 1px solid #dbe4ff;
}

.back-btn:hover {
  background: #e0e7ff;
}

#detailSubject {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.detail-meta {
  margin: 0 0 6px;
  color: #4b5563;
  font-size: 0.92rem;
}

.detail-body {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  min-height: 220px;
  max-height: 65vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.detail-body iframe {
  width: 100%;
  min-height: 240px;
  border: none;
  background: #fff;
}

@media (max-width: 700px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .email-box,
  .timer-card {
    flex-direction: column;
    align-items: stretch;
  }

  .email-display {
    font-size: 1.08rem;
  }
}
