:root {
    --primary-color: #4a90d9;
    --primary-hover: #357abd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.navbar {
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.navbar .logo img {
    height: 42px;
    width: auto;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.navbar .nav-links a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar .nav-links a:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6dd5ed 100%);
    color: white;
    border-radius: 0 0 50px 50px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-action {
    background-color: var(--primary-color);
    color: white;
}

.btn-action:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #c82333;
}

.features {
    padding: 80px 20px;
}

.features h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.feature-card .icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
}

.auth-container {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background-color: var(--card-background);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.login-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background-color: var(--background-color);
    padding: 4px;
    border-radius: var(--border-radius);
}

.login-type-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.login-type-btn:hover {
    color: var(--primary-color);
}

.login-type-btn.active {
    background-color: var(--card-background);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-group input.error {
    border-color: var(--danger-color);
}

.error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 5px;
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.captcha-group input {
    flex: 1;
}

.captcha-group img {
    height: 48px;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.auth-card .btn {
    width: 100%;
    margin-top: 10px;
}

.auth-card .links {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

.auth-card .links a {
    color: var(--primary-color);
    margin-left: 5px;
}

.agreement {
    text-align: center;
    margin: 15px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.agreement a {
    color: var(--primary-color);
}

.dashboard {
    padding: 40px 20px;
}

.dashboard h1 {
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.sidebar {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
}

.host-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.host-card:hover {
    border-color: var(--primary-color);
}

.host-card h3 {
    margin-bottom: 10px;
}

.host-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.host-card .actions {
    display: flex;
    gap: 10px;
}

.page-list {
    list-style: none;
}

.page-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

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

.page-item .page-info {
    flex: 1;
}

.page-item .page-uri {
    font-weight: 500;
    color: var(--text-color);
}

.page-item .page-type {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-init { background-color: #e9ecef; color: #6c757d; }
.badge-static { background-color: #d4edda; color: #155724; }
.badge-rich { background-color: #cce5ff; color: #004085; }
.badge-plain { background-color: #fff3cd; color: #856404; }
.badge-mark { background-color: #d1ecf1; color: #0c5460; }
.badge-luac { background-color: #f8d7da; color: #721c24; }
.badge-python { background-color: #e2e3e5; color: #383d41; }
.badge-blockly { background-color: #ffeeba; color: #856404; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 20px;
}

.modal .form-group:last-of-type {
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.friend-links {
    padding: 60px 20px;
    background-color: var(--background-color);
}

.friend-links h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 40px;
    color: var(--text-color);
}

.links-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-background);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
}

.link-icon {
    font-size: 24px;
}

.link-name {
    font-weight: 500;
}


.footer {
    background-color: var(--card-background);
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

.toast-success { background-color: var(--success-color); }
.toast-error { background-color: var(--danger-color); }
.toast-warning { background-color: var(--warning-color); color: #333; }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==================== AI悬浮球样式 ==================== */

.ai-float-ball {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.ai-float-trigger {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(74, 144, 217, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.ai-float-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(74, 144, 217, 0.6);
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 24px rgba(74, 144, 217, 0.4), 0 0 0 0 rgba(74, 144, 217, 0.7);
    }
    50% {
        box-shadow: 0 8px 24px rgba(74, 144, 217, 0.4), 0 0 0 15px rgba(74, 144, 217, 0);
    }
    100% {
        box-shadow: 0 8px 24px rgba(74, 144, 217, 0.4), 0 0 0 0 rgba(74, 144, 217, 0);
    }
}

.ai-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.ai-text {
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-float-panel {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

.ai-float-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-panel-header {
    padding: 20px;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

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

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

.ai-panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ai-link-card:hover {
    border-color: #4a90d9;
    transform: translateX(-5px);
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.2);
}

.ai-link-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.ai-link-info {
    flex: 1;
}

.ai-link-info h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.ai-link-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.hero-highlight {
    font-size: 24px !important;
    margin-bottom: 30px !important;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .ai-float-ball {
        bottom: 20px;
        right: 20px;
    }

    .ai-float-trigger {
        width: 60px;
        height: 60px;
    }

    .ai-icon {
        font-size: 24px;
    }

    .ai-text {
        font-size: 10px;
    }

    .ai-float-panel {
        width: calc(100vw - 40px);
        right: -10px;
        bottom: 75px;
    }

    .ai-panel-header {
        padding: 16px;
    }

    .ai-panel-header h3 {
        font-size: 16px;
    }

    .ai-link-card {
        padding: 12px;
    }

    .ai-link-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .ai-link-info h4 {
        font-size: 15px;
    }

    .ai-link-info p {
        font-size: 12px;
    }

    .hero-highlight {
        font-size: 18px !important;
    }
}
