:root {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --bg-color: #eafbff;
    --surface-color: #ffffff;
    --text-color: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --success-color: #34a853;
    --danger-color: #ea4335;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #0f1419;
    --surface-color: #1a1f2e;
    --text-color: #e8eaed;
    --text-secondary: #9aa0a6;
    --border-color: #3c4043;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .site-header h1 {
    color: #e8eaed;
}

[data-theme="dark"] .highlight {
    color: #8ab4f8;
}

[data-theme="dark"] .tag:nth-child(1) {
    background: #1e3a5f;
    color: #8ab4f8;
}

[data-theme="dark"] .tag:nth-child(2) {
    background: #3d3000;
    color: #fdd663;
}

[data-theme="dark"] .tag:nth-child(3) {
    background: #0d3818;
    color: #81c995;
}

[data-theme="dark"] .address-display {
    background: #292e3a;
    border-color: var(--border-color);
}

[data-theme="dark"] .info-box {
    background: #1e3a5f;
}

[data-theme="dark"] .info-content h3 {
    color: #8ab4f8;
}

[data-theme="dark"] .info-content p {
    color: #aecbfa;
}

[data-theme="dark"] .btn-outline {
    background: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .btn-outline:hover {
    background: #292e3a;
}

[data-theme="dark"] .email-item:hover {
    background: #292e3a;
}

[data-theme="dark"] .feature-icon {
    background: #292e3a;
}

[data-theme="dark"] .test-tip {
    background: #292e3a;
}

[data-theme="dark"] .card-header h2 {
    color: #e8eaed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

.site-header {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.site-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f3460;
    margin-bottom: 1rem;
}

.site-header .highlight {
    color: #00a8e8;
    margin-left: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
    align-items: start;
}

.card {
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.address-card {
    gap: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.header-icon {
    background: #1a73e8;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f3460;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #f1f3f4;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.tag:nth-child(1) {
    background: #e8f0fe;
    color: #1a73e8;
}

.tag:nth-child(2) {
    background: #fff7e0;
    color: #f9ab00;
}

.tag:nth-child(3) {
    background: #e6f4ea;
    color: #34a853;
}

.address-display {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.address-display .label {
    font-size: 0.85rem;
    color: #9aa0a6;
    margin-bottom: 0.5rem;
}

.address-display input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 700;
    color: #202124;
    text-align: center;
    font-family: monospace;
    outline: none;
}

[data-theme="dark"] .address-display input {
    color: #e8eaed;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: none;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3);
}

.btn-primary:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #c1c3c7;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: #fce8e6;
    color: #d93025;
}

.btn-danger:hover {
    background: #fad2cf;
}

.btn-block {
    width: 100%;
}

.info-box {
    background: #e8f0fe;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.info-icon {
    color: #1a73e8;
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.info-content h3 {
    font-size: 0.95rem;
    color: #174ea6;
    margin-bottom: 0.25rem;
}

.info-content p {
    font-size: 0.85rem;
    color: #1967d2;
    line-height: 1.4;
}

/* Inbox Card */
.inbox-card {
    padding: 0;
    overflow: hidden;
}

.inbox-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.inbox-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #202124;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

[data-theme="dark"] .inbox-title {
    color: #e8eaed;
}

.inbox-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-box input {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    width: 200px;
    background: var(--surface-color);
    color: var(--text-color);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 250px;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

.email-list-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    min-height: 300px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    margin-bottom: 1.5rem;
    color: #dadce0;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #202124;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .empty-state h3 {
    color: #e8eaed;
}

.test-tip {
    margin-top: 1rem;
    font-size: 0.85rem;
    background: #f1f3f4;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.email-item {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s;
}

.email-item:hover {
    background: #f8f9fa;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.email-sender {
    font-weight: 600;
    color: #202124;
}

[data-theme="dark"] .email-sender {
    color: #e8eaed;
}

.email-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.email-subject {
    color: #5f6368;
    font-size: 0.9rem;
}

.email-detail {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-header h3 {
    font-size: 1.25rem;
}

.detail-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: flex-end;
}

.back-btn,
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    color: var(--text-color);
}

/* Features Section */
.features-section {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
    text-align: center;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: #202124;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .section-header h2 {
    color: #e8eaed;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 1.25rem;
    color: #202124;
    margin-bottom: 1rem;
    font-weight: 700;
}

[data-theme="dark"] .feature-card h3 {
    color: #e8eaed;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(-20px);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .inbox-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inbox-actions {
        flex-wrap: wrap;
    }

    .search-box input {
        width: 100%;
    }

    .search-box input:focus {
        width: 100%;
    }
}