/* edu.pdx0325.com 邮箱系统样式 — 暗色主题 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a1a;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3a;
    --bg-input: #1a1a35;
    --border: #2a2a55;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --code-bg: #1e1e40;
    --code-color: #00ff88;
    --success: #00d68f;
    --danger: #ff4757;
    --warning: #ffa502;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== 登录页 ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at top, #1a1a3a 0%, #0a0a1a 70%);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--accent-glow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe, #74b9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-muted); }

.input-suffix {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.input-suffix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-suffix input {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.input-suffix span {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 13px;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(255,255,255,0.02);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background: var(--success); color: #0a0a1a; }

.error-msg {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.admin-link {
    text-align: center;
    margin-top: 24px;
}

.admin-link a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-link a:hover { color: var(--accent); }

/* ==================== 收件箱 ==================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.header-user .info h3 {
    font-size: 14px;
    font-weight: 600;
}

.header-user .info p {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.inbox-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* 验证码卡片 */
.code-card {
    background: linear-gradient(135deg, #1a1a3a, #12122a);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.code-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c5ce7, #00ff88, #6c5ce7);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.code-card .label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.code-value {
    font-size: 56px;
    font-weight: 700;
    color: var(--code-color);
    letter-spacing: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    user-select: all;
}

.code-value:hover {
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    transform: scale(1.02);
}

.code-source {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.code-empty {
    font-size: 20px;
    color: var(--text-muted);
    padding: 20px 0;
}

.copy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--success);
    color: #0a0a1a;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 999;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.copy-toast.show { transform: translateX(-50%) translateY(0); }

/* 邮件列表 */
.email-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.email-list-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.refresh-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.refresh-btn.spinning { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.email-item {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.email-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.email-item .email-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.email-item .email-from {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.email-item .email-subject {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.email-item .email-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item .email-meta {
    text-align: right;
    flex-shrink: 0;
}

.email-item .email-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.email-code-badge {
    display: inline-block;
    background: rgba(0, 255, 136, 0.1);
    color: var(--code-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: monospace;
    margin-top: 6px;
}

.empty-inbox {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-inbox .icon { font-size: 48px; margin-bottom: 16px; }
.empty-inbox p { font-size: 15px; }

/* ==================== 邮件详情 ==================== */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.detail-back:hover { color: var(--accent); }

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.detail-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.detail-meta { font-size: 13px; color: var(--text-secondary); }
.detail-meta span { display: block; margin-bottom: 4px; }

.detail-codes {
    padding: 16px 24px;
    background: rgba(0, 255, 136, 0.05);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-codes .label { font-size: 13px; color: var(--text-secondary); }

.detail-body {
    padding: 24px;
    font-size: 15px;
    line-height: 1.8;
    overflow-x: auto;
}

.detail-body pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
}

.detail-body iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background: white;
    border-radius: 8px;
}

/* ==================== 管理后台 ==================== */
.admin-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.gen-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.gen-form .form-group { margin-bottom: 0; flex: 1; min-width: 120px; }

.gen-result {
    margin-top: 20px;
    background: var(--code-bg);
    border-radius: 12px;
    padding: 20px;
    display: none;
}

.gen-result table { width: 100%; border-collapse: collapse; }

.gen-result th, .gen-result td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.gen-result th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gen-result td { font-family: 'JetBrains Mono', monospace; }

.account-table {
    width: 100%;
    border-collapse: collapse;
}

.account-table th, .account-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.account-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.account-table tr:hover { background: var(--bg-card-hover); }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
    .login-box { padding: 32px 24px; }
    .code-value { font-size: 36px; letter-spacing: 4px; }
    .email-item .email-row { flex-direction: column; }
    .email-item .email-meta { text-align: left; }
    .gen-form { flex-direction: column; }
    .app-header { padding: 12px 16px; }
}
