/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --accent-color: #fbbc05;
    --danger-color: #ea4335;
    --dark-color: #333;
    --light-color: #f5f5f5;
    --white-color: #fff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #3b78e7;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.btn-secondary:hover {
    background-color: #2d9748;
}

.btn-dark {
    background-color: var(--dark-color);
    color: var(--white-color);
}

.btn-dark:hover {
    background-color: #444;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 卡片样式 */
.card {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.25);
    outline: none;
}

/* 导航样式 */
.nav-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.nav-link {
    padding: 10px 15px;
    color: var(--dark-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 500;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 弹性布局 */
.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* 边距工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .form-control {
        padding: 10px;
    }
    
    .btn {
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .modal-content {
        width: 95%;
        padding: 12px;
        max-width: 95%;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .modal-footer {
        padding-top: 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-label {
        margin-bottom: 5px;
    }
    
    .notification {
        width: 90%;
        left: 5%;
        right: 5%;
    }
    
    /* 调整聊天界面 */
    .chat-window {
        height: 350px !important;
    }
    
    .chat-message .message-content {
        max-width: 85% !important;
    }
    
    /* 调整定位界面 */
    .location-map {
        height: 250px !important;
    }
    
    /* 调整头部布局 */
    .header {
        flex-wrap: wrap;
    }
    
    .logo {
        font-size: 20px !important;
    }
    
    /* 调整视频播放区域 */
    .video-container {
        width: 95% !important;
    }
    
    .close-button {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }
    
    /* 调整联系我们页面 */
    .contact-tab {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
    
    /* 调整激活页面 */
    .activation-card {
        padding: 15px !important;
    }
}

@media (max-width: 360px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .form-control {
        font-size: 13px;
    }
    
    .modal-content {
        padding: 10px;
    }
}

/* 移动设备上的触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .item, .nav-link, .modal-close, .contact-tab {
        min-height: 44px; /* 增加触摸区域 */
    }
    
    input, select, textarea {
        font-size: 16px !important; /* 防止iOS缩放 */
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    transform: translateY(-20px);
    transition: var(--transition);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.modal-body {
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    z-index: 1001;
    transition: var(--transition);
    transform: translateX(120%);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--secondary-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

.notification-warning {
    border-left: 4px solid var(--accent-color);
} 