/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a73e8;
  --blue-light: #e8f0fe;
  --blue-dark: #1557b0;
  --text: #202124;
  --text-2: #5f6368;
  --text-3: #80868b;
  --border: #dadce0;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --green: #188038;
  --green-light: #e6f4ea;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 24px; }
.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.nav { display: flex; gap: 24px; }
.nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--blue); text-decoration: none; }

/* ── Ad banner ── */
.ad-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  min-height: 70px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 40px 20px 24px;
}
.hero h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-2);
}

/* ── App layout ── */
.app-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  gap: 20px;
  align-items: start;
  padding-top: 0;
  padding-bottom: 32px;
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ── Address bar ── */
.address-bar {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}
.address-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.address-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.email-input {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: text;
  font-family: 'Google Sans', monospace;
  min-width: 0;
}
.email-input:focus { outline: none; }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover {
  background: var(--blue-light);
  color: var(--blue);
  border-color: var(--blue);
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
#timerText {
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
}
.timer-expired { color: #d93025 !important; }
.btn-extend {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--blue);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-extend:hover { background: var(--blue-light); }

/* ── Inbox header ── */
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.btn-refresh {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.btn-refresh:hover { background: var(--blue-light); }
.btn-refresh.spinning svg { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Message list ── */
.message-list { min-height: 320px; max-height: 520px; overflow-y: auto; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
}
.empty-icon { margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 15px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.empty-sub { font-size: 13px; line-height: 1.6; }

.message-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.message-item:hover { background: #f8f9ff; }
.message-item.active { background: var(--blue-light); }
.message-item.unread .msg-subject { font-weight: 700; color: var(--text); }
.msg-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.msg-time { font-size: 11px; color: var(--text-3); font-weight: 400; }
.msg-subject { font-size: 13px; color: var(--text); }
.msg-preview { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-new-badge {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

/* ── Message reader ── */
.reader-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.reader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--text-3);
  gap: 12px;
  padding: 32px;
}
.reader-empty svg { opacity: 0.25; }
.reader-empty p { font-size: 14px; }

.reader-content {
  padding: 24px;
}
.reader-subject {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
}
.reader-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.reader-meta-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
}
.reader-meta-label { color: var(--text-3); min-width: 36px; }
.reader-meta-value { color: var(--text); }
.reader-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.reader-body-html iframe {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: white;
}

/* ── Sidebar ad ── */
.sidebar-ad {
  padding: 0 16px 16px;
  min-height: 120px;
}
.mid-ad { margin: 24px 0; min-height: 90px; }

/* ── Info sections ── */
.info-section {
  padding: 56px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.info-section h2 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 36px;
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.step {
  text-align: center;
  padding: 24px 16px;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.step h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ── FAQ ── */
.faq-list { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 18px; color: var(--text-3); }
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); background: #fafbff; }
.faq-item p { padding: 14px 16px; font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
}
.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--text-3); }
.footer a:hover { color: var(--blue); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
