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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo i {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

#logoutBtn {
    color: #ef4444 !important;
}

#logoutBtn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.chatbot-icon:hover {
    transform: scale(1.1);
}

.chatbot-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.3s ease;
}

.chatbot-icon:hover .chatbot-avatar {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.chatbot-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary);
    animation: pulse 2s infinite;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 700;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.cta-button:active {
    transform: translateY(-1px);
}

.chat-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 420px;
    height: 560px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.25);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.chat-window.expanded {
    width: 800px;
    height: 600px;
    opacity: 1;
    transform: translateY(0);
}

.chat-window.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-overlay.active {
    display: block;
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-expand {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-expand:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-expand .fa-compress {
    display: none;
}

.chat-window.expanded .chat-expand .fa-expand {
    display: none;
}

.chat-window.expanded .chat-expand .fa-compress {
    display: inline;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.chat-title i {
    font-size: 1.25rem;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot-message {
    justify-content: flex-start;
}

.message.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bot-message .message-content {
    background: var(--surface-hover);
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: var(--primary);
}

.chat-input button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.chat-input button:active {
    transform: scale(0.95);
}

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

.tools-page {
    flex: 1;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.tools-container {
    max-width: 900px;
    margin: 0 auto;
}

.tools-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease;
}

.tools-header h1 {
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tools-header h1 i {
    color: var(--primary);
}

.tools-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.download-table {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1.25rem 1.5rem;
    background: var(--surface-hover);
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.table-row:nth-child(2) { animation-delay: 0.1s; }
.table-row:nth-child(3) { animation-delay: 0.15s; }
.table-row:nth-child(4) { animation-delay: 0.2s; }
.table-row:nth-child(5) { animation-delay: 0.25s; }
.table-row:nth-child(6) { animation-delay: 0.3s; }
.table-row:nth-child(7) { animation-delay: 0.35s; }
.table-row:nth-child(8) { animation-delay: 0.4s; }

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--surface-hover);
    transform: translateX(8px);
}

.col-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.col-name i {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.col-version {
    color: var(--text-light);
    font-size: 0.9rem;
}

.col-size {
    color: var(--text-light);
    font-size: 0.9rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--surface);
    border: 2px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.download-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.download-btn:hover::before {
    left: 0;
}

.download-btn:active {
    transform: translateY(0) scale(0.98);
}

.download-btn.downloading {
    pointer-events: none;
    opacity: 0.7;
}

.download-btn.success {
    border-color: var(--success);
    color: var(--success);
}

.download-btn.success::before {
    background: var(--success);
}

@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .chat-window {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 80px;
        height: 450px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .table-header {
        display: none;
    }

    .table-row {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .col-name {
        font-size: 1rem;
    }

    .col-version::before {
        content: '版本: ';
        color: var(--text-light);
    }

    .col-size::before {
        content: '大小: ';
        color: var(--text-light);
    }

    .col-action {
        width: 100%;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .chatbot-icon {
        width: 100px;
        height: 100px;
    }

    .chatbot-avatar {
        font-size: 2.5rem;
    }

    .tools-page {
        padding: 2rem 1rem;
    }
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0fdf4 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.login-container {
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

.login-box {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

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

.login-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group input:focus + i,
.input-group:focus-within i {
    color: var(--primary);
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.25rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.loading-indicator .message-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loading-indicator .message-content i {
    color: var(--primary);
}
