* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 20px;
}

.login-panel {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-panel h2 {
    text-align: center;
    color: #1d72e8;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background-color: #1d72e8;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px 0;
}

button:hover {
    opacity: 0.9;
}

.login-error {
    color: red;
    text-align: center;
    margin-top: 10px;
    display: none;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    overflow: hidden;
}

/* PC端：顶部横向标签布局 */
.pc-layout {
    display: block;
}

.user-info {
    text-align: right;
    padding: 15px 24px;
    border-bottom: 1px solid #eee;
    background: white;
}

.user-info span {
    margin-right: 15px;
    color: #666;
}

.user-info button {
    padding: 5px 10px;
    background: #dc3545;
}

/* PC端横向标签 */
.tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
    background: white;
}

.tab-btn {
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-right: 5px;
}

.tab-btn.active {
    color: #1d72e8;
    border-bottom: 2px solid #1d72e8;
    font-weight: 500;
}

.tab-content-wrap {
    padding: 20px 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f5fa;
}

.no-data {
    text-align: center;
    padding: 50px;
    color: #999;
}

.success {
    color: green;
    margin-top: 10px;
    display: none;
}

.error {
    color: red;
    margin-top: 10px;
    display: none;
}

.hidden {
    display: none !important;
}

.search-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-item {
    flex: 1;
    min-width: 200px;
}

.user-actions {
    display: flex;
    gap: 5px;
}

.user-actions button {
    padding: 5px 10px;
    font-size: 12px;
}

.edit {
    background-color: #ffc107;
}

.delete {
    background-color: #dc3545;
}

/* ========== 手机端侧边栏布局 ========== */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: #f5f7fa;
    }
    
    .main-container {
        border-radius: 0;
        min-height: 100vh;
        display: none;
        flex-direction: row !important;
    }
    
    /* 侧边栏 + 内容区 左右布局 */
    .mobile-layout {
        display: flex;
        flex-direction: row;
        min-height: calc(100vh - 60px);
    }
    
    /* 侧边栏（竖向菜单） */
    .tab-nav {
        width: 130px;
        flex-direction: column;
        border-bottom: none;
        border-right: 1px solid #eee;
        padding: 16px 8px;
        margin-bottom: 0;
        background: #f8fafc;
        gap: 4px;
        flex-shrink: 0;
        height: auto;
    }
    
    .tab-btn {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        text-align: center;
        padding: 12px 8px;
        background: transparent;
        border-radius: 12px;
        border-bottom: none;
        margin-right: 0;
        font-size: 13px;
        font-weight: 500;
    }
    
    .tab-btn.active {
        background: #1d72e8;
        color: white;
        border-bottom: none;
    }
    
    /* 右侧内容区 */
    .tab-content-wrap {
        flex: 1;
        padding: 16px;
        overflow-x: hidden;
    }
    
    .user-info {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .form-group [style*="display: grid"],
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    button {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }
    
    input, select, textarea {
        font-size: 16px !important;
        padding: 12px;
    }
    
    .search-panel {
        flex-direction: column;
    }
    
    .friend-remark-input {
        font-size: 14px !important;
    }
    
    .friend-remark-input::placeholder {
        font-size: 13px;
    }
    
    .search-item {
        width: 100%;
    }
    
    #mapModal > div, 
    #customerDetailModal > div, 
    #handleResultModal > div, 
    #passwordModal > div {
        width: 95% !important;
        margin: 20px auto !important;
        max-height: 90% !important;
        overflow-y: auto;
    }
    
    #xingxiaoTemplate [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    input[type="radio"], 
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 5px;
        vertical-align: middle;
    }
    
    button, .tab-btn, [onclick] {
        touch-action: manipulation;
    }
    
    button:active, .tab-btn:active {
        opacity: 0.7;
    }
}

/* 统计卡片样式 */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* 交叉统计表格样式 */
#crossStatsContainer table {
    font-size: 13px;
}

#crossStatsContainer th,
#crossStatsContainer td {
    padding: 10px 8px;
    text-align: center;
}

/* 每日趋势表格样式 */
#dailyStatsTable td {
    padding: 8px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
} 
