/* CSS Custom Properties for theming */
    :root {
      --primary-color: #3498db;
      --primary-hover: #2980b9;
      --secondary-color: #27ae60;
      --secondary-hover: #219653;
      --danger-color: #e74c3c;
      --warning-color: #e67e22;
      --success-color: #2ecc71;
      --text-primary: #2c3e50;
      --text-secondary: #666;
      --bg-primary: #f5f7fa;
      --bg-card: #ffffff;
      --border-color: #ddd;
      --shadow: 0 2px 10px rgba(0,0,0,0.1);
      --border-radius: 8px;
      --transition: all 0.3s ease;
    }
    
    /* Reset and base styles */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html {
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch; /* 平滑滚动(iOS) */
    }
    
    body {
      font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
      line-height: 1.6;
      color: var(--text-primary);
      background-color: var(--bg-primary);
      overflow-x: hidden;
      position: relative;
     
    }
    
    /* Layout */
    .container {
      max-width: 900px;
      margin: 0 auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
    }
    
    /* Header */
    .header {
      text-align: center;
      margin-bottom: 2rem;
      flex-shrink: 0;
    }
    
    .logo {
      font-size: 2.5rem;
      font-weight: bold;
      color: var(--primary-color);
      margin-bottom: 0.5rem;
      text-decoration: none;
    }
    
    .tagline {
      font-size: 1.1rem;
      color: var(--text-secondary);
      margin-bottom: 1rem;
    }
    
    /* Main content */
    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2rem;
    }
    
    /* Main content card */
    .main-card {
      background: var(--bg-card);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 2rem;
      flex-shrink: 0;
    }
    
    /* Controls section */
    .controls {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      justify-content: center;
      margin-bottom: 2rem;
    }
    
    /* Buttons */
    .btn {
      padding: 12px 24px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 1rem;
      transition: var(--transition);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      min-width: 120px;
      justify-content: center;
    }
    
    .btn-primary {
      background: var(--primary-color);
      color: white;
    }
    
    .btn-primary:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
    }
    
    .btn-secondary {
      background: var(--secondary-color);
      color: white;
    }
    
    .btn-secondary:hover {
      background: var(--secondary-hover);
      transform: translateY(-1px);
    }
    
    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    
    /* Email display */
    .email-display {
      background: linear-gradient(135deg, #e8f4fc 0%, #f0f9ff 100%);
      padding: 1.5rem;
      border-radius: var(--border-radius);
      margin: 1.5rem 0;
      border-left: 4px solid var(--primary-color);
      display: none;
    }
    
    .email-display.show {
      display: block;
      animation: slideIn 0.3s ease-out;
    }
    
    .email-address {
      font-size: 1.2rem;
      font-weight: bold;
      color: var(--primary-color);
      word-break: break-all;
      margin-bottom: 1rem;
      padding: 0.5rem;
      background: rgba(255, 255, 255, 0.7);
      border-radius: 4px;
      position: relative;
    }
    
    .copy-btn {
      position: absolute;
      right: 0.5rem;
      top: 50%;
      transform: translateY(-50%);
      background: var(--primary-color);
      color: white;
      border: none;
      padding: 0.25rem 0.5rem;
      border-radius: 3px;
      cursor: pointer;
      font-size: 0.8rem;
    }
    
    .expiry-info {
      color: var(--text-secondary);
      font-size: 0.9rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    
    .time-remaining {
      font-weight: bold;
      color: var(--success-color);
    }
    
    .expiry-warning {
      color: var(--warning-color);
      font-weight: bold;
    }
    
    .expired-warning {
      color: var(--danger-color);
      font-weight: bold;
      padding: 1rem;
      background: rgba(231, 76, 60, 0.1);
      border-radius: 4px;
      margin-top: 1rem;
    }
    
    /* Inbox section */
    .inbox-section {
      background: var(--bg-card);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 2rem;
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 400px; /* 设置最小高度而不是固定高度 */
      overflow: hidden;
    }
    
    .inbox-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
      gap: 1rem;
      flex-shrink: 0;
    }
    
    .inbox-title {
      font-size: 1.5rem;
      color: var(--text-primary);
    }
    
    .inbox-count {
      background: var(--primary-color);
      color: white;
      padding: 0.25rem 0.75rem;
      border-radius: 12px;
      font-size: 0.8rem;
      font-weight: bold;
    }
    
    /* Email list */
    .email-list {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      flex: 1;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 20px; 
    }
    
    .email-item {
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius);
      padding: 1.5rem;
      cursor: pointer;
      transition: var(--transition);
      background: var(--bg-card);
      flex-shrink: 0;
    }
    
    .email-item:hover {
      border-color: var(--primary-color);
      box-shadow: var(--shadow);
      transform: translateY(-1px);
    }
    
    .email-item.unread {
      border-left: 4px solid var(--primary-color);
      background: #f8fafc;
    }
    
    .email-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 0.5rem;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    
    .email-from {
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .email-time {
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    
    .email-subject {
      font-weight: 600;
      margin-bottom: 0.5rem;
      color: var(--text-primary);
    }
    
    .email-preview {
      color: var(--text-secondary);
      line-height: 1.4;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
    /* Modal */
    .email-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 1rem;
    }
    
    .modal-content {
      background: var(--bg-card);
      border-radius: var(--border-radius);
      max-width: 90%;
      max-height: 90%;
      overflow: auto;
      position: relative;
      box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    
    .modal-header {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        background: var(--bg-card);
        z-index: 1;
    }
    
    .modal-body {
      padding: 1.5rem;
    }
    
    .email-body {
      margin: 1rem 0;
      white-space: pre-wrap;
      line-height: 1.6;
    }
    
    .close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: var(--danger-color);
        color: white;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        font-weight: bold;
        z-index: 10;
        transition: var(--transition);
        line-height: 1;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .close-btn:hover {
        background: #c0392b;
        transform: scale(1.1);
    }

    .close-btn:focus {
        outline: 2px solid white;
        outline-offset: 2px;
    }
    
    /* Loading state */
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid rgba(255,255,255,0.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
    }
    
    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 3rem 1rem;
      color: var(--text-secondary);
    }
    
    .empty-state-icon {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }
    
    /* Footer */
    .footer {
      text-align: center;
      padding: 2rem 1rem;
      color: var(--text-secondary);
      font-size: 0.9rem;
      flex-shrink: 0;
      margin-top: auto;
    }
    
    .footer a {
      color: var(--primary-color);
      text-decoration: none;
    }
    
    .footer a:hover {
      text-decoration: underline;
    }
    
    /* Animations */
    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Navigation */
    .nav {
      text-align: center;
      margin-bottom: 2rem;
    }
    
    .nav a {
      color: var(--primary-color);
      text-decoration: none;
      font-weight: 500;
      transition: var(--transition);
    }
    
    .nav a:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }

    /* Main content */
    .main-content {
      background: var(--bg-card);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 3rem;
      margin-bottom: 2rem;
    }

    /* Typography */
    h1 {
      color: var(--primary-color);
      font-size: 2.5rem;
      margin-bottom: 1rem;
      text-align: center;
    }
    
    h2 {
      color: var(--text-primary);
      font-size: 1.5rem;
      margin-top: 2rem;
      margin-bottom: 1rem;
      padding-bottom: 0.5rem;
      border-bottom: 2px solid var(--primary-color);
    }
    
    h3 {
      color: var(--text-primary);
      font-size: 1.2rem;
      margin-top: 1.5rem;
      margin-bottom: 0.5rem;
    }
    
    p {
      margin-bottom: 1rem;
    }
    
    ul, ol {
      margin-bottom: 1rem;
      padding-left: 2rem;
    }
    
    li {
      margin-bottom: 0.5rem;
    }
    
    /* Links */
    a {
      color: var(--primary-color);
      text-decoration: none;
      transition: var(--transition);
    }
    
    a:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }
    
    /* Highlight boxes */
    .highlight-box {
      background: linear-gradient(135deg, #e8f4fc 0%, #f0f9ff 100%);
      padding: 1.5rem;
      border-radius: var(--border-radius);
      border-left: 4px solid var(--primary-color);
      margin: 1.5rem 0;
    }
    
    .warning-box {
      background: linear-gradient(135deg, #fff3cd 0%, #fef9e7 100%);
      padding: 1.5rem;
      border-radius: var(--border-radius);
      border-left: 4px solid #ffc107;
      margin: 1.5rem 0;
    }
    
    /* Contact section */
    .contact-section {
      background: var(--bg-card);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 2rem;
      text-align: center;
      margin-bottom: 2rem;
    }
    
    .contact-btn {
      display: inline-block;
      background: var(--primary-color);
      color: white;
      padding: 12px 24px;
      border-radius: 6px;
      text-decoration: none;
      font-weight: 600;
      transition: var(--transition);
      margin-top: 1rem;
    }
    
    .contact-btn:hover {
      background: var(--primary-hover);
      transform: translateY(-1px);
      color: white;
      text-decoration: none;
    }
    
    /* Responsive Design */
    @media (max-width: 768px) {
      
      
      body {
        /* padding-bottom: max(2rem, env(safe-area-inset-bottom, 0)); */
         /* max-height: calc(100vh - 200px); */
      }
      
      .container {
        padding: 1rem;
        padding-bottom: max(2rem, env(safe-area-inset-bottom, 0));
      }
      
      .main-card,
      .inbox-section {
        padding: 1.5rem;
      }
      
      .inbox-section {
        min-height: 300px;
        overflow: hidden;
      }
      
      .logo {
        font-size: 2rem;
      }
      
      .controls {
        flex-direction: column;
        align-items: stretch;
      }
      
      .btn {
        justify-content: center;
      }
      
      .email-header {
        flex-direction: column;
        align-items: flex-start;
      }
      
      .inbox-header {
        flex-direction: column;
        align-items: flex-start;
      }
      
      .modal-content {
        max-width: 95%;
        max-height: 95%;
      }
      
      /* Improve touch targets */
      .email-item {
        min-height: 80px;
        padding: 1rem;
      }
      
      .btn {
        min-height: 48px;
        padding: 12px 20px;
      }

      .main-content {
        padding: 2rem 1.5rem;
      }
      
      h1 {
        font-size: 2rem;
      }
      
      h2 {
        font-size: 1.3rem;
      }
      
      ul, ol {
        padding-left: 1.5rem;
      }
    }
    
    @media (max-width: 480px) {
        .close-btn {
            top: 0.5rem;
            right: 0.5rem;
            width: 28px;
            height: 28px;
            font-size: 1rem;
            min-height: 28px;
        }
        
        .modal-header {
            padding: 1.5rem 1rem 1rem 1rem;
        }
        
        .container {
          padding: 0.5rem;
          padding-bottom: max(2rem, env(safe-area-inset-bottom, 0));
        }   
        
        .main-card,
        .inbox-section {
          padding: 1rem;
        }
        
        .email-item {
          padding: 0.75rem;
          min-height: 70px;
        }
        
        .logo {
          font-size: 1.8rem;
        }
        
        .tagline {
          font-size: 1rem;
        }
        
        .email-address {
          font-size: 1rem;
          padding-right: 60px;
        }
        
        .copy-btn {
          right: 0.25rem;
          padding: 0.2rem 0.4rem;
          font-size: 0.7rem;
        }
        
        .footer {
          padding: 1.5rem 0.5rem;
          font-size: 0.8rem;
        }

        h1 {
          font-size: 1.8rem;
        }
    }
    
    /* iOS Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
      body {
        min-height: -webkit-fill-available;
     }
    
      .container {
        min-height: -webkit-fill-available;
      }
    }
    
    /* Dark mode support */
    @media (prefers-color-scheme: dark) {
      :root {
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --bg-primary: #1a202c;
        --bg-card: #2d3748;
        --border-color: #4a5568;
      }
    }
    
    /* Print styles */
    @media print {
      .controls,
      .footer {
        display: none;
      }
      
      .main-card,
      .inbox-section {
        box-shadow: none;
        border: 1px solid #ddd;
      }
    }
    
    /* Accessibility improvements */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    
    .btn:focus,
    .email-item:focus {
      outline: 2px solid var(--primary-color);
      outline-offset: 2px;
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
      :root {
        --shadow: 0 2px 4px rgba(0,0,0,0.3);
      }
      
      .btn {
        border: 2px solid currentColor;
      }
    }