/* TempMail.cc — modern.css (2026 frontend refresh) */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #17202a;
  --text-secondary: #5b6672;
  --border: #e3e8ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --green: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 42, .05), 0 8px 24px rgba(23, 32, 42, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.brand img { height: 28px; width: auto; }
.brand b { color: var(--primary); font-weight: 700; }

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.header-link:hover { color: var(--primary); }

/* ---------- Nav ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  transition: color .15s ease;
}

.site-nav a:hover, .site-nav a.active { color: var(--primary); }

@media (max-width: 560px) {
  .site-nav { gap: 14px; }
  .site-nav .header-link svg { display: none; }
  .brand span { display: none; }
}

/* 窄屏（iPhone SE 320px 等）防导航溢出 */
@media (max-width: 400px) {
  .site-nav { gap: 10px; }
  .site-nav a { font-size: 13px; }
  .header-inner { height: 54px; }
}

/* ---------- Address card ---------- */
main { padding-top: 28px; }

.address-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  border-radius: var(--radius);
  padding: 26px 24px 20px;
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
}

.address-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
  margin-bottom: 10px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  padding: 8px;
}

#shortid {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: clamp(16px, 3.4vw, 21px); /* min 16px 防 iOS 聚焦自动放大 */
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: all;
  padding: 6px 4px;
}

#shortid::placeholder { color: rgba(255, 255, 255, .6); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease, transform .1s ease;
  text-decoration: none;
}

.btn:active { transform: scale(.96); }

.btn-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  flex-shrink: 0;
}

.btn-icon:hover { background: rgba(255, 255, 255, .3); }

.copy-toast {
  position: absolute;
  top: 18px;
  right: 20px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.copy-toast.show { opacity: 1; transform: translateY(0); }

.conn-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  opacity: .9;
}

.conn-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
}

.conn-status.connected .dot { background: #4ade80; }
.conn-status.disconnected .dot { background: #f87171; }
.conn-status.error .dot { background: #fbbf24; }

/* ---------- Info grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.info-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--primary);
}

.info-item b { color: var(--text); font-size: 14.5px; }
.info-item p { margin: 2px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

/* ---------- Inbox ---------- */
.inbox-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.inbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.inbox-head h1 { margin: 0; font-size: 19px; }
.inbox-hint { color: var(--text-secondary); font-size: 13px; }

.mail-list { list-style: none; margin: 0; padding: 0; }

.mail-list li {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) 2fr 92px;
  gap: 14px;
  align-items: center;
  padding: 13px 22px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s ease;
}

.mail-list li:hover { background: var(--primary-soft); }
.mail-list li.active { background: var(--primary-soft); }

.mail-list .from {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-list .subject {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-list .time {
  color: var(--text-secondary);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .mail-list li { grid-template-columns: 1fr 90px; }
  .mail-list .subject { display: none; }
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 20px 54px;
}

.empty-state svg { opacity: .35; margin-bottom: 10px; }
.empty-state p { margin: 0; }
.empty-state small { font-size: 12.5px; opacity: .8; }

/* ---------- Mail view ---------- */
.mail-view { border-top: 1px solid var(--border); }

.mail-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px 12px;
}

.mail-view-title h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.mail-from { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }

.mail-view-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid transparent;
}

.btn-ghost:hover { color: var(--primary); background: var(--primary-soft); }

.mail-frame {
  display: block;
  width: 100%;
  height: 460px;
  border: none;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; }

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
}

.modal-box {
  position: relative;
  margin: auto;
  width: min(860px, calc(100vw - 32px));
  max-height: 82vh;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { margin: 0; font-size: 15px; }

.modal-body { overflow: auto; }

.modal-body pre {
  margin: 0;
  padding: 18px;
  font-size: 12.5px;
  line-height: 1.5;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 200px;
}

/* ---------- SEO block ---------- */
.seo-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-top: 18px;
}

.seo-block h1 { margin: 0 0 10px; font-size: 20px; }
.seo-block h2 { margin: 18px 0 8px; font-size: 16px; }
.seo-block p { color: var(--text-secondary); margin: 0 0 12px; }
.seo-block ul { margin: 0; padding-left: 20px; color: var(--text-secondary); }
.seo-block li { margin: 3px 0; }

/* ---------- Primary button ---------- */
.btn-primary {
  background: var(--primary);
  color: #fff;
  height: 46px;
  padding: 0 26px;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 30px 20px 26px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
  margin-bottom: 14px;
}

.footer-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .info-grid { grid-template-columns: 1fr; }
  .address-card { padding: 20px 14px 16px; }
  .mail-frame { height: 380px; }
}
