*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background-color: #fafafa;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

@keyframes goldFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

:root {
    --gold: #d4a017;
    --gold-light: #f5d76e;
    --gold-dark: #c4900e;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --text: #2c3e50;
    --text-dim: #888;
    --text-light: #bbb;
    --border: #f0f0f0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 4px 16px rgba(212, 160, 23, 0.15);
}

/* ========== Navigation ========== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #d4a017, #f5d76e, #d4a017, #f5d76e);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldFlow 4s ease infinite;
}
.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}
.theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}
.theme-btn .icon-sun,
.theme-btn .icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}
.theme-btn .icon-moon {
    opacity: 0;
    transform: scale(0.5);
}
.dark-mode .theme-btn .icon-sun {
    opacity: 0;
    transform: scale(0.5);
}
.dark-mode .theme-btn .icon-moon {
    opacity: 1;
    transform: scale(1);
}
.dark-mode .theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-links a {
    display: block;
    padding: 8px 16px;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-links a:hover {
    color: #d4a017;
    background: rgba(212, 160, 23, 0.08);
}
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}
.nav-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #555;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle span + span {
    margin-top: 5px;
}
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Hero ========== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    background: linear-gradient(180deg, #fefcf5 0%, #fafafa 100%);
}
.hero-content {
    animation: fadeUp 0.8s ease-out;
}
.hero-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #d4a017, #f5d76e, #d4a017);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldFlow 4s ease infinite;
    margin-bottom: 12px;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 8px;
    font-weight: 400;
}
.hero-desc {
    font-size: 1rem;
    color: #999;
    max-width: 500px;
    margin: 0 auto 40px;
}
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #bbb;
    font-size: 0.8rem;
    animation: float 2s ease-in-out infinite;
}
.scroll-arrow {
    font-size: 1.2rem;
}

/* ========== Sections ========== */
.section {
    padding: 80px 24px;
}
.section:nth-child(even) {
    background: #ffffff;
}
.section:nth-child(odd) {
    background: #fafafa;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 40px;
    padding-left: 16px;
    border-left: 4px solid #d4a017;
}

/* ========== Form ========== */
.form-wrapper {
    max-width: 560px;
    margin: 0 auto;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e8e0d0;
    border-radius: 10px;
    color: #333;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: #d4a017;
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.12);
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #ccc;
}
.form-hint {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 4px;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    background: linear-gradient(135deg, #d4a017, #f5d76e);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}
.btn:hover {
    background: linear-gradient(135deg, #c4900e, #e8c85a);
    box-shadow: 0 2px 10px rgba(212, 160, 23, 0.3);
    transform: translateY(-1px);
}
.btn:active {
    transform: scale(0.97);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-block {
    width: 100%;
}
.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}
.btn-outline {
    background: transparent;
    color: #d4a017;
    border: 1.5px solid #d4a017;
}
.btn-outline:hover {
    background: rgba(212, 160, 23, 0.06);
    box-shadow: none;
}

/* ========== Messages List ========== */
.messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.messages-count {
    font-size: 0.9rem;
    color: #888;
}
.messages-count strong {
    color: #d4a017;
    font-weight: 700;
}
.messages-grid {
    display: grid;
    gap: 16px;
}
.message-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    animation: fadeUp 0.4s ease-out;
}
.message-card:hover {
    border-color: #f5d76e;
    box-shadow: 0 4px 16px rgba(212, 160, 23, 0.1);
    transform: translateY(-2px);
}
.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.message-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4a017, #f5d76e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.message-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}
.message-email {
    font-size: 0.8rem;
    color: #bbb;
    margin-top: 2px;
}
.message-time {
    font-size: 0.8rem;
    color: #bbb;
    white-space: nowrap;
}
.message-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    word-wrap: break-word;
}
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #bbb;
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}
.empty-state p {
    font-size: 1rem;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid #d4a017;
    color: #333;
    padding: 12px 24px;
    border-radius: 12px 12px 0 0;
    font-size: 0.9rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}

/* ========== Loading ========== */
.loading-spinner {
    text-align: center;
    padding: 60px 24px;
    color: #bbb;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #d4a017;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Footer ========== */
footer {
    text-align: center;
    padding: 32px 24px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
}
footer p {
    color: #bbb;
    font-size: 0.85rem;
}

/* ========== Animations ========== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0;
}
.tab {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-family: inherit;
}
.tab:hover {
    color: #d4a017;
}
.tab.active {
    color: #d4a017;
    border-bottom-color: #d4a017;
}

/* ========== Stats Cards ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #d4a017;
}
.stat-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: center;
        padding: 12px 24px 24px;
        gap: 2px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        transform: translateY(-110%);
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .nav-links a {
        padding: 12px 16px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
    }
    .nav-toggle {
        display: flex;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero {
        padding: 100px 20px 60px;
    }
    .section {
        padding: 60px 20px;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .messages-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 深色模式 ===== */
body.dark-mode {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode #navbar {
    background: rgba(26, 26, 46, 0.92);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-links a {
    color: #bbb;
}

body.dark-mode .nav-links a:hover {
    color: #f5d76e;
    background: rgba(245, 215, 110, 0.1);
}

body.dark-mode .nav-toggle span {
    background: #bbb;
}

body.dark-mode .nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .nav-links {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .hero {
    background: linear-gradient(180deg, #1e1e3a 0%, #1a1a2e 100%);
}

body.dark-mode .hero-subtitle {
    color: #aaa;
}

body.dark-mode .hero-desc {
    color: #888;
}

body.dark-mode .scroll-indicator {
    color: #666;
}

body.dark-mode section:nth-child(even) {
    background: #1e1e3a;
}

body.dark-mode section:nth-child(odd) {
    background: #1a1a2e;
}

body.dark-mode .section-title {
    color: #e0e0e0;
    border-left-color: #f5d76e;
}

body.dark-mode .form-group label {
    color: #bbb;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: #252545;
    border-color: #3a3a5c;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #f5d76e;
    box-shadow: 0 4px 20px rgba(245, 215, 110, 0.1);
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder {
    color: #666;
}

body.dark-mode .form-hint {
    color: #666;
}

body.dark-mode .message-card {
    background: #252545;
    border-color: #3a3a5c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-mode .message-card:hover {
    border-color: #f5d76e;
    box-shadow: 0 4px 16px rgba(245, 215, 110, 0.12);
}

body.dark-mode .message-name {
    color: #e0e0e0;
}

body.dark-mode .message-content {
    color: #bbb;
}

body.dark-mode .messages-count {
    color: #888;
}

body.dark-mode .empty-state {
    color: #666;
}

body.dark-mode .stat-card {
    background: #252545;
    border-color: #3a3a5c;
}

body.dark-mode .admin-card {
    background: #252545;
    border-color: #3a3a5c;
}

body.dark-mode .admin-card h3 {
    color: #e0e0e0;
    border-bottom-color: #3a3a5c;
}

body.dark-mode .admin-card .status-item {
    color: #bbb;
}

body.dark-mode .admin-card .status-item + .status-item {
    border-top-color: #3a3a5c;
}

body.dark-mode .batch-bar {
    border-bottom-color: #3a3a5c;
}

body.dark-mode .batch-bar .selected-count {
    color: #888;
}

body.dark-mode .msg-table th {
    color: #888;
    border-bottom-color: #3a3a5c;
}

body.dark-mode .msg-table td {
    color: #bbb;
    border-bottom-color: #3a3a5c;
}

body.dark-mode .msg-table tr:hover td {
    background: rgba(245, 215, 110, 0.03);
}

body.dark-mode .toast {
    background: #252545;
    border-color: #f5d76e;
    color: #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode footer {
    background: #1e1e3a;
    border-top-color: #3a3a5c;
}

body.dark-mode footer p {
    color: #666;
}
