@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* main colour scheme and font for site */
:root {
    /* 深色主题 (默认) */
    --bg-color: #121212; /* background */
    --surface-color: #1e1e1e; /* boxes background */
    --primary-color: #6a5acd; /* primary accent */
    --primary-color-rgb: 106, 90, 205; /* primary color RGB values */
    --primary-hover-color: #7b68ee; /* primary color when hovered */
    --text-color: #e0e0e0; /* text colour */
    --text-dark-color: #a0a0a0; /* darker text */
    --border-color: #333333; /* border of boxes */
    --font-family: 'Poppins', sans-serif; /* cool font */

    /* 主题切换相关 */
    --theme-transition: all 0.3s ease;
}

/* 浅色主题 */
[data-theme="light"] {
    --bg-color: #f8fafc; /* 浅灰白背景 */
    --surface-color: #ffffff; /* 纯白表面 */
    --primary-color: #5b21b6; /* 深紫色主色 */
    --primary-color-rgb: 91, 33, 182; /* 主色RGB值 */
    --primary-hover-color: #6d28d9; /* 悬停时的紫色 */
    --text-color: #1f2937; /* 深灰文字 */
    --text-dark-color: #6b7280; /* 中灰文字 */
    --border-color: #e5e7eb; /* 浅灰边框 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* set global propeties */
body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 1rem;
    transition: var(--theme-transition);
}

/* contains entire content of site */
.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* header at the top */
.header {
    text-align: center;
}

/* title text */
.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
      
/* email icon */
.header h1 img {
    width: 36px;
    height: 36px;
    filter: invert(39%) sepia(58%) saturate(1461%) hue-rotate(225deg) brightness(91%) contrast(93%); /* stupid ai generated code to get the email icon to match the primary colour */
}

/* description text */
.header p {
    color: var(--text-dark-color);
    font-size: 1.1rem;
}

/* email action panel box */
.email-panel {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeIn 0.5s ease-in-out; /* plays the cool fade in animation defined at the bottom of the css */
}

/* current email text box */
.email-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}


/* current email text */
#email-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-family);
}

/* stop it from looking weird when you click the email */
#email-input:focus {
    outline: none;
}

/* action button container */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

/* 首页主要操作按钮的专用样式 */
.main-action-btn {
    padding: 1rem 1.5rem;
    justify-content: center;
    width: 100%;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.main-action-btn:hover::before {
    left: 100%;
}

.main-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.main-action-btn:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

.main-action-btn img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.main-action-btn:hover img {
    transform: scale(1.1);
}

.main-action-btn .button-text {
    position: relative;
    z-index: 1;
}

/* action buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* button icons */
.btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* 浅色主题下的按钮图标 */
[data-theme="light"] .btn-secondary img {
    filter: none;
    opacity: 0.7;
}

[data-theme="light"] .btn-secondary:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* primary button (generate email) */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

/* hover effect */
.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

/* 主要按钮的特殊渐变效果 */
.main-action-btn.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    box-shadow:
        0 4px 15px rgba(var(--primary-color-rgb), 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-action-btn.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover-color), #8a7ce8);
    box-shadow:
        0 8px 30px rgba(var(--primary-color-rgb), 0.4),
        0 4px 15px rgba(0, 0, 0, 0.15);
}

/* secondary buttons */
.btn-secondary {
    background-color: #333;
    color: var(--text-color);
}

/* hover effect */
.btn-secondary:hover {
    background-color: #444;
    transform: translateY(-2px);
}

/* 主要次要按钮的特殊效果 */
.main-action-btn.btn-secondary {
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
    border: 2px solid var(--border-color);
    color: var(--text-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.main-action-btn.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow:
        0 8px 25px rgba(var(--primary-color-rgb), 0.3),
        0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 浅色主题下的次要按钮 */
[data-theme="light"] .btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

[data-theme="light"] .btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* inbox display box */
.inbox-section {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.7s ease-in-out;
}

/* inbox box title and refresh button container */
.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* inbox box title */
.inbox-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}
 
/* 刷新按钮现在使用通用按钮样式 */

/* spin effect when refreshing */
#refresh-btn.loading img {
    animation: spin 1s linear infinite;
}

/* list of emails */
#inbox-list {
    list-style: none;
}

/* placeholder when no emails present */
#inbox-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-dark-color);
}

/* single email */
.email-item {
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* dont add line if its the last one */
.email-item:last-child {
    border-bottom: none;
}

/* hover over email */
.email-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* sender and subject container */
.email-details {
    min-width: 0;
}

/* summary excluding body */
.email-summary {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

/* sender text */
.email-summary .sender {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* email subject text */
.email-summary .subject {
    color: var(--text-dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* time sent text */
.email-summary .time {
    color: var(--text-dark-color);
    font-size: 0.85rem;
    text-align: right;
}

/* the body container (closed) */
.email-body {
    padding: 0 1rem 1rem;
    max-height: none;
    overflow: visible;
}
 
/* email body iframe */
.email-body-iframe {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 8px;
}

/* the body container (open) */
.email-item.open .email-body {
    max-height: 1000px;
    padding-bottom: 1rem;
}

/* animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
        
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* mailbox management section */
.mailbox-section {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    animation: fadeIn 0.7s ease-in-out;
}

.mailbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.mailbox-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item label {
    font-weight: 600;
    color: var(--text-secondary);
}

.sender-whitelist {
    margin-bottom: 2rem;
}

.sender-whitelist h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.whitelist-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.whitelist-controls input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-color);
    color: var(--text-primary);
}

#sender-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sender-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

#sender-list .remove-sender {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

#sender-list .remove-sender:hover {
    background: #b91c1c;
}

.mailbox-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 集成式邮箱输入框 */
.email-input-container {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.email-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow:
        0 4px 20px rgba(var(--primary-color-rgb), 0.2),
        0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
    transform: translateY(-1px);
}

.email-prefix {
    flex: 2;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    min-width: 0;
}

.email-prefix::placeholder {
    color: var(--text-dark-color);
    font-weight: 400;
}

.email-prefix[readonly] {
    cursor: pointer;
    background: rgba(var(--primary-color-rgb), 0.08);
    border-radius: 8px 0 0 8px;
}

.email-prefix[readonly]:hover {
    background: rgba(var(--primary-color-rgb), 0.15);
}

.at-symbol {
    padding: 0 12px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.domain-selector {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: rgba(var(--primary-color-rgb), 0.05);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    min-width: 0;
    transition: background-color 0.3s ease;
}

.domain-selector:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.domain-selector option {
    background: var(--surface-color);
    color: var(--text-color);
    padding: 8px 12px;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* mobile design */
@media (max-width: 600px) {
    /* 整体容器优化 */
    .container {
        padding: 1rem;
        max-width: 100%;
    }

    /* 头部标题优化 */
    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .header p {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    /* 邮箱面板优化 */
    .email-panel {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    /* make buttons turn into icons */
    .button-text {
        display: none;
    }

    /* 手机端集成式邮箱输入框 */
    .email-input-container {
        flex-direction: column;
        border-radius: 16px;
        padding: 0;
        gap: 0;
    }

    .email-prefix {
        border-bottom: 1px solid var(--border-color);
        min-width: unset;
        padding: 1rem 1.25rem;
        border-radius: 16px 16px 0 0;
        font-size: 16px; /* 防止iOS缩放 */
    }

    .at-symbol {
        display: none;
    }

    .domain-selector {
        min-width: unset;
        width: 100%;
        padding: 1rem 1.25rem;
        border-radius: 0 0 16px 16px;
        font-size: 16px; /* 防止iOS缩放 */
        background: rgba(var(--primary-color-rgb), 0.08);
    }

    /* 移动端按钮布局 */
    .action-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .main-action-btn {
        padding: 1rem;
        font-size: 0.9rem;
        border-radius: 16px;
        min-height: 56px;
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-action-btn img {
        width: 24px;
        height: 24px;
        margin-bottom: 0.25rem;
    }

    /* 移动端显示按钮文字 */
    .main-action-btn .button-text {
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        text-align: center;
    }

    /* 收件箱区域优化 */
    .inbox-section {
        padding: 1.25rem;
        border-radius: 16px;
        margin-top: 1.5rem;
    }

    .inbox-header {
        margin-bottom: 1.25rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .inbox-header h2 {
        font-size: 1.1rem;
        flex: 1;
        min-width: 0;
    }

    /* 刷新按钮移动端优化 */
    .refresh-btn {
        padding: 0.75rem;
        border-radius: 12px;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
    }

    .refresh-btn img {
        width: 18px;
        height: 18px;
    }

    /* 邮件列表优化 */
    .email-item {
        border-radius: 12px;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-color);
        background: var(--surface-color);
    }

    .email-item:last-child {
        border-bottom: 1px solid var(--border-color);
    }

    .email-summary {
        padding: 1rem;
    }

    .email-details .sender {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .email-details .subject {
        font-size: 1rem;
        font-weight: 600;
    }

    .time {
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }

    .email-body {
        padding: 0 1rem 1rem;
    }

    .email-body-iframe {
        height: 300px;
        border-radius: 12px;
    }

    .mailbox-info {
        grid-template-columns: 1fr;
    }

    .whitelist-controls {
        flex-direction: column;
    }

    .mailbox-actions {
        flex-direction: column;
    }

    /* 移动端占位符优化 */
    #inbox-placeholder {
        padding: 2rem 1rem;
        text-align: center;
        font-size: 0.9rem;
    }

    /* 移动端滚动优化 */
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端点击区域优化 */
    .email-item {
        min-height: 60px;
    }

    .email-summary {
        min-height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* 主题切换按钮样式 - 深色主题 */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 16px rgba(var(--primary-color-rgb), 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    background: linear-gradient(135deg, var(--primary-hover-color), var(--primary-color));
    box-shadow:
        0 8px 32px rgba(var(--primary-color-rgb), 0.4),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-toggle:active {
    transform: scale(0.98) translateY(0px);
    transition: all 0.1s ease;
}

/* 浅色主题按钮样式 */
[data-theme="light"] .theme-toggle {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid var(--primary-color);
    box-shadow:
        0 4px 16px rgba(var(--primary-color-rgb), 0.15),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .theme-toggle:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    border-color: var(--primary-hover-color);
    box-shadow:
        0 8px 32px rgba(var(--primary-color-rgb), 0.25),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 深色主题图标样式 */
.theme-toggle .icon {
    font-size: 1.3rem;
    transition: var(--theme-transition);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.theme-toggle:hover .icon {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) brightness(1.1);
}

/* 浅色主题图标样式 */
[data-theme="light"] .theme-toggle .icon {
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

[data-theme="light"] .theme-toggle:hover .icon {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) brightness(1.1);
}

/* 深色主题图标 */
.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

/* 浅色主题图标 */
[data-theme="light"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: block;
}

/* 为所有表面元素添加过渡效果 */
.email-box,
.mailbox-management,
.admin-panel,
.test-section,
.info-box,
.emails-box,
.email-detail-box {
    transition: var(--theme-transition);
}

/* 顶部按钮容器 */
.top-buttons {
    position: fixed;
    top: 2rem;
    right: 6.5rem; /* 给主题切换按钮留出更多空间 */
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1.5rem; /* 增加按钮之间的间距 */
}

/* 登录按钮样式 */
.login-btn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.login-btn-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.login-btn-header:hover::before {
    left: 100%;
}

.login-btn-header:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
    border-color: var(--primary-color);
}

.login-btn-header i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.login-btn-header:hover i {
    transform: scale(1.1);
}

/* 浅色主题下的登录按钮 */
[data-theme="light"] .login-btn-header {
    background: linear-gradient(135deg, var(--surface-color), #f8fafc);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .login-btn-header:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.2);
}

/* 移动端顶部按钮 */
@media (max-width: 768px) {
    .top-buttons {
        top: 1rem;
        right: 5.5rem; /* 给主题切换按钮留出更多空间 */
        gap: 1rem; /* 增加按钮之间的间距 */
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        box-shadow: 0 3px 12px rgba(var(--primary-color-rgb), 0.3);
    }

    .theme-toggle .icon {
        font-size: 1.1rem;
    }

    .theme-toggle:hover {
        box-shadow: 0 4px 16px rgba(var(--primary-color-rgb), 0.5);
    }

    .login-btn-header {
        padding: 10px 16px;
        font-size: 13px;
    }

    .login-btn-header i {
        font-size: 14px;
    }

    /* 浅色主题移动端 */
    [data-theme="light"] .theme-toggle {
        box-shadow: 0 3px 12px rgba(var(--primary-color-rgb), 0.15);
    }

    [data-theme="light"] .theme-toggle:hover {
        box-shadow: 0 4px 16px rgba(var(--primary-color-rgb), 0.25);
    }
}

/* 底部管理链接 */
.footer-links {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 1s ease-in-out;
}

.admin-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.admin-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.admin-link:hover::before {
    left: 100%;
}

.admin-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
    border-color: var(--primary-color);
}

.admin-link i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.admin-link:hover i {
    transform: scale(1.1);
}

/* 浅色主题下的管理链接 */
[data-theme="light"] .admin-link {
    background: linear-gradient(135deg, var(--surface-color), #f8fafc);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .admin-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.2);
}

/* 移动端管理链接 */
@media (max-width: 768px) {
    .footer-links {
        margin-top: 1.5rem;
        padding: 1rem 0;
    }

    .admin-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .admin-link {
        width: 200px;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ========== 首页美化样式 ========== */

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.1), transparent);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    right: -150px;
    animation-delay: 5s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* 顶部导航栏 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-link-primary {
    background: var(--primary-color);
    color: white;
}

.nav-link-primary:hover {
    background: var(--primary-hover-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 6rem 2rem 3rem;
    margin-top: 60px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-dark-color);
    margin-bottom: 2rem;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.feature-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.feature-tag i {
    color: var(--primary-color);
}

/* Panel Card */
.panel-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.panel-header {
    text-align: center;
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.panel-header p {
    color: var(--text-dark-color);
}

/* 按钮样式增强 */
.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-icon-only {
    padding: 0.75rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 收件箱占位符 */
.inbox-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dark-color);
}

.placeholder-icon {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.inbox-placeholder p {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.inbox-placeholder small {
    font-size: 0.9rem;
}

/* 功能特性区域 */
.features-section {
    padding: 4rem 2rem;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(var(--primary-color-rgb), 0.2);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-dark-color);
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-copyright {
    color: var(--text-dark-color);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-features {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        padding: 1rem;
    }

    .nav-brand span {
        display: none;
    }

    .nav-link span {
        display: none;
    }
}
