:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --error-color: #f85149;
    --success-color: #3fb950;
    --font-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #f0f6fc;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

input[type="text"], input[type="email"] {
    flex: 1;
    background: #010409;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    font-family: var(--font-mono);
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
}

button {
    background: #21262d;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

button:hover {
    background: #30363d;
}

button.primary {
    background: #238636;
    border-color: #2ea043;
    color: #ffffff;
}

button.primary:hover {
    background: #2ea043;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

/* Inbox & Detail Navigation Header */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.inbox-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-color);
    word-break: break-all;
}

/* Message Item List */
.message-list {
    list-style: none;
}

.message-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 0;
    cursor: pointer;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    opacity: 0.85;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
}

.message-subject {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f0f6fc;
    margin-bottom: 0.2rem;
}

.message-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Message Detail */
.detail-meta-table {
    width: 100%;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.detail-meta-table td {
    padding: 0.25rem 0;
}

.detail-meta-table td.label {
    color: var(--text-secondary);
    width: 70px;
}

.message-body {
    background: #010409;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e6edf3;
    max-height: 450px;
    overflow-y: auto;
}

.attachment-badge {
    display: inline-block;
    background: #1f6beb33;
    color: var(--accent-color);
    border: 1px solid #1f6beb66;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--text-secondary);
    text-decoration: underline;
    margin: 0 0.5rem;
}

footer a:hover {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}
