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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* 移动端容器 */
.mobile-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
}

/* 美化头部样式 */
.header-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-bar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.header-bar h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #FFD700, #FF6B6B, #4ECDC4, #45B7D1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
}

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

.user-info {
    font-size: 16px;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.9);
}

.engineer-name {
    color: #FFD700 !important;
    font-weight: 800;
    font-size: 20px !important;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF8C00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 3px 12px;
    border-radius: 8px;
    display: inline-block;
    animation: glow 1.5s ease-in-out infinite alternate;
    position: relative;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700, 0 0 15px #FFA500;
    }
    to {
        text-shadow: 0 0 10px #FFA500, 0 0 20px #FF8C00, 0 0 30px #FF4500;
    }
}

.logout-btn {
    background: rgba(255,255,255,0.25);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.4);
    display: inline-block;
    margin-top: 10px;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* 定位警告样式 */
.location-warning {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53, #FF4757);
    color: white;
    padding: 18px 20px;
    text-align: center;
    font-weight: 800;
    font-size: 17px;
    border: 3px solid #FFD700;
    position: relative;
    animation: pulseWarning 2s infinite, shake 3s infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.5);
}

@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.8); }
    70% { box-shadow: 0 0 0 15px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

@keyframes shake {
    0%, 90%, 100% { transform: translateX(0); }
    92%, 96% { transform: translateX(-3px); }
    94%, 98% { transform: translateX(3px); }
}

.location-warning::before {
    content: '📍';
    margin-right: 12px;
    font-size: 22px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* 表单美化 */
.install-form {
    padding: 30px 25px;
    background: white;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 输入框美化 */
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    outline: none;
    transform: translateY(-2px);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* 选项卡美化 */
.tab-group {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e8ecf4;
    background: #f8fafc;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 15px;
    color: #6c757d;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.tab:hover::before {
    left: 100%;
}

.tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab:not(.active):hover {
    background: #e9ecef;
    color: #495057;
}

/* 定位按钮美化 */
.location-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

#locationDisplay {
    flex: 1;
    background: #f8f9fa;
    border: 2px dashed #6c757d;
    color: #6c757d;
    font-style: italic;
}

.btn-secondary {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.5);
}

.btn-secondary:active {
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 提交按钮美化 */
.btn-primary {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53, #FF4757);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.6);
}

.btn-primary:active {
    transform: translateY(-2px);
}

/* 版权信息 */
.copyright {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-weight: 600;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form {
    text-align: left;
}

.error-message {
    background: #ffe6e6;
    color: #d63031;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #d63031;
    font-weight: 600;
}

/* 后台样式 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #f8f9fa;
    min-height: 100vh;
}

.admin-nav {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.admin-content {
    padding: 30px;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 30px 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #667eea;
}

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

.stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    margin: 10px 0;
}

.stat-desc {
    color: #6c757d;
    font-size: 14px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* 按钮样式 */
.btn-edit {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header-bar h3 {
        font-size: 26px;
    }
    
    .engineer-name {
        font-size: 18px !important;
    }
    
    .admin-nav {
        flex-direction: column;
        padding: 15px;
    }
    
    .admin-nav a {
        text-align: center;
    }
    
    .location-group {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        min-width: auto;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .install-form {
        padding: 20px 15px;
    }
    
    .header-bar {
        padding: 20px 15px;
    }
    
    .header-bar h3 {
        font-size: 22px;
    }
    
    .location-warning {
        font-size: 15px;
        padding: 15px;
    }
}

/* 定位按钮脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(78, 205, 196, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0);
    }
}

/* 为定位按钮添加默认脉冲动画 */
.btn-secondary {
    animation: pulse 2s infinite;
}

/* 成功状态 */
.location-success {
    border-color: #27ae60 !important;
    background: #f8fff9 !important;
    color: #27ae60 !important;
}

/* 失败状态 */
.location-error {
    border-color: #e74c3c !important;
    background: #fff5f5 !important;
    color: #e74c3c !important;
}

/* 加载状态 */
.location-loading {
    border-color: #3498db !important;
    background: #f0f8ff !important;
    color: #3498db !important;
}